* {
    box-sizing: border-box;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    color: #1f2d3d;
    background: linear-gradient(135deg, #e8f0fb, #f7fafc);
}

.auth-shell {
    width: min(520px, 100% - 28px);
    margin: 24px auto 34px;
}

.auth-head {
    margin-bottom: 12px;
}

.auth-head h1 {
    margin: 0;
    font-size: 1.5rem;
}

.auth-head p {
    margin: 6px 0 0;
    color: #4f6072;
    font-size: 0.9rem;
}

.auth-card {
    border: 1px solid #c9d4e2;
    border-radius: 14px;
    padding: 16px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(22, 40, 63, 0.08);
}

.signup-step-indicator {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.signup-step-indicator li {
    border: 1px solid #c9d4e2;
    border-radius: 10px;
    padding: 8px 10px;
    background: #f7f9fc;
    color: #516476;
    display: grid;
    gap: 2px;
    font-size: 0.74rem;
}

.signup-step-indicator li strong {
    font-size: 0.68rem;
    letter-spacing: 0.02em;
}

.signup-step-indicator li.is-active {
    border-color: #2e6fd3;
    background: #e8f1ff;
    color: #184f9f;
    font-weight: 700;
}

.signup-step-indicator li.is-done {
    border-color: #7db08e;
    background: #edf7f0;
    color: #2f6d45;
}

.signup-step {
    display: grid;
    gap: 10px;
}

.signup-step-title {
    margin: 0;
    font-size: 1.03rem;
}

.signup-step-desc {
    margin: 0;
    color: #4f6072;
    font-size: 0.85rem;
    line-height: 1.5;
}

.agree-all {
    border: 1px solid #bfd1e7;
    border-radius: 10px;
    background: #f4f8ff;
    padding: 10px;
    font-weight: 700;
}

.consent-card {
    border: 1px solid #d1dce9;
    border-radius: 10px;
    background: #f9fbfe;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.consent-card-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.consent-card-title {
    margin: 0;
    font-size: 0.86rem;
    color: #243749;
    font-weight: 700;
}

.consent-card-body {
    border: 1px solid #deE6f1;
    border-radius: 8px;
    background: #ffffff;
    padding: 8px 10px;
    max-height: 92px;
    overflow: auto;
    font-size: 0.77rem;
    color: #4f6072;
    line-height: 1.55;
}

.consent-card-body p {
    margin: 0 0 6px;
}

.consent-card-body p:last-child {
    margin-bottom: 0;
}

.consent-check {
    font-size: 0.8rem;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.auth-tab {
    border: 1px solid #b6c7db;
    border-radius: 999px;
    padding: 7px 12px;
    background: #f4f8fd;
    color: #2c4562;
    cursor: pointer;
}

.auth-tab.is-active {
    background: #2e6fd3;
    border-color: #2e6fd3;
    color: #ffffff;
    font-weight: 700;
}

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

.auth-form label {
    display: grid;
    gap: 6px;
    color: #4e5f71;
    font-size: 0.84rem;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    height: 38px;
    border: 1px solid #b8c8da;
    border-radius: 8px;
    padding: 0 10px;
    font: inherit;
}

.auth-form input[readonly] {
    background: #f3f6fa;
    color: #5a6f86;
}

.auth-subsection {
    border: 1px solid #d1dce9;
    border-radius: 10px;
    background: #f9fbfe;
    padding: 10px;
    display: grid;
    gap: 10px;
}

.auth-subsection-title {
    margin: 0;
    font-size: 0.95rem;
}

.auth-note {
    margin: 0;
    color: #4f6072;
    font-size: 0.8rem;
}

.auth-inline-card {
    margin-top: 14px;
    border: 1px solid #d1dce9;
    border-radius: 10px;
    background: #f9fbfe;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.agree {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-form label.agree {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-form label.agree input[type="checkbox"] {
    margin: 0;
    vertical-align: middle;
}

.agree a {
    color: #2e6fd3;
}

.field-inline {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.field-message {
    display: block;
    margin-top: 6px;
    font-size: 0.76rem;
    color: #617488;
}

.field-message.is-success {
    color: #2f7a4f;
}

.field-message.is-error {
    color: #a33e3e;
}

.doc-open-btn {
    margin-left: auto;
    border: 1px solid #b6c7db;
    border-radius: 8px;
    background: #f4f8fd;
    color: #2e6fd3;
    font-size: 0.76rem;
    min-height: 30px;
    padding: 4px 8px;
    cursor: pointer;
}

.auth-btn {
    border: 1px solid transparent;
    border-radius: 9px;
    min-height: 38px;
    padding: 8px 12px;
    cursor: pointer;
    font: inherit;
}

.auth-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.auth-btn.primary {
    background: #2e6fd3;
    color: #fff;
}

.auth-btn.danger {
    border-color: #cf6a6a;
    background: #b74c4c;
    color: #fff;
}

.auth-btn.danger-outline {
    border-color: #cf6a6a;
    background: #fff7f7;
    color: #b74c4c;
    font-weight: 700;
}

.auth-btn.social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f6f8fb;
    border-color: #c5d0de;
    color: #223548;
    font-weight: 600;
}

.auth-btn.social.google {
    background: #ffffff;
    border-color: #dadce0;
    color: #202124;
}

.auth-btn.social.google:hover {
    background: #f8f9fa;
}

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

.auth-btn.social.naver:hover {
    background: #02b350;
    border-color: #02b350;
}

.auth-btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.step-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.divider {
    margin: 12px 0;
    display: flex;
    align-items: center;
    color: #6b7d90;
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #d3ddea;
}

.divider span {
    padding: 0 8px;
}

.social-row {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 8px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.google-icon,
.naver-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.social-label {
    line-height: 1;
}

.auth-message {
    min-height: 20px;
    margin: 8px 0 0;
    color: #944545;
    font-size: 0.84rem;
}

.auth-message.is-success {
    color: #2f7a4f;
}

.provider-hint {
    margin-top: 2px;
}

.auth-link-row {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #4e6072;
}

.auth-signup-link {
    color: #2e6fd3;
    text-decoration: none;
    font-weight: 700;
}

.auth-footer {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    justify-content: center;
    font-size: 0.78rem;
}

.auth-footer a {
    color: #4a637f;
    text-decoration: none;
}

.footer-doc-link {
    border: none;
    background: transparent;
    color: #4a637f;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.78rem;
    padding: 0;
}

.consent-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.consent-modal[hidden] {
    display: none;
}

.consent-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 14, 24, 0.52);
}

.consent-modal-panel {
    position: relative;
    width: min(640px, calc(100% - 24px));
    max-height: min(80vh, 760px);
    overflow: auto;
    border-radius: 12px;
    border: 1px solid #c4d2e4;
    background: #fff;
    box-shadow: 0 22px 36px rgba(15, 31, 53, 0.24);
    padding: 14px;
}

.consent-modal-panel h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.withdraw-modal-panel {
    border-color: #d7c7cf;
}

.withdraw-modal-note {
    margin: 0 0 12px;
    color: #4f6072;
    font-size: 0.84rem;
    line-height: 1.6;
}

.auth-modal-form {
    gap: 10px;
}

.consent-modal-body {
    color: #33495f;
    font-size: 0.86rem;
    line-height: 1.6;
}

.consent-modal-body p {
    margin: 0 0 10px;
}

.consent-modal-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@media (max-width: 560px) {
    .signup-step-indicator {
        grid-template-columns: 1fr;
    }

    .auth-inline-card {
        grid-template-columns: 1fr;
    }
}
