/* 통합인증 화면 공통 스타일 (모바일 대응, NFR-406) */
:root {
    --bg: #f5f6f8;
    --card: #ffffff;
    --text: #1f2328;
    --muted: #6b7280;
    --line: #e5e7eb;
    --primary: #1d4ed8;
    --error-bg: #fef2f2;
    --error-text: #b91c1c;
    --info-bg: #eff6ff;
    --info-text: #1e40af;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--bg);
    color: var(--text);
    font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    font-size: 15px;
}

.card {
    width: 100%;
    max-width: 400px;
    padding: 32px 24px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
}

h1 { margin: 0 0 24px; font-size: 22px; }

.form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.form label { font-size: 13px; color: var(--muted); }
.form input[type="text"], .form input[type="password"] {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 15px;
}
.form .check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 15px; }

.btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--line); }

.sns-list { list-style: none; margin: 0; padding: 0; }
.btn-sns { background: #fff; color: var(--text); border-color: var(--line); }
.btn-naver { background: #03c75a; color: #fff; }
.btn-kakao { background: #fee500; color: #191919; }
.btn-apple { background: #000; color: #fff; }
.btn-facebook { background: #1877f2; color: #fff; }

.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 8px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.alert { padding: 12px; border-radius: 8px; font-size: 14px; }
.alert-error { background: var(--error-bg); color: var(--error-text); }
.alert-info { background: var(--info-bg); color: var(--info-text); }

.muted { color: var(--muted); font-size: 13px; }

.info { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; margin: 0 0 16px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; word-break: break-all; }

/* 회원가입 약관 (signup/terms.jsp) */
.term { margin-bottom: 16px; }
.term-content {
    max-height: 160px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    font-size: 13px;
    line-height: 1.5;
}

/* 마이페이지 연결된 SNS (index.jsp) */
.sns-linked { list-style: none; padding: 0; margin: 0 0 12px; }
.sns-linked li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.sns-linked form { margin: 0; }
.btn-small { width: auto; padding: 4px 12px; margin: 0; font-size: 13px; }
h2 { font-size: 16px; margin: 20px 0 8px; }

/* 회원가입 거주지 선택 (signup/terms.jsp) */
.region { display: flex; gap: 8px; }
.region select { flex: 1; padding: 8px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 본인인증 진행 중 안내 (signup/terms.jsp) */
.cert-progress { text-align: center; padding: 16px 0; }
.cert-progress .btn { margin-top: 8px; }
.spinner {
    width: 40px;
    height: 40px;
    margin: 8px auto 16px;
    border: 4px solid #e5e5e5;
    border-top-color: #3b6fd8;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
[hidden] { display: none !important; }

/* ===== 로그인 화면 (login.jsp, policy.jsp) ===== */
:root { --accent: #f36f21; }
.accent { color: var(--accent); }
.login-card {
    position: relative;
    max-width: 400px;
    padding: 48px 20px 28px;
    border: 0;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    text-align: center;
    word-break: keep-all;   /* 한글은 단어 단위로 줄바꿈 */
}
.login-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: 0;
    background: none;
    font-size: 30px;
    line-height: 1;
    color: #555;
    cursor: pointer;
}
.login-title {
    display: flex;
    flex-wrap: wrap;
    white-space: nowrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 28px;
    font-size: 26px;
    font-weight: 700;
}
.login-logo { height: 32px; }
.login-brand { font-size: 17px; font-weight: 800; letter-spacing: -0.5px; color: #333; }
.login-intro { margin: 0 0 28px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.login-intro strong { font-weight: 700; }
.login-client { margin: 0 0 12px; font-size: 15px; font-weight: 700; line-height: 1.6; }
.login-line { margin: 0 0 24px; border: 0; border-top: 2px solid var(--accent); }
.login-card .alert { text-align: left; }

.sns-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}
.sns-icon { display: block; width: 40px; height: 40px; border-radius: 50%; text-decoration: none; }
.sns-icon svg { display: block; width: 100%; height: 100%; }
.sns-icon:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sns-text { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 11px; border: 1px solid var(--line); border-radius: 50%; }

.login-terms {
    display: inline-flex;
    justify-content: space-between;
    width: 180px;
    padding: 10px 12px;
    background: #f3f4f6;
    color: #444;
    font-size: 13px;
    text-decoration: none;
}
.login-contact { margin: 48px 0 0; color: var(--muted); font-size: 12px; }
.term-content-full { max-height: none; text-align: left; }

/* ===== 모바일: 화면 전체를 채운다 (테두리·그림자 없음) ===== */
@media (max-width: 480px) {
    body {
        display: block;
        padding: 0;
        background: var(--card);
    }
    .card,
    .login-card {
        max-width: none;
        min-height: 100vh;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .login-card { padding-top: 56px; }
}
