/* 사주아이작명 — 상단 메뉴바만 검은색, 히어로/푸터는 다크블루 */
:root {
    --nav-bg: #1a1a1a;
    --hero-bg: #3C3F57;
    --primary: #374151;
    --primary-light: #4d5069;
    --accent: #5c5f7a;
    --bg: #f5f5f5;
    --surface: #ffffff;
    --border: #e5e5e5;
    --text: #222;
    --text-muted: #6b7280;
    --wood: #4a7c43;
    --fire: #b53c3c;
    --earth: #b85c20;
    --metal: #5c6b6b;
    --water: #2c5f8d;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.65;
}

main {
    flex: 1;
}

/* 네비 — 다크 그레이/블랙 (두 번째 참고) */
.navbar {
    background-color: var(--nav-bg) !important;
    border-bottom: none;
}
.navbar-brand {
    font-weight: 600;
    color: #fff !important;
}
.navbar .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
}
.navbar .nav-link:hover {
    color: #fff !important;
}
/* 로그인 시 이름(볼드) + 로그아웃 한 줄, 줄 맞춤 */
.nav-auth-inline {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    white-space: nowrap;
    line-height: 1.2;
}
.nav-auth-inline .nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0;
    line-height: inherit;
    vertical-align: middle;
}
.nav-auth-inline .nav-link-user {
    font-weight: 700;
}
.nav-auth-inline .nav-link-logout {
    font-size: 0.9em;
    font-weight: 500;
    opacity: 0.9;
}
.navbar-nav .nav-item {
    white-space: nowrap;
    display: flex;
    align-items: center;
}

/* 히어로 — 사주·아이작명 제목·버튼 영역 (이전 다크블루) */
.hero-section {
    background-color: var(--hero-bg);
    padding: 3rem 0;
    color: #fff;
}
.hero-section h1 {
    font-weight: 700;
    color: #fff;
}
.hero-section .lead {
    color: rgba(255,255,255,0.85);
}
.hero-section .btn-primary {
    background: #fff;
    color: var(--nav-bg);
    border: none;
    font-weight: 600;
}
.hero-section .btn-outline-light {
    border: 2px solid rgba(255,255,255,0.7);
    color: #fff;
}
.hero-section .btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: #fff;
}

/* 카드 — 밝은 회색/화이트 (두 번째 참고) */
.card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.card:hover {
    border-color: #d4d4d4;
}
.card-header {
    border-radius: 8px 8px 0 0;
    padding: 1rem 1.25rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}
.card-header.bg-primary {
    background-color: var(--primary) !important;
    color: #fff !important;
    border: none;
}

.saju-display {
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.pillar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 1rem;
}
.pillar-card:hover {
    border-color: var(--accent);
}
.pillar-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.pillar-stem {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text);
}
.pillar-branch {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-muted);
}

.element-wood { color: var(--wood); }
.element-fire { color: var(--fire); }
.element-earth { color: var(--earth); }
.element-metal { color: var(--metal); }
.element-water { color: var(--water); }

.element-bar-label { font-weight: 600; margin-bottom: 0.25rem; display: flex; justify-content: space-between; }
.element-bar-progress {
    height: 8px;
    border-radius: 2px;
    overflow: hidden;
    background: var(--border);
}
.element-bar-fill { height: 100%; transition: width 0.4s ease; }

.personality-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg);
    border-left: 4px solid var(--accent);
    border-radius: 0 4px 4px 0;
}
.fortune-section {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}
.fortune-section h5 {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.fortune-section p,
.fortune-section div {
    line-height: 1.75;
    color: var(--text-muted);
}

.btn-primary {
    background-color: var(--primary);
    border: none;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
}
.btn-primary:hover {
    background-color: var(--primary-light);
}
.btn-outline-primary {
    border: 1px solid var(--primary);
    color: var(--primary);
    font-weight: 500;
    border-radius: 6px;
}
.btn-outline-primary:hover {
    background: rgba(55, 65, 81, 0.06);
    border-color: var(--primary);
    color: var(--primary);
}

.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid var(--border);
    padding: 0.6rem 0.85rem;
    background: var(--surface);
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.15);
}
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.form-label {
    font-weight: 500;
    color: var(--text);
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.loading-content { text-align: center; color: #fff; }
.loading-content p { font-size: 1rem; margin-top: 1rem; }

footer.bg-dark {
    background-color: var(--hero-bg) !important;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    border-top: none;
}

.fade-in {
    animation: fadeIn 0.35s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.name-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}
.name-card:hover {
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .hero-section { padding: 2rem 0; }
    .hero-section h1 { font-size: 1.5rem; }
    .saju-display { padding: 1rem; }
    .pillar-stem { font-size: 1.6rem; }
    .pillar-branch { font-size: 1.2rem; }
}
