/* ============================================================
   Auth · Login Page — NAVER WORKS LoginPage Figma export 기반
     · 전체 배경 PNG (좌측 오렌지/레드 곡선)
     · 폼 우측 70.8% 지점 수직 중앙, 615px 폭
     · 입력 50px / 라디우스 10px / 폰트 16px
     · 버튼 50px, 가로 2분할 (로그인 var(--cms-blue-700), 회원가입 white)
   ============================================================ */

body.login-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--cms-ink);
    overflow: hidden;
    background: var(--cms-bg-surface);
}

.login-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* 배경 — 좌측에 오렌지/레드 곡선 PNG (cover) + 우측 상단 데코(흐림) */
.login-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url('/img/login/login_bg.png');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: cover;
}
/* 폼 뒤 미세한 6각형 데코 — 살짝 블러 + opacity 3% */
.login-bg::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 58.33%;
    transform: translate(-50%, -50%);
    width: 601px;
    height: 708px;
    background-image: url('/img/login/login_decor.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.03;
    filter: blur(15px);
    pointer-events: none;
}

/* 폼 컨테이너 — 우측 ~70% 지점 수직 중앙 */
.login-form-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 615px;
    margin-right: clamp(40px, 9vw, 200px);
    padding: 0 var(--cms-space-4);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--cms-space-3);
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.login-title {
    font-size: 64px;
    font-weight: 700;
    color: var(--cms-ink);
    text-align: center;
    margin: 0 0 80px 0;
    line-height: 30px;
    letter-spacing: -0.02em;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: var(--cms-space-2);
    margin-bottom: 28px;
}
.login-field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--cms-ink);
    line-height: 20px;
}
.login-input {
    position: relative;
    height: 50px;
}
.login-input > .fa,
.login-input > .fas {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cms-gray-400);
    font-size: 16px;
    pointer-events: none;
}
.login-input input {
    width: 100%;
    height: 50px;
    padding: 12px 16px 12px 40px;
    border: 0.889px solid var(--cms-gray-250);
    border-radius: var(--cms-radius-3);
    font-size: 16px;
    color: var(--cms-ink);
    background: var(--cms-bg-surface);
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.login-input input:focus {
    border-color: var(--cms-action-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.login-input input::placeholder {
    color: rgba(10, 10, 10, 0.5);
}

.login-remember {
    display: flex;
    align-items: center;
    gap: var(--cms-space-2);
    margin: 0 0 var(--cms-space-6) 0;
}
.login-remember input[type=checkbox] {
    width: 16px;
    height: 16px;
    margin: 0;
    border: 0.5px solid var(--cms-gray-400);
    border-radius: var(--cms-radius-1);
    accent-color: var(--cms-action-primary);
    cursor: pointer;
}
.login-remember label {
    font-size: 14px;
    font-weight: 500;
    color: var(--cms-gray-750);
    cursor: pointer;
    user-select: none;
}

.login-recaptcha {
    display: flex;
    justify-content: center;
    margin: 0 0 24px 0;
}

.login-actions {
    display: flex;
    gap: 19px;
}
.login-actions .btn {
    flex: 1;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
    border-radius: var(--cms-radius-3);
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
    border: none;
    padding: 0;
    line-height: 24px;
}
.login-actions .btn:active { transform: translateY(1px); }
.login-actions .btn-login {
    background: var(--cms-action-primary);
    color: var(--cms-white);
}
.login-actions .btn-login:hover { background: var(--cms-blue-700); }
.login-actions .btn-signup {
    background: var(--cms-bg-surface);
    color: var(--cms-gray-750);
    border: 0.889px solid var(--cms-gray-250);
}
.login-actions .btn-signup:hover { background: var(--cms-gray-60); }

.login-footer {
    margin-top: var(--cms-space-6);
    padding-top: var(--cms-space-3);
    border-top: 1px solid var(--cms-gray-120);
    text-align: center;
    width: 100%;
}
.login-copyright {
    font-size: 12px;
    color: var(--cms-ink);
    letter-spacing: 0.15px;
    line-height: 14px;
    margin: 0;
    font-family: 'Noto Sans', 'Noto Sans KR', sans-serif;
}

/* 알림 메시지 — Spring Security error/logout 파라미터 출력용 */
.login-alert {
    padding: var(--cms-space-3) var(--cms-space-4);
    border-radius: var(--cms-radius-3);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: var(--cms-space-2);
    line-height: 1.4;
}
.login-alert .fa { font-size: 16px; }
.login-alert.alert-warning {
    background: var(--cms-amber-tint);
    color: var(--cms-warn-text);
    border: 1px solid var(--cms-amber-tint);
}
.login-alert.alert-danger {
    background: var(--cms-red-tint);
    color: var(--cms-danger-text);
    border: 1px solid var(--cms-red-border);
}
.login-alert.alert-success {
    background: var(--cms-green-tint);
    color: var(--cms-success-text);
    border: 1px solid var(--cms-green-tint);
}

/* ============================================================
   반응형 — 좁은 화면에서 폼 중앙 / 모바일 1열 버튼
   ============================================================ */
@media (max-width: 1280px) {
    .login-shell { justify-content: center; }
    .login-form-wrap { margin-right: 0; max-width: 560px; }
}
@media (max-width: 640px) {
    .login-form-wrap { padding: 24px 20px; max-width: 100%; }
    .login-title { font-size: 40px; margin-bottom: 48px; }
    .login-field { margin-bottom: 20px; }
    .login-actions { flex-direction: column; gap: 12px; }
    .login-bg { background-position: top center; }
    .login-bg::after { display: none; }
}

/* ============================================================
   회원가입 모달 — Figma 화면설계서 V0.1 기준
     · Primary action = 빨강(var(--cms-red-600))
     · 인풋 44px / 라디우스 8px / 검증 메시지 빨강
     · 2-컬럼 그리드, 동의서 펼침 카드, 02:59 인라인 타이머
   ============================================================ */

.register-modal-overlay .register-modal {
    max-width: 880px;
    width: 95%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}
.register-modal-header {
    border-bottom: 1px solid var(--cms-gray-200);
    padding: 18px 24px;
}
.register-modal-header .cms-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--cms-ink);
    margin: 0;
    display: flex;
    align-items: center;
}
.register-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.register-modal-footer {
    border-top: 1px solid var(--cms-gray-200);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* 그리드 */
.reg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
}
.reg-col-full { grid-column: 1 / -1; }

.reg-field { display: flex; flex-direction: column; gap: 6px; }
.reg-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--cms-ink);
    line-height: 18px;
}
.reg-req { color: var(--cms-danger-text); margin-left: 2px; }

