/* 거울방 — 공통 스타일 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f9f8f6;
    --surface: #ffffff;
    --surface-alt: #f3f1ec;
    --text: #1a1916;
    --text-soft: #4a4640;
    --muted: #6b6760;
    --accent: #3d5a80;
    --accent-dark: #2d4a70;
    --accent-light: #e8eef5;
    --danger: #c0392b;
    --danger-light: #fdecea;
    --success: #2c8c4a;
    --success-light: #e8f5ec;
    --warning: #d98e00;
    --warning-light: #fff5e0;
    --border: #e4e2de;
    --border-strong: #cdc9c1;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 2px 8px rgba(0,0,0,0.06);

    /* 이론가별 색상 토큰 (보고서 4섹션 시각 구분) */
    --klein:           #8b5a3c;
    --klein-light:     #f4ede4;
    --bion:            #3d5a80;
    --bion-light:      #e8eef5;
    --winnicott:       #5a7c5f;
    --winnicott-light: #eaf1eb;
    --ogden:           #6b5b8c;
    --ogden-light:     #efeaf5;

    /* 타이포 위계 — serif 인용/이론가 출처 */
    --font-quote: Georgia, 'Noto Serif KR', 'Times New Roman', serif;
}

html, body { height: 100%; }
body {
    font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header .inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .tag {
    margin-left: 8px;
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--muted);
}

.nav { display: flex; align-items: center; gap: 24px; }
.nav a:not(.btn) { color: var(--text-soft); font-size: 0.92rem; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--accent); text-decoration: none; }
.nav .user-name { color: var(--text-soft); font-weight: 500; }

/* Main / Container */
main { flex: 1; padding: 40px 0 60px; }
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}
.container-narrow { max-width: 640px; margin: 0 auto; padding: 0 24px; }
.container-mid { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 24px 0;
    font-size: 0.82rem;
    color: var(--muted);
}
.site-footer .inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.site-footer a { color: var(--muted); }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 20px; }
.card h2, .card h3 { letter-spacing: -0.01em; margin-bottom: 16px; }
.card h2 { font-size: 1.3rem; }
.card h3 { font-size: 1.05rem; font-weight: 700; }

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: var(--shadow);
    margin: 30px auto;
    max-width: 460px;
}
.auth-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.auth-sub {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 28px;
}

/* Forms */
.field { margin-bottom: 18px; }
.label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
}
.input, .textarea, .select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.textarea { min-height: 200px; resize: vertical; line-height: 1.65; }
.hint {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 6px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary {
    background: var(--surface);
    color: var(--accent);
    border: 1.5px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a52a1f; color: #fff; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.9rem; font-weight: 700; }

/* Flash */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 0.92rem;
    line-height: 1.6;
}
.flash-error   { background: var(--danger-light);  color: var(--danger);  border: 1px solid var(--danger);  }
.flash-success { background: var(--success-light); color: var(--success); border: 1px solid var(--success); }
.flash-warning { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning); }
.flash-info    { background: var(--accent-light);  color: var(--accent);  border: 1px solid var(--accent);  }

/* Dashboard / Lists */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}
.dashboard-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
}
.dashboard-stat .label-sm {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 8px;
}
.dashboard-stat .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.list-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.list-table th, .list-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.list-table th {
    background: var(--surface-alt);
    font-weight: 600;
    color: var(--text-soft);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.list-table tr:last-child td { border-bottom: none; }
.list-table tr:hover { background: var(--surface-alt); }

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-pending  { background: var(--warning-light); color: var(--warning); }
.badge-generating { background: var(--accent-light); color: var(--accent); }
.badge-completed { background: var(--success-light); color: var(--success); }
.badge-failed { background: var(--danger-light); color: var(--danger); }
.badge-safety { background: var(--danger-light); color: var(--danger); }

/* Page title */
.page-title {
    margin-bottom: 28px;
}
.page-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.page-title p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}
.pricing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 28px;
    display: flex;
    flex-direction: column;
}
.pricing-card.featured {
    border: 2px solid var(--accent);
    box-shadow: 0 4px 18px rgba(61,90,128,0.1);
}
.pricing-card h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
}
.pricing-card .price {
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--accent);
    margin: 16px 0 6px;
}
.pricing-card .price small {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 400;
}
.pricing-card .desc {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 18px;
}
.pricing-card ul {
    list-style: none;
    padding: 0;
    margin-bottom: 24px;
    flex: 1;
}
.pricing-card li {
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text-soft);
    padding-left: 22px;
    position: relative;
}
.pricing-card li::before {
    content: '✓';
    color: var(--accent);
    position: absolute;
    left: 0;
    font-weight: 700;
}

