/**
 * 로그인·회원가입 (/auth/login, /auth/register)
 * 서체는 공용 typography.css 의 Pretendard(한글 글리프 있음) 그대로 — 화면에서 따로 정하지 않는다.
 * 카드·폼·버튼·모달은 공용 부품, 여기는 배치와 모자란 부분만.
 */

.auth-page [hidden] {
    display: none !important;
}

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-4);
    background: var(--color-background);
}

.auth-card {
    width: 100%;
    max-width: 26.25rem;
    box-shadow: var(--shadow-lg);
}

.auth-card.is-wide {
    max-width: 37.5rem;
}

.auth-head {
    padding: var(--space-6) var(--space-4) var(--space-4);
    text-align: center;
}

.auth-logo {
    margin: 0;
    font-size: var(--text-3xl);
    line-height: 1.2;
    color: var(--color-text-primary);
}

.auth-title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
}

.auth-sub {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* 라이트/다크 전환 버튼 */
.auth-mode-toggle {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.auth-mode-toggle:hover {
    border-color: var(--color-primary);
    background: var(--color-surface-hover);
}

.auth-mode-toggle:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* 비밀번호 보기 */
.auth-pw {
    position: relative;
}

.auth-pw .form-input {
    padding-right: 3rem;
}

.auth-pw-toggle {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: var(--radius-md);
    background: none;
    color: var(--color-text-secondary);
    cursor: pointer;
}

.auth-pw-toggle:hover {
    color: var(--color-text-primary);
}

.auth-pw-toggle:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.auth-caps {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-warning-fg);
}

.auth-remember {
    margin-bottom: var(--space-4);
}

/* 구분선 */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-4) 0;
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.auth-alt {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.auth-link {
    margin-left: var(--space-1);
    color: var(--color-primary-fg);
    font-weight: var(--font-semibold);
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-foot {
    padding: var(--space-3);
    text-align: center;
}

.auth-foot a {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    text-decoration: underline;
}

/* 회원가입 */
.auth-section {
    margin-bottom: var(--space-4);
}

.auth-section-title {
    margin: 0 0 var(--space-3);
    padding-bottom: var(--space-1);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

.auth-switch {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
}

.auth-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.auth-upper {
    text-transform: uppercase;
}

.auth-check-msg {
    display: block;
}

.auth-check-msg.is-ok   { color: var(--color-success-fg); }
.auth-check-msg.is-bad  { color: var(--color-danger-fg); }
.auth-check-msg.is-wait { color: var(--color-text-tertiary); }

/* 파일 놓는 곳(사업자등록증) */
.auth-drop {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 3rem;
    padding: var(--space-2) var(--space-3);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-subtle);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.auth-drop:hover,
.auth-drop.is-dragover {
    border-color: var(--color-primary);
    color: var(--color-primary-fg);
}

.auth-file-preview {
    margin-top: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    background: var(--color-bg-subtle);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    overflow-wrap: anywhere;
}

.auth-agree a {
    color: var(--color-primary-fg);
    font-weight: var(--font-medium);
}

/* 약관 모달 내용 */
.auth-policy .modal-body h2 {
    margin: var(--space-4) 0 var(--space-2);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

.auth-policy .modal-body h2:first-child {
    margin-top: 0;
}

.auth-policy .modal-body h3 {
    margin: var(--space-3) 0 var(--space-2);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

.auth-policy .modal-body p,
.auth-policy .modal-body ul,
.auth-policy .modal-body ol {
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.auth-policy .modal-body ul,
.auth-policy .modal-body ol {
    padding-left: var(--space-4);
}

.auth-policy-loading {
    padding: var(--space-6);
    text-align: center;
    color: var(--color-text-secondary);
}

.auth-policy-loading.is-error {
    color: var(--color-danger-fg);
}

@media (max-width: 767px) {
    .auth-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .auth-page {
        align-items: flex-start;
        padding-top: calc(var(--space-6) + 2.75rem);
    }
}