/* 인풋 */
.reg-input {
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--cms-gray-250);
    border-radius: 8px;
    font-size: 14px;
    color: var(--cms-ink);
    background: var(--cms-bg-surface);
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.reg-input::placeholder { color: var(--cms-gray-400); }
.reg-input:focus {
    border-color: var(--cms-red-600);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.reg-input:disabled { background: var(--cms-gray-120); color: var(--cms-gray-500); cursor: not-allowed; }
.reg-select { appearance: none; background: var(--cms-bg-surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236b7280' d='M6 8L0 0h12z'/></svg>") no-repeat right 14px center; padding-right: 36px; cursor: pointer; }

/* 인풋 + 우측 버튼 (row) */
.reg-input-row { display: flex; gap: 8px; align-items: stretch; }
.reg-input-row .reg-input { flex: 1 1 auto; min-width: 0; }

/* 비밀번호 표시 토글 */
.reg-input-pw { position: relative; }
.reg-input-pw .reg-input { padding-right: 40px; }
.reg-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--cms-gray-500);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.reg-eye:hover { color: var(--cms-ink); }

/* 도움말 / 검증 메시지 */
.reg-help {
    font-size: 12px;
    color: var(--cms-gray-500);
    line-height: 16px;
    margin-top: 2px;
}
.reg-err { color: var(--cms-danger-text); }
.reg-help.text-success { color: var(--cms-success-text); }

/* 버튼 — Figma: Primary는 빨강 채움 */
.reg-btn {
    height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.reg-btn:active:not(:disabled) { transform: translateY(1px); }
.reg-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.reg-btn-danger {
    background: var(--cms-red-600);
    color: var(--cms-white);
    border-color: var(--cms-red-600);
}
.reg-btn-danger:hover:not(:disabled) { background: var(--cms-red-700); border-color: var(--cms-red-700); }

.reg-btn-outline {
    background: var(--cms-bg-surface);
    color: var(--cms-gray-750);
    border-color: var(--cms-gray-250);
}
.reg-btn-outline:hover:not(:disabled) { background: var(--cms-gray-60); }

.reg-btn-sm { height: 44px; padding: 0 14px; font-size: 13px; }
.reg-btn-wide { min-width: 140px; }

/* 2차 인증 — QR 박스 */
.reg-totp-area {
    align-self: stretch;
    display: flex;
    align-items: stretch;
}
.reg-totp-qr {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 180px;
    border: 1px solid var(--cms-gray-250);
    border-radius: 8px;
    background: var(--cms-gray-120);
    overflow: hidden;
}
.reg-totp-qr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.reg-totp-qr img[src=""] { display: none; }
.reg-totp-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--cms-gray-400);
    font-size: 12px;
}
.reg-totp-placeholder .fa { font-size: 36px; opacity: 0.5; }

/* 2차 인증 — OTP 입력 + 인라인 타이머 + 인증하기 */
.reg-input-otp { position: relative; }
.reg-otp-timer {
    color: var(--cms-danger-text);
    font-weight: 600;
    font-size: 13px;
    align-self: center;
    min-width: 48px;
    text-align: right;
    margin-right: 4px;
}

/* TOTP 안내문 */
.reg-totp-guide {
    background: transparent;
    padding: 0;
    margin-top: -8px;
}
.reg-guide-line {
    margin: 0;
    color: var(--cms-danger-text);
    font-size: 12px;
    line-height: 18px;
}

/* 개인정보 동의서 */
.reg-consent {
    border: 1px solid var(--cms-gray-200);
    border-radius: 8px;
    background: var(--cms-gray-60);
    padding: 14px 16px;
    margin-top: 4px;
}
.reg-consent-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}
.reg-consent-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.reg-consent-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--cms-ink);
    line-height: 20px;
}
.reg-consent-summary {
    font-size: 12px;
    color: var(--cms-gray-500);
    line-height: 18px;
    margin: 0;
}
.reg-consent-chevron {
    flex: 0 0 auto;
    color: var(--cms-gray-500);
    font-size: 12px;
    margin-top: 6px;
    transition: transform 0.2s;
}
.reg-consent.expanded .reg-consent-chevron { transform: rotate(180deg); }

