/* shared/style.css - 세 사이트(선교회·신학원·관리자) 공통 로그인·가입·비밀번호 화면
   색상 토큰은 theme.css 에서 온다 (이 파일보다 먼저 불러올 것). */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
    color: var(--ink);
    line-height: 1.6;
    background: var(--brand-gradient-soft);
}

a { color: var(--brand-600); }

[hidden] { display: none !important; }

/* 언어 전환(오른쪽 위)은 shared/theme.css 의 .lang-switch .lang-switch-floating */

/* ── 화면 가운데 카드 ───────────────────────────── */
.auth-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    overflow-x: hidden;
}

/* 배경 - 신학원 사진을 흐리게 깔아준다 */
.auth-page::before {
    content: '';
    position: fixed;
    inset: -40px;
    background: url('background.jpg') center / cover no-repeat;
    filter: blur(16px);
    opacity: 0.18;
    z-index: 0;
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 45px -12px rgba(11, 92, 173, 0.28);
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    position: relative;
    overflow: hidden;
    background: var(--brand-gradient);
    color: #fff;
    text-align: center;
    padding: 40px 32px 34px;
}

.auth-header::before {
    content: '';
    position: absolute;
    inset: -50% -50% auto auto;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 65%);
    pointer-events: none;
}

/* 로고 - 투명 PNG 그대로 (신학원 로그인과 동일) */
.auth-logo {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
}

.auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.auth-header h1 {
    position: relative;
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

/* 신학원 로그인 - 이름 옆 에콰도르 국기 */
html[data-site="pastor"] #site-title::after {
    content: ''; display: inline-block; width: 26px; height: 17px; margin-left: 8px; vertical-align: 1px;
    background: url('https://flagcdn.com/w80/ec.png') center / cover no-repeat;
    border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.auth-header p {
    position: relative;
    margin: 0;
    font-family: 'Gowun Batang', 'Nanum Myeongjo', serif;
    font-size: 15px;
    font-weight: 700;
    opacity: 0.95;
}

.auth-body {
    padding: 32px 36px 30px;
}

.auth-body .lead {
    color: var(--ink-muted);
    font-size: 14px;
    margin: 0 0 20px;
}

/* ── 폼 ─────────────────────────────────────────── */
form { display: grid; gap: 16px; }

label {
    display: grid;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

label small { font-weight: 400; color: var(--ink-muted); }

input, textarea, select {
    width: 100%;
    font: inherit;
    font-weight: 400;
    padding: 12px 14px;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand-600);
    box-shadow: var(--brand-ring);
}

.otp-input {
    font-size: 1.6rem;
    letter-spacing: 0.4em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ── 버튼 ───────────────────────────────────────── */
.btn {
    font: inherit;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:disabled { opacity: 0.65; cursor: wait; }

.btn.primary {
    background: var(--brand-gradient);
    border: none;
    color: #fff;
    font-weight: 700;
    padding: 15px 18px;
}

.btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--brand-shadow);
}

.btn.link {
    background: none;
    border: none;
    padding: 6px 0;
    color: var(--brand-600);
    font-size: 14px;
}

.btn.link:hover { text-decoration: underline; }
.btn.block { width: 100%; }

.links {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 14px;
    color: var(--ink-muted);
}

.links a {
    color: var(--brand-600);
    font-weight: 600;
    text-decoration: none;
}

.links a:hover { text-decoration: underline; }

/* ── 안내 메시지 ─────────────────────────────────── */
.msg {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 18px;
    white-space: pre-line;
}

.msg-info { background: var(--brand-100); color: var(--brand-700); }
.msg-error { background: #fdecec; color: #b42318; }
.msg-success { background: #e8f7ef; color: #1e7a46; }

/* ── 로그인 화면 ─────────────────────────────────── */
.form-row-end {
    margin-top: -6px;
    text-align: right;
    font-size: 13px;
}

.form-row-end a { text-decoration: none; font-weight: 500; }
.form-row-end a:hover { text-decoration: underline; }
.form-row-end .sep { margin: 0 6px; color: var(--line); }

/* 비밀번호 보기 버튼 (auth-common.js) */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 50px; }
.pw-toggle {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    width: 40px; height: 40px; display: grid; place-items: center;
    border: none; border-radius: 10px; background: transparent; color: var(--ink-muted); cursor: pointer;
}
.pw-toggle:hover { background: var(--brand-50, #eef5fd); color: var(--ink); }
.pw-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 아이디 찾기 결과 */
.found-id { margin: 0; padding: 16px; border-radius: 12px; text-align: center; background: #e8f7ef; color: #1e7a46; }
.found-id b { display: block; margin-top: 6px; font-size: 22px; letter-spacing: 0.5px; color: var(--ink); user-select: all; }
.found-id small { display: block; margin-top: 8px; color: var(--ink-muted); }
.found-id[hidden] { display: none; }

.signup-cta {
    margin: 18px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--ink-muted);
}

.signup-cta a {
    margin-left: 6px;
    font-weight: 700;
    text-decoration: none;
}

.signup-cta a:hover { text-decoration: underline; }

.site-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 10px;
    font-size: 13px;
}

.site-links a {
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 600;
}

.site-links a:hover { border-color: var(--brand-400); text-decoration: none; }

/* 2단계 인증 */
#twofa-setup-section, #twofa-verify-section { display: grid; gap: 14px; }
#twofa-setup-section[hidden], #twofa-verify-section[hidden] { display: none; }
#twofa-setup-section .lead, #twofa-verify-section .lead { margin: 0; white-space: pre-line; }

.twofa-qr {
    justify-self: center;
    width: 200px;
    height: 200px;
    padding: 6px;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.hint { margin: 0; font-size: 12px; color: var(--ink-muted); text-align: center; }

.twofa-secret {
    margin: 0;
    padding: 8px;
    border-radius: 8px;
    background: var(--brand-100);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 13px;
    text-align: center;
    word-break: break-all;
}

/* ── 회원가입 화면 ───────────────────────────────── */
.auth-card-wide { max-width: 560px; }

.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

textarea { resize: vertical; min-height: 80px; }

@media (max-width: 600px) {
    .auth-header { padding: 32px 22px 28px; }
    .auth-body { padding: 26px 22px 24px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
}
