:root {
    --navy: #0f2742;
    --navy-light: #1c3a5e;
    --gold: #b8893b;
    --gold-light: #d4a855;
    --bg: #f6f7f9;
    --card: #ffffff;
    --text: #1f2a37;
    --muted: #6b7280;
    --border: #e3e6ea;
    --success-bg: #e7f6ec; --success-fg: #1b7a3d;
    --error-bg: #fdecec;  --error-fg: #b23030;
    --info-bg: #eaf1fb;   --info-fg: #1c4f9c;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(16, 32, 60, 0.07);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }

a { color: var(--navy-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
    background: var(--navy);
    color: #fff;
    box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 28px; color: var(--gold-light); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.1rem; }
.brand-text small { color: #c7d2e0; font-size: 0.72rem; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: #e8edf3; font-size: 0.95rem; }
.inline-form { display: inline; margin: 0; }
.link-btn { background: none; border: none; color: #e8edf3; cursor: pointer; font-size: 0.95rem; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    background: var(--gold);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    transition: background 0.15s ease;
}
.btn:hover { background: var(--gold-light); text-decoration: none; }
.btn-sm { padding: 7px 14px; font-size: 0.88rem; }
.btn-block { width: 100%; }
.btn-outline { background: transparent; border: 1px solid var(--gold); color: var(--gold); }
.btn-outline:hover { background: var(--gold); color: #fff; }

/* ---------- Page ---------- */
.page { padding: 32px 20px 60px; min-height: 60vh; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ---------- Messages ---------- */
.messages { margin-bottom: 20px; }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 10px; }
.alert-success { background: var(--success-bg); color: var(--success-fg); }
.alert-error { background: var(--error-bg); color: var(--error-fg); }
.alert-info, .alert-debug { background: var(--info-bg); color: var(--info-fg); }

/* ---------- Hero ---------- */
.hero {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 36px;
    align-items: center;
    background: var(--card);
    border-radius: 16px;
    padding: 36px;
    box-shadow: var(--shadow);
}
.hero-photo img, .photo-fallback {
    width: 200px; height: 240px;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid var(--gold);
}
.photo-fallback {
    display: flex; align-items: center; justify-content: center;
    background: var(--navy); color: var(--gold-light);
    font-size: 5rem; font-weight: 700;
}
.eyebrow { color: var(--gold); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; font-size: 0.78rem; margin: 0 0 6px; }
.hero-text h1 { margin: 0 0 12px; font-size: 2.3rem; color: var(--navy); }
.lead { font-size: 1.05rem; color: var(--text); }
.hero-actions { display: flex; gap: 12px; margin: 20px 0 10px; flex-wrap: wrap; }
.meta { color: var(--muted); font-size: 0.85rem; }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 40px 0; }
.feature-card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature-card h3 { margin: 0 0 8px; color: var(--navy); font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- How it works ---------- */
.how-it-works { margin: 40px 0; }
.how-it-works h2 { color: var(--navy); }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 8px; }

.contact-note { background: var(--info-bg); color: var(--info-fg); padding: 16px; border-radius: var(--radius); }

/* ---------- Auth / form cards ---------- */
.auth-card, .form-card {
    max-width: 520px; margin: 0 auto;
    background: var(--card);
    padding: 32px;
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.auth-card h1, .form-card h1 { margin-top: 0; color: var(--navy); }
.form-row { display: flex; flex-direction: column; margin-bottom: 16px; }
.form-row label { font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.form-row input, .form-row textarea, .form-row select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}
.form-row input:focus, .form-row textarea:focus {
    outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,137,59,0.15);
}
.help { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.error { color: var(--error-fg); font-size: 0.82rem; margin-top: 4px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Query list ---------- */
.query-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.query-item {
    display: flex; justify-content: space-between; gap: 16px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px; color: var(--text);
}
.query-item:hover { text-decoration: none; border-color: var(--gold); box-shadow: var(--shadow); }
.query-item-main h3 { margin: 0 0 4px; color: var(--navy); font-size: 1.05rem; }
.snippet { margin: 0; color: var(--muted); font-size: 0.9rem; }
.query-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; white-space: nowrap; }
.query-item-meta time { color: var(--muted); font-size: 0.8rem; }
.attach-count { font-size: 0.82rem; color: var(--muted); }

/* ---------- Badges ---------- */
.badge { font-size: 0.74rem; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.badge-open { background: var(--info-bg); color: var(--info-fg); }
.badge-in_progress { background: #fff4e0; color: #9a6b17; }
.badge-answered { background: var(--success-bg); color: var(--success-fg); }
.badge-closed { background: #eceff2; color: var(--muted); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; background: var(--card); padding: 40px; border-radius: 14px; box-shadow: var(--shadow); margin-top: 20px; }
.empty-state p { color: var(--muted); margin-bottom: 16px; }

/* ---------- Query detail ---------- */
.back-link { font-size: 0.9rem; }
.query-detail { background: var(--card); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); margin-top: 10px; }
.query-detail-head { display: flex; align-items: center; gap: 14px; }
.query-detail-head h1 { margin: 0; color: var(--navy); font-size: 1.6rem; }
.query-body { margin: 18px 0; }
.attachments h2, .reply h2 { color: var(--navy); font-size: 1.15rem; border-top: 1px solid var(--border); padding-top: 18px; margin-top: 24px; }
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.attachment { background: var(--bg); border-radius: 10px; padding: 10px; }
.attachment img, .attachment video { width: 100%; border-radius: 8px; display: block; }
.attachment audio { width: 100%; }
.attachment small { display: block; margin-top: 6px; color: var(--muted); font-size: 0.78rem; }
.reply-body { background: var(--success-bg); padding: 16px; border-radius: 10px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #c7d2e0; margin-top: 40px; padding: 26px 0; font-size: 0.85rem; }
.site-footer p { margin: 6px 0; }
.disclaimer { color: #92a2b6; font-size: 0.78rem; max-width: 820px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .hero { grid-template-columns: 1fr; text-align: center; }
    .hero-photo { justify-self: center; }
    .hero-actions { justify-content: center; }
    .features { grid-template-columns: 1fr; }
    .nav { gap: 12px; }
}
