html,
body {
    min-height: 100%;
}

.auth-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    box-sizing: border-box;
    overflow-y: auto;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.14), transparent 30%),
        linear-gradient(135deg, #f8fbff 0%, #edf3fb 48%, #f7f9fc 100%);
    color: #172033;
}

.auth-shell {
    width: min(430px, 100%);
    padding: 0;
}

.auth-card {
    width: 100%;
    margin: 0;
    padding: 30px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 16px;
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.14);
}

.auth-card.auth-container {
    width: 100%;
    margin: 0;
}

.auth-logo {
    margin-bottom: 18px;
    text-align: center;
}

.auth-logo img {
    display: inline-block;
    max-width: 126px;
    height: auto;
}

.auth-title {
    margin: 0;
    color: #111827;
    font-size: 1.65rem;
    line-height: 1.2;
    font-weight: 800;
    text-align: center;
}

.auth-subtitle {
    margin: 8px 0 22px;
    color: #64748b;
    font-size: 0.95rem;
    text-align: center;
}

.auth-alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-weight: 700;
    font-size: 0.92rem;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-field {
    display: grid;
    gap: 7px;
}

.auth-field label,
.captcha-title {
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 700;
}

.auth-field input {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #172033;
    padding: 10px 13px;
    font-size: 1rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
    outline: none;
}

.captcha-box {
    display: grid;
    gap: 8px;
}

.captcha-title,
.captcha-instruction,
.captcha-status {
    margin: 0;
}

.puzzle-area {
    position: relative;
    width: 100%;
    height: 108px;
    border-radius: 12px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(15, 23, 42, 0.28)),
        url("/main_logo.png");
    background-size: cover;
    background-position: center;
    border: 1px solid #cbd5e1;
}

.puzzle-hole {
    position: absolute;
    top: 33px;
    left: var(--captcha-target-x);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.68);
    border: 2px dashed #102033;
    box-sizing: border-box;
}

.puzzle-piece {
    position: absolute;
    top: 33px;
    left: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
    transition: left 0.05s linear;
}

.slider-wrapper {
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
}

.slider-wrapper input[type="range"] {
    width: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

.captcha-instruction {
    color: #64748b;
    font-size: 0.86rem;
}

.captcha-status {
    min-height: 18px;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 800;
}

.auth-submit {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #2f7df4 0%, #1d5fd3 100%);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.25);
}

.auth-submit:hover {
    background: linear-gradient(180deg, #256fe8 0%, #194fb8 100%);
    transform: translateY(-1px);
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 2px 0 0;
    color: #64748b;
    font-size: 0.9rem;
}

.auth-links a {
    color: #2563eb;
    font-weight: 800;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

@media (max-width: 520px) {
    .auth-page {
        align-items: flex-start;
        padding: 18px;
    }

    .auth-card {
        padding: 24px 20px;
        border-radius: 14px;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-links {
        align-items: flex-start;
        flex-direction: column;
    }

    .puzzle-area {
        height: 102px;
    }

    .puzzle-hole,
    .puzzle-piece {
        top: 30px;
    }
}

