.auth-page {
    min-height: calc(100vh - 120px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px 16px 64px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
}

body.auth-shell .submenu,
body:has(.auth-page) .submenu {
    display: none !important;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.11);
    padding: 36px 32px;
    border: 1px solid #dfe7f2;
}

.signup-card {
    max-width: 640px;
}

.auth-card-header {
    margin-bottom: 24px;
}

.auth-alert {
    margin: -8px 0 18px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.auth-alert.error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #be123c;
}

.auth-badge {
    display: inline-block;
    margin: 0 0 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 0.85rem;
    font-weight: 800;
}

.auth-card-header h1 {
    margin: 0 0 10px;
    font-size: 2rem;
    color: #0f172a;
    font-weight: 900;
    letter-spacing: 0;
}

.auth-desc {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
}

.social-auth-panel {
    display: grid;
    gap: 9px;
    margin-bottom: 18px;
}

.social-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    border-radius: 12px;
    border: 1px solid #d6deea;
    background: #ffffff;
    color: #172033;
    font-size: 0.95rem;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.social-auth-btn::before {
    content: "";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.social-auth-btn.google {
    border-color: #d6deea;
}

.social-auth-btn.google::before {
    content: "G";
    color: #ffffff;
    background: conic-gradient(from -45deg, #4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0 100%);
}

.social-auth-btn.naver {
    border-color: #03c75a;
    background: #03c75a;
    color: #ffffff;
}

.social-auth-btn.naver::before {
    content: "N";
    color: #03c75a;
    background: #ffffff;
}

.social-auth-btn.kakao {
    border-color: #fee500;
    background: #fee500;
    color: #191600;
}

.social-auth-btn.kakao::before {
    content: "";
    border-radius: 50% 50% 50% 42%;
    background: #191600;
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4C6.5 4 2 7.5 2 11.8c0 2.7 1.8 5.1 4.5 6.5l-.7 2.6a.6.6 0 0 0 .9.6l3.2-2c.7.1 1.4.2 2.1.2 5.5 0 10-3.5 10-7.9S17.5 4 12 4Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4C6.5 4 2 7.5 2 11.8c0 2.7 1.8 5.1 4.5 6.5l-.7 2.6a.6.6 0 0 0 .9.6l3.2-2c.7.1 1.4.2 2.1.2 5.5 0 10-3.5 10-7.9S17.5 4 12 4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.social-auth-btn.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    color: #94a3b8;
    font-size: 0.83rem;
    font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    font-weight: 800;
    color: #28415f;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 52px;
    border: 1px solid #c8d5e6;
    border-radius: 12px;
    padding: 0 14px 0 42px;
    font-size: 1rem;
    color: #0f172a;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-sizing: border-box;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    z-index: 1;
    width: 18px;
    height: 18px;
    color: #8aa2c1;
    background: currentColor;
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: #3b82f6;
}

.auth-field-user .auth-input-icon {
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.5 7.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0ZM4 20a8 8 0 0 1 16 0' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.5 7.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0ZM4 20a8 8 0 0 1 16 0' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.auth-field-name .auth-input-icon {
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 7a4 4 0 1 0 8 0 4 4 0 0 0-8 0ZM5 21a7 7 0 0 1 14 0' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 7a4 4 0 1 0 8 0 4 4 0 0 0-8 0ZM5 21a7 7 0 0 1 14 0' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.auth-field-school .auth-input-icon {
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 10 12 5l8 5-8 5-8-5ZM6 12v4c2 2 10 2 12 0v-4' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 10 12 5l8 5-8 5-8-5ZM6 12v4c2 2 10 2 12 0v-4' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.auth-field-grade .auth-input-icon {
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 4h12v16H6zM9 8h6M9 12h6M9 16h3' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 4h12v16H6zM9 8h6M9 12h6M9 16h3' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.auth-field-phone .auth-input-icon {
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 3h8a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2ZM11 18h2' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 3h8a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2ZM11 18h2' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.auth-field-email .auth-input-icon {
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6h16v12H4zM4 7l8 6 8-6' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6h16v12H4zM4 7l8 6 8-6' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.auth-field-password .auth-input-icon,
.auth-field-password-check .auth-input-icon {
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10V8a5 5 0 0 1 10 0v2M6 10h12v10H6zM12 14v2' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10V8a5 5 0 0 1 10 0v2M6 10h12v10H6zM12 14v2' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.username-check-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 10px;
}

.username-check-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 52px;
    border: 1px solid #9fc5ff;
    border-radius: 12px;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.username-check-btn::before {
    content: "";
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 6 9 17l-5-5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 6 9 17l-5-5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.username-check-btn:hover {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #7fb0ff;
    box-shadow: 0 14px 24px rgba(37, 99, 235, 0.28);
    transform: translateY(-1px);
}

.username-check-btn:active {
    transform: translateY(0);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

.username-check-btn:disabled {
    cursor: wait;
    opacity: 0.8;
    transform: none;
}

.username-check-btn.is-checking::before {
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 999px;
    background: transparent;
    -webkit-mask: none;
    mask: none;
    animation: username-check-spin 0.75s linear infinite;
}

.username-check-btn.is-available {
    border-color: #86efac;
    background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.22);
}

@keyframes username-check-spin {
    to {
        transform: rotate(360deg);
    }
}

.form-group select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.consent-box {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #f8fbff;
}

.consent-check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #334155;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
}

.consent-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #2563eb;
}

.auth-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    height: 54px;
    border: none;
    border-radius: 14px;
    background: #4f9df3;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.login-submit-btn::before {
    content: "";
    width: 17px;
    height: 17px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4M10 17l5-5-5-5M15 12H3' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4M10 17l5-5-5-5M15 12H3' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.auth-submit-btn:disabled {
    background: #bfdbfe;
    color: #eff6ff;
    cursor: not-allowed;
}

.auth-submit-btn:hover {
    background: #3b8ced;
}

.auth-submit-btn:disabled:hover {
    background: #bfdbfe;
}

.auth-bottom-text {
    margin-top: 20px;
    text-align: center;
    color: #475569;
    font-size: 0.98rem;
}

.auth-bottom-text a {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.auth-bottom-text a:hover {
    text-decoration: underline;
}

.social-signup-summary {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    background: #f8fbff;
}

.social-signup-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    font-size: 0.95rem;
    color: #334155;
}

.social-signup-row span {
    color: #64748b;
    font-weight: 700;
}

.social-signup-row strong {
    color: #0f172a;
    text-align: right;
    word-break: break-all;
}

.social-cancel-btn {
    height: 52px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #334155;
    font-size: 0.98rem;
    font-weight: 800;
    cursor: pointer;
}

.social-cancel-btn:hover {
    background: #f8fafc;
}

.social-cancel-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #334155;
    font-size: 0.98rem;
    font-weight: 800;
    text-decoration: none;
}

.social-cancel-link:hover {
    background: #f8fafc;
}

.provider-notice {
    margin: -4px 0 18px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #dbe3ef;
    background: #f8fbff;
}

.provider-notice strong {
    display: block;
    margin-bottom: 8px;
    color: #0f172a;
    font-size: 0.98rem;
}

.provider-notice p {
    margin: 0;
    color: #475569;
    line-height: 1.55;
}

.provider-notice p + p {
    margin-top: 6px;
}

.provider-notice-naver {
    border-color: #b7ebcb;
    background: #f3fff7;
}

.social-signup-summary-stack {
    gap: 14px;
}

.social-signup-row-stack {
    display: grid;
    justify-content: stretch;
    gap: 6px;
}

.social-signup-row-stack strong {
    text-align: left;
    word-break: keep-all;
}

.provider-account-chip {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #dbe3ef;
    background: #ffffff;
}

.provider-account-label {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 800;
}

.provider-account-chip strong {
    color: #0f172a;
    font-size: 1rem;
    word-break: break-all;
}

.provider-account-chip-naver {
    border-color: #b7ebcb;
    background: #f7fff9;
}

.provider-account-chip-kakao {
    border-color: #f5e58a;
    background: #fffdf1;
}

.provider-account-chip-google {
    border-color: #dbe3ef;
    background: #f8fbff;
}

.social-choice-card {
    position: relative;
}

.social-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #ffffff;
    color: #64748b;
    text-decoration: none;
    font-size: 22px;
    line-height: 1;
    font-weight: 800;
}

.social-close-btn:hover {
    background: #f8fafc;
}

.social-choice-panel {
    display: grid;
    gap: 14px;
}

.social-choice-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 16px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 800;
}

.social-choice-btn.primary {
    border: none;
    background: #4f9df3;
    color: #ffffff;
}

.social-choice-btn.primary:hover {
    background: #3b8ced;
}

.social-choice-btn.secondary {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.social-choice-btn.secondary:hover {
    background: #f8fafc;
}

.social-choice-btn.ghost {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.social-choice-btn.ghost:hover {
    background: #f8fafc;
}

.social-choice-help {
    margin: 2px 0 0;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.55;
    text-align: center;
}

@media (max-width: 640px) {
    .auth-page {
        min-height: calc(100vh - 96px);
        align-items: flex-start;
        padding: 24px 12px 44px;
    }

    .auth-card,
    .signup-card {
        max-width: none;
        border-radius: 16px;
        padding: 28px 18px;
    }

    .auth-card-header h1 {
        font-size: 1.7rem;
    }

    .username-check-row {
        grid-template-columns: 1fr;
    }

    .username-check-btn {
        width: 100%;
        min-height: 46px;
    }

    .auth-form {
        gap: 13px;
    }

    .consent-box {
        padding: 12px;
    }
}
