/* 인증 화면 공통 스타일 (로그인 / 아이디·비밀번호 찾기 등) */
:root {
    --brand: #1fb5b7;
    --brand-dark: #138c8e;
    --brand-soft: #e8f8f8;
    --ink: #1d2433;
    --muted: #6b7385;
    --line: #e3e7ee;
    --bg: #f4f6fa;
    --radius: 12px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
.blind { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.auth { display: flex; min-height: 100vh; }

/* 좌측 브랜드 영역 */
.auth-hero {
    flex: 1 1 50%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 64px;
    color: #fff;
    background: linear-gradient(135deg, #0f7d8a 0%, #1fb5b7 55%, #5fd3c6 100%);
}
.auth-hero::before, .auth-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.auth-hero::before { width: 520px; height: 520px; right: -180px; top: -160px; }
.auth-hero::after  { width: 360px; height: 360px; left: -120px; bottom: -140px; }
.brand { position: relative; z-index: 1; font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.brand:hover, .brand:focus { color: #fff; text-decoration: none; }
.brand i { margin-right: 8px; }
.hero-copy { position: relative; z-index: 1; max-width: 440px; }
.hero-copy h2 { font-size: 36px; line-height: 1.35; font-weight: 800; letter-spacing: -.03em; margin: 0 0 16px; }
.hero-copy p { font-size: 16px; line-height: 1.7; opacity: .85; margin: 0; }
.hero-foot { position: relative; z-index: 1; font-size: 13px; opacity: .7; }

/* 우측 폼 영역 */
.auth-panel {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    padding: 44px 40px 36px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 12px 40px rgba(16,24,40,.08);
}
.auth-card h1.title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-card .subtitle { color: var(--muted); font-size: 14px; margin: 0 0 28px; }

.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    margin-bottom: 20px; font-size: 13px; color: var(--muted);
}
.back-link:hover { color: var(--brand-dark); text-decoration: none; }

/* 회원 유형 세그먼트 탭 */
.segment {
    display: flex;
    list-style: none;
    margin: 0 0 24px;
    padding: 4px;
    background: #f1f3f7;
    border-radius: var(--radius);
}
.segment li { flex: 1; }
.segment a {
    display: block;
    text-align: center;
    padding: 10px 0;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    transition: all .2s ease;
}
.segment a:hover { color: var(--ink); text-decoration: none; }
.segment a.active { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 3px rgba(16,24,40,.12); }

/* 입력 필드 */
.field { margin-bottom: 18px; }
.field > label, .field-label { display: block; font-size: 13px; font-weight: 600; color: #3a4252; margin-bottom: 8px; }
.input-wrap { position: relative; }
.input-wrap > .fa:first-child {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: #a2a9b7; font-size: 15px; pointer-events: none; transition: color .2s;
}
.input-wrap:focus-within > .fa:first-child { color: var(--brand); }
.input-wrap input, .select {
    width: 100%;
    height: 50px;
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.input-wrap input { padding: 0 46px 0 44px; }
.input-wrap input::placeholder { color: #b3b9c5; }
.input-wrap input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(31,181,183,.15); }
.toggle-pw {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border: 0; background: transparent;
    color: #a2a9b7; border-radius: 8px; cursor: pointer;
}
.toggle-pw:hover { color: var(--ink); background: #f4f6fa; }
.js-signup_ocode { animation: fadeIn .25s ease; }

/* 셀렉트 */
.select {
    padding: 0 34px 0 14px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a2a9b7' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.birth-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }

/* 선택 카드 (라디오) */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px 8px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    font-size: 14px; font-weight: 600; color: var(--muted);
    transition: all .2s;
}
.choice-body .fa { font-size: 20px; }
.choice:hover .choice-body { border-color: #c9d0db; color: var(--ink); }
.choice input:checked + .choice-body {
    border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark);
}
.choice input:focus-visible + .choice-body { box-shadow: 0 0 0 4px rgba(31,181,183,.15); }

/* 버튼 */
.btn-primary-x {
    width: 100%;
    height: 52px;
    margin-top: 8px;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(19,140,142,.28);
    transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn-primary-x:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(19,140,142,.32); }
.btn-primary-x:active { transform: translateY(0); }
.btn-primary-x:disabled { opacity: .7; cursor: default; transform: none; }

.find-link { text-align: right; margin: 14px 0 0; font-size: 13px; }
.find-link a { color: var(--muted); }
.find-link a:hover { color: var(--brand-dark); }

.divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 20px; color: #a2a9b7; font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.btn-ghost {
    display: block;
    width: 100%;
    height: 50px;
    line-height: 47px;
    text-align: center;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    transition: all .2s;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); text-decoration: none; }

@media (max-width: 991px) {
    .auth-hero { display: none; }
    .auth-panel { padding: 32px 16px; }
}
@media (max-width: 480px) {
    .auth-panel { align-items: flex-start; padding-top: 40px; }
    .auth-card { padding: 32px 22px 28px; border-radius: 16px; }
}

/* ---------- 인라인 오류 / 알림 ---------- */
:root { --danger: #e5484d; --danger-soft: #fdecec; --success: #12a150; --success-soft: #e7f7ee; }
.field.has-error .input-wrap input,
.field.has-error .select { border-color: var(--danger); }
.field.has-error .input-wrap input:focus,
.field.has-error .select:focus { box-shadow: 0 0 0 4px rgba(229,72,77,.15); }
.field.has-error .input-wrap > .fa:first-child { color: var(--danger); }
.field.has-error .choice-body { border-color: var(--danger); }
.field-error {
    margin: 7px 2px 0;
    font-size: 12.5px;
    color: var(--danger);
    animation: fadeIn .2s ease;
}
.field-hint { margin: 7px 2px 0; font-size: 12.5px; color: var(--muted); }
.form-alert {
    display: flex; gap: 10px; align-items: flex-start;
    margin-bottom: 20px; padding: 12px 14px;
    border-radius: 10px; font-size: 13.5px; line-height: 1.55;
    animation: fadeIn .2s ease;
}
.form-alert .fa { margin-top: 3px; }
.form-alert-error   { background: var(--danger-soft);  color: #b4232a; }
.form-alert-success { background: var(--success-soft); color: #0b7a3b; }
.form-alert-info    { background: var(--brand-soft);   color: var(--brand-dark); }

/* ---------- 체크박스 ---------- */
.check {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 0; font-size: 13.5px; font-weight: 500; color: #3a4252;
    cursor: pointer; user-select: none;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
    width: 20px; height: 20px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid #c9d0db; border-radius: 6px; background: #fff;
    color: #fff; font-size: 11px; transition: all .15s;
}
.check-box .fa { opacity: 0; transition: opacity .15s; }
.check input:checked + .check-box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .check-box .fa { opacity: 1; }
.check input:focus-visible + .check-box { box-shadow: 0 0 0 4px rgba(31,181,183,.18); }
.field.has-error .check-box { border-color: var(--danger); }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-options { margin: 4px 0 6px; font-size: 13px; }
.form-options a { color: var(--muted); }
.form-options a:hover { color: var(--brand-dark); }

.agree-box {
    padding: 14px 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: #fafbfc;
}
.agree-box a { font-size: 13px; color: var(--muted); text-decoration: underline; }
.agree-box a:hover { color: var(--brand-dark); }

/* ---------- 결과 화면 ---------- */
.result { text-align: center; padding: 8px 0 4px; animation: fadeIn .25s ease; }
.result-icon {
    width: 64px; height: 64px; margin: 0 auto 18px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-size: 28px;
}
.result h2 { font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.result p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 24px; }
.result .result-value {
    display: block; margin: 0 0 24px; padding: 16px;
    border-radius: var(--radius); background: #f4f6fa;
    font-size: 17px; font-weight: 700; color: var(--ink); word-break: break-all;
}
.result .btn-ghost { margin-top: 10px; }
a.btn-primary-x { display: flex; align-items: center; justify-content: center; text-decoration: none; }
a.btn-primary-x:hover { color: #fff; }

/* 비밀번호 강도 */
.pw-meter { display: flex; gap: 4px; margin-top: 8px; }
.pw-meter span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background .2s; }
.pw-meter[data-level="1"] span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-level="2"] span:nth-child(-n+2) { background: #f5a524; }
.pw-meter[data-level="3"] span:nth-child(-n+3) { background: var(--brand); }
.pw-meter[data-level="4"] span:nth-child(-n+4) { background: var(--success); }

/* 단일 카드 레이아웃 (모바일 웹뷰 등 히어로 없는 화면) */
.auth.auth-simple .auth-panel { flex: 1 1 100%; }
.auth-card.auth-card-wide { max-width: 460px; }

/* ---------- 로고 ---------- */
.brand img { display: block; height: 48px; width: auto; }
/* 히어로가 숨겨지는 화면에서 카드 상단에 브랜드 색 로고 표시 */
.card-logo {
    display: none;
    width: 108px; height: 36px; margin: 0 0 20px;
    background-color: var(--brand-dark);
    -webkit-mask: url('/images/logo_enbrain.png') no-repeat left center / contain;
            mask: url('/images/logo_enbrain.png') no-repeat left center / contain;
}
.auth-simple .card-logo { display: block; }
@media (max-width: 991px) { .card-logo { display: block; } }
