*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] { display: none !important; }

:root {
    --primary:       #2563eb;
    --primary-dark:  #1d4ed8;
    --primary-light: #eff6ff;
    --danger:        #dc2626;
    --danger-bg:     #fef2f2;
    --text-primary:  #111827;
    --text-secondary:#6b7280;
    --border:        #e5e7eb;
    --border-focus:  #2563eb;
    --bg:            #f1f5f9;
    --white:         #ffffff;
    --radius:        12px;
    --shadow:        0 20px 60px rgba(0, 0, 0, 0.12);
    --transition:    0.2s ease;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* ── 배경 도형 ── */
.background {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.background__shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
}

.background__shape--1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -160px;
    right: -160px;
}

.background__shape--2 {
    width: 400px;
    height: 400px;
    background: #7c3aed;
    bottom: -120px;
    left: -120px;
}

/* ── 레이아웃 ── */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* ── 카드 ── */
.card {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 40px 40px;
}

/* ── 헤더 ── */
.card__header {
    text-align: center;
    margin-bottom: 36px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    border-radius: 16px;
    margin-bottom: 20px;
    color: var(--primary);
}

.logo svg {
    width: 28px;
    height: 28px;
}

.card__title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card__subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── 폼 ── */
.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.form__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.form__icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
    flex-shrink: 0;
}

.form__input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 42px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form__input::placeholder {
    color: #d1d5db;
}

.form__input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form__group.is-error .form__input {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form__group--check {
    margin-top: 4px;
}
.form__check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.form__check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--border-focus, #2563eb);
}

.form__toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color var(--transition);
}

.form__toggle-pw:hover {
    color: var(--primary);
}

.form__toggle-pw svg {
    width: 16px;
    height: 16px;
}

.form__error {
    font-size: 0.75rem;
    color: var(--danger);
    min-height: 16px;
    line-height: 1.4;
}

/* ── 알림 박스 ── */
.form__alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--danger-bg);
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: var(--danger);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
}

.form__alert svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── 버튼 ── */
.btn--primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    width: 100%;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    margin-top: 4px;
    letter-spacing: 0.01em;
}

.btn--primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.btn--primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn--primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn__spinner {
    display: flex;
    animation: spin 0.75s linear infinite;
}

.btn__spinner svg {
    width: 18px;
    height: 18px;
}

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

/* ── 푸터 ── */
.footer {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
}

/* ── 반응형 ── */
@media (max-width: 480px) {
    .card {
        padding: 36px 24px 32px;
    }
}