/* Report sections */
.report-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 18px;
}
.report-section h3 {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.report-section .content {
    white-space: pre-wrap;
    line-height: 1.8;
    color: var(--text-soft);
}

/* ============================================================ */
/* 거울방 임상 컴포넌트 — Hold-Box / Theorist Lens / Safety Bar */
/* ============================================================ */

/* 컨테이닝 박스 — 사례 제출·민감한 안내에서 "담아주는" 시각 은유 */
.hold-box {
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin: 20px 0;
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--text-soft);
}
.hold-box strong { color: var(--accent); font-weight: 600; }

/* 상담사 발달 단계 뱃지 */
.stage-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

/* 보고서 4섹션 — 이론가별 컬러 렌즈 */
.report-section.lens-klein     { border-left: 4px solid var(--klein); }
.report-section.lens-bion      { border-left: 4px solid var(--bion); }
.report-section.lens-winnicott { border-left: 4px solid var(--winnicott); }
.report-section.lens-ogden     { border-left: 4px solid var(--ogden); }

.report-section.lens-klein h3     { color: var(--klein); border-bottom-color: var(--klein-light); }
.report-section.lens-bion h3      { color: var(--bion); border-bottom-color: var(--bion-light); }
.report-section.lens-winnicott h3 { color: var(--winnicott); border-bottom-color: var(--winnicott-light); }
.report-section.lens-ogden h3     { color: var(--ogden); border-bottom-color: var(--ogden-light); }

.lens-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    font-family: var(--font-quote);
    font-style: italic;
    margin-left: 10px;
    vertical-align: middle;
}
.lens-klein .lens-tag     { background: var(--klein-light);     color: var(--klein); }
.lens-bion .lens-tag      { background: var(--bion-light);      color: var(--bion); }
.lens-winnicott .lens-tag { background: var(--winnicott-light); color: var(--winnicott); }
.lens-ogden .lens-tag     { background: var(--ogden-light);     color: var(--ogden); }

/* 위기 안전 바 — footer 상시 노출 */
.safety-bar {
    background: #fef7f6;
    border-top: 2px solid var(--danger);
    padding: 12px 24px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-soft);
    line-height: 1.7;
}
.safety-bar a {
    color: var(--danger);
    font-weight: 600;
    text-decoration: none;
}
.safety-bar a:hover { text-decoration: underline; }
.safety-bar .divider { color: var(--border-strong); margin: 0 6px; }
.safety-bar small { color: var(--muted); font-size: 0.82rem; }

/* 신뢰 표시줄 — 랜딩 hero 아래 */
.trust-bar {
    max-width: 920px;
    margin: 0 auto 60px;
    padding: 18px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    color: var(--muted);
}
.trust-bar > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.trust-bar strong { color: var(--text-soft); }

/* 보고서 인쇄 모드 */
@media print {
    .site-header, .site-footer, .safety-bar, .nav, .btn { display: none !important; }
    main { padding: 0; }
    body { background: #fff; }
    .report-section { break-inside: avoid; box-shadow: none; }
}

/* Responsive */
@media (max-width: 720px) {
    main { padding: 24px 0 40px; }
    .auth-card { padding: 30px 24px; }
    .card { padding: 20px; }
    .nav { gap: 14px; }
    .site-header .inner { padding: 0 18px; }
    .container, .container-mid, .container-narrow { padding: 0 18px; }
    .report-section { padding: 22px 18px; line-height: 1.85; }
    .trust-bar { gap: 14px; padding: 14px 18px; font-size: 0.78rem; }
    .safety-bar { font-size: 0.78rem; padding: 10px 18px; }
}