.reg-consent-body {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--cms-gray-200);
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.reg-consent-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.reg-consent-section {
    background: var(--cms-bg-surface);
    border: 1px solid var(--cms-gray-200);
    border-radius: 6px;
    padding: 12px 14px;
}
.reg-consent-h {
    font-size: 13px;
    font-weight: 700;
    color: var(--cms-ink);
    margin: 0 0 6px 0;
}
.reg-consent-p {
    font-size: 12px;
    color: var(--cms-gray-700);
    line-height: 18px;
    margin: 0 0 4px 0;
}
.reg-consent-ul {
    margin: 4px 0 8px 18px;
    padding: 0;
    font-size: 12px;
    color: var(--cms-gray-700);
    line-height: 18px;
}
.reg-consent-ul li { margin-bottom: 2px; }
.reg-consent-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--cms-ink);
    cursor: pointer;
    user-select: none;
}
.reg-consent-check input[type=checkbox],
.reg-consent-all input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--cms-red-600);
    cursor: pointer;
}
.reg-consent-all {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--cms-ink);
    cursor: pointer;
    user-select: none;
}

/* ALERT 모달 */
.reg-alert-overlay .reg-alert {
    max-width: 460px;
    width: 92%;
    border-radius: 12px;
    padding: 0;
}
.reg-alert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 8px 24px;
}
.reg-alert-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--cms-ink);
    letter-spacing: 0.05em;
}
.reg-alert-header .btn-modal-close {
    border: 0;
    background: transparent;
    font-size: 20px;
    color: var(--cms-ink);
    cursor: pointer;
    line-height: 1;
}
.reg-alert-body {
    padding: 12px 24px 24px 24px;
    font-size: 14px;
    color: var(--cms-ink);
    line-height: 22px;
}
.reg-alert-footer {
    padding: 0 24px 24px 24px;
    display: flex;
    justify-content: center;
}

/* 반응형 */
@media (max-width: 720px) {
    .reg-grid { grid-template-columns: 1fr; gap: 14px; }
    .register-modal-body { padding: 18px; }
    .register-modal-header, .register-modal-footer { padding: 14px 18px; }
}

/* ---------- 2FA 인증 화면(2fa-totp/2fa-email) — 인라인 style 이전(머지 DS화) ---------- */
.tfa-subtitle { margin-top: -30px; }
.tfa-ttl { float: right; }
.tfa-center { text-align: center; }
.tfa-hint { font-size: .75rem; margin-top: 8px; }
.tfa-secret-code { font-size: .85em; padding: 2px 6px; background: var(--cms-gray-120); border-radius: 3px; user-select: all; }
