/**
 * JaleeDigital - Main Stylesheet
 * Steampunk aesthetic, mobile-first responsive
 */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Playfair+Display:wght@400;600&family=Source+Sans+3:wght@300;400;600;700&display=swap');

@import 'theme.css';

/* ── Reset & Base ─────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    opacity: var(--texture-opacity);
    pointer-events: none;
    z-index: 9999;
}

img { max-width: 100%; height: auto; display: block; }

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover { color: var(--color-link-hover); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

main { flex: 1; width: 100%; }

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ── Decorative ─────────────────────────────────────────────── */

.steampunk-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2.5rem 0;
    color: var(--color-border-muted);
}

.steampunk-divider::before,
.steampunk-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-border-muted), var(--color-copper), var(--color-border-muted), transparent);
}

.rivet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--color-silver-light), var(--color-grey));
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3), 0 1px 0 var(--color-silver);
    flex-shrink: 0;
}

.brass-border {
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 1px var(--color-border-muted), var(--shadow-md);
    position: relative;
}

.brass-border::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    border: 1px solid var(--color-border-muted);
    border-radius: calc(var(--radius) - 2px);
    pointer-events: none;
    opacity: 0.4;
}

/* ── Header ───────────────────────────────────────────────── */

.site-header {
    background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
    border-bottom: 3px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    gap: 1rem;
    position: relative;
}

.header-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    height: auto;
    max-height: 225px;
    width: auto;
    max-width: min(338px, 100%);
    vertical-align: middle;
    margin-right: 10px;
    object-fit: contain;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-accent);
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.main-nav ul { list-style: none; }

.main-nav a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    font-weight: 600;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    background: var(--color-unread-bg);
}

.header-actions { display: flex; align-items: center; gap: 0.75rem; align-self: flex-start; }

@media (max-width: 767px) {
    .header-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
        padding: 0.65rem 0 1rem;
        min-height: auto;
    }

    .header-brand {
        align-items: center;
        width: 100%;
        flex: none;
    }

    .logo {
        justify-content: center;
        width: 100%;
    }

    .logo-img {
        max-width: min(338px, 90vw);
        margin-right: 0;
    }

    .theme-toggle-wrap {
        margin-top: 50px;
    }

    .header-actions {
        position: absolute;
        top: 0.65rem;
        right: 0;
        align-self: auto;
    }
}

.theme-toggle-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.theme-toggle-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    line-height: 1;
    white-space: nowrap;
}

.theme-toggle {
    background: var(--color-bg-card);
    border: 2px solid var(--color-border);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: transform 0.3s;
    color: var(--color-accent);
}

.theme-toggle:hover { transform: rotate(30deg); box-shadow: var(--shadow-sm); }

.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--color-bg-alt);
    border-bottom: 2px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.main-nav.is-open { display: block; }

@media (min-width: 768px) {
    .header-inner {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        padding: 0.5rem 0;
        min-height: var(--header-height);
        column-gap: 1rem;
    }

    .header-actions {
        position: static;
        align-self: center;
        grid-column: 3;
        grid-row: 1 / 3;
    }

    .header-brand {
        display: contents;
    }

    .logo-img {
        margin-right: 10px;
    }

    .theme-toggle-wrap {
        margin-top: 0;
    }

    .header-inner .logo {
        grid-column: 1;
        grid-row: 1 / 3;
        align-self: center;
    }

    .header-inner .main-nav {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        align-self: end;
        flex: none;
    }

    .header-inner .theme-toggle-wrap {
        grid-column: 2;
        grid-row: 2;
        justify-self: center;
        align-self: start;
    }

    .nav-toggle { display: none; }
    .main-nav { display: block; position: static; background: none; border: none; box-shadow: none; }
    .main-nav ul { display: flex; gap: 0.25rem; flex-wrap: wrap; justify-content: center; }
    .main-nav a { border-left: none; border-bottom: 2px solid transparent; padding: 0.5rem 0.85rem; }
    .main-nav a:hover, .main-nav a.active { border-left: none; border-bottom-color: var(--color-accent); background: none; }
}

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(180deg, var(--color-copper-light) 0%, var(--color-copper) 100%);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--color-copper) 0%, var(--color-copper-dark) 100%);
    color: #fff;
}

.btn-secondary { background: var(--color-bg-card); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-bg-alt); color: var(--color-accent); }
.btn-danger {
    background: #8b1a1a;
    color: #f0e8d0;
    border: 1px solid #a52a2a;
}
.btn-danger:hover {
    background: #a52a2a;
    color: #fff;
}
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
    padding: 3rem 0 4rem;
    text-align: center;
    background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg) 50%, var(--color-bg-alt) 100%);
    border-bottom: 1px solid var(--color-border-muted);
}

.hero-tagline {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--color-text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.hero h1 { margin-bottom: 1rem; color: var(--color-accent); }

.hero p {
    font-size: 1.1rem;
    max-width: 36rem;
    margin: 0 auto 1.75rem;
    color: var(--color-text-muted);
}

/* ── Sections & Cards ─────────────────────────────────────── */

.section { padding: 3rem 0; }

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-accent);
}

.section-title::after {
    content: '';
    display: block;
    width: 4rem;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-copper), transparent);
    margin: 0.75rem auto 0;
}

.card-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

@media (min-width: 600px) { .card-grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) {
    .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
    .card-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
    background: var(--color-bg-card);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

a.card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.portfolio-card .site-url { margin-bottom: 0.75rem; }

.card-icon { font-size: 2rem; margin-bottom: 0.75rem; color: var(--color-accent); }
.card h3 { margin-bottom: 0.5rem; color: var(--color-accent); }
.card p { color: var(--color-text-muted); font-size: 0.95rem; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius);
    border: 1px solid;
}

.badge-active { color: var(--color-success); border-color: var(--color-success); background: rgba(61, 107, 79, 0.1); }
.badge-inactive { color: var(--color-grey); border-color: var(--color-grey); background: rgba(107, 107, 107, 0.1); }

.testimonial { text-align: center; padding: 2rem; font-style: italic; color: var(--color-text-muted); }
.testimonial cite { display: block; margin-top: 1rem; font-style: normal; font-weight: 600; color: var(--color-accent); }

/* ── Forms ────────────────────────────────────────────────── */

.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group label .required { color: var(--color-error); }

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 2px solid var(--color-border-muted);
    border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-unread-bg);
}

textarea.form-control { resize: vertical; min-height: 120px; }

.form-hint { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.char-counter { text-align: right; font-size: 0.8rem; color: var(--color-text-muted); }
.char-counter.over-limit { color: var(--color-error); font-weight: 600; }
.form-error { color: var(--color-error); font-size: 0.85rem; margin-top: 0.25rem; }

.alert { padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.25rem; border: 2px solid; font-weight: 500; }
.alert-success { background: rgba(61, 107, 79, 0.1); border-color: var(--color-success); color: var(--color-success); }
.alert-error { background: rgba(139, 41, 66, 0.1); border-color: var(--color-error); color: var(--color-error); }
.alert-info { background: var(--color-unread-bg); border-color: var(--color-accent); color: var(--color-text); }

/* ── Auth ─────────────────────────────────────────────────── */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - 8rem);
    padding: 2rem 0;
}

.auth-card { width: 100%; max-width: 28rem; padding: 2rem; background: var(--color-bg-card); }
.auth-card h1 { text-align: center; margin-bottom: 0.5rem; color: var(--color-accent); }
.auth-card .subtitle { text-align: center; color: var(--color-text-muted); margin-bottom: 1.75rem; font-size: 0.95rem; }

/* ── Dashboard ──────────────────────────────────────────────── */

.dashboard-header { margin-bottom: 2rem; }
.dashboard-header h1 { color: var(--color-accent); }

.stat-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 2rem; }
@media (min-width: 600px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-card { background: var(--color-bg-card); padding: 1.25rem; text-align: center; }
.stat-card .stat-value { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; color: var(--color-accent); line-height: 1; }
.stat-card .stat-label { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.35rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card:has(.stat-source) .stat-label { text-transform: none; letter-spacing: normal; font-size: 0.875rem; line-height: 1.45; }
.stat-card .stat-source { font-size: 0.75rem; margin: 0.75rem 0 0; }

.stat-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-hint {
    display: block;
    margin-top: 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.stat-card-link-alert {
    background: var(--color-unread-bg);
}

.stat-card-link-alert .stat-value {
    color: var(--color-brass);
}

.quick-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; align-items: center; }

.inline-form {
    display: inline-flex;
    margin: 0;
}
.contacts-help { margin: 0 0 1rem; font-size: 0.95rem; }

/* ── Tables ───────────────────────────────────────────────── */

.table-wrapper { overflow-x: auto; margin-bottom: 1.5rem; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

.data-table th, .data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-muted);
}

.data-table th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-accent);
    background: var(--color-bg-alt);
    white-space: nowrap;
}

.data-table tbody tr.contact-row { transition: background 0.15s; cursor: pointer; }
.data-table tbody tr.contact-detail { cursor: default; }
.data-table tbody tr:not(.contact-detail):hover { background: var(--color-unread-bg); }
.data-table tbody tr.contact-row:hover { background: var(--color-unread-bg); }
.data-table tr.unread {
    background: var(--color-unread-bg);
    font-weight: 600;
}
.data-table tr.unread td:first-child {
    box-shadow: inset 4px 0 0 var(--color-brass);
}
.data-table tr.contact-row.is-expanded {
    background: var(--color-bg-alt);
}
.data-table tr.contact-row.is-expanded td {
    border-bottom: none;
}

.contact-detail {
    display: none;
}

.contact-detail.is-visible {
    display: table-row;
}

.contact-detail td {
    padding: 0;
    border-bottom: 1px solid var(--color-border-muted);
    background: var(--color-bg-alt);
}

.contact-detail-panel {
    margin: 0 1rem 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--color-bg-card);
}

.contact-detail-label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.contact-detail-message {
    margin: 0 0 1rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--color-text);
}

.contact-detail-meta {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.contact-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.contacts-status-badge {
    display: inline-block;
    margin-bottom: 1.25rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-heading);
    letter-spacing: 0.03em;
    color: var(--color-walnut);
    background: rgba(201, 162, 39, 0.18);
    border: 1px solid var(--color-brass);
    border-radius: var(--radius);
}

.contacts-status-badge.is-clear {
    color: var(--color-success);
    background: rgba(61, 107, 79, 0.1);
    border-color: var(--color-success);
}

[data-theme="dark"] .contacts-status-badge {
    color: var(--color-brass);
}

[data-theme="dark"] .contacts-status-badge.is-clear {
    color: #7ec99a;
}

.message-preview { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Messages ───────────────────────────────────────────────── */

.message-thread {
    max-height: 28rem;
    overflow-y: auto;
    padding: 1rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-muted);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.message-bubble { max-width: 80%; padding: 0.75rem 1rem; margin-bottom: 0.75rem; border-radius: var(--radius-lg); font-size: 0.95rem; }
.message-bubble.sent { margin-left: auto; background: var(--color-copper); color: #fff; border-bottom-right-radius: 2px; }
.message-bubble.received { margin-right: auto; background: var(--color-bg-card); border: 1px solid var(--color-border-muted); border-bottom-left-radius: 2px; }
.message-meta { font-size: 0.75rem; opacity: 0.7; margin-top: 0.25rem; }
.project-selector { margin-bottom: 1.5rem; }

/* ── Files ────────────────────────────────────────────────── */

.file-list { margin-top: 2rem; }

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-muted);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.file-item a { font-weight: 600; }
.file-meta { font-size: 0.8rem; color: var(--color-text-muted); }

/* ── Modal ────────────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.is-open { display: flex; }

.modal {
    background: var(--color-bg-card);
    padding: 2rem;
    width: 100%;
    max-width: 32rem;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal h2 { margin-bottom: 1.25rem; color: var(--color-accent); }

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
}

.modal-close:hover { color: var(--color-error); }

.modal-delete-warning {
    margin-top: 12px;
}

.modal-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── About ────────────────────────────────────────────────── */

.family-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 600px) { .family-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .family-grid { grid-template-columns: repeat(3, 1fr); } }

.family-member { text-align: center; padding: 1.5rem; }
.family-member h3 { color: var(--color-accent); margin-bottom: 0.35rem; }

.photo-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--color-bg-alt);
    border: 2px dashed var(--color-border-muted);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-style: italic;
    margin: 1.5rem 0;
}

/* ── Footer ───────────────────────────────────────────────── */

.site-footer {
    background: linear-gradient(0deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
    border-top: 3px solid var(--color-border);
    padding: 2rem 0 1.5rem;
    margin-top: auto;
}

.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.footer-brand { font-family: var(--font-heading); font-size: 1.1rem; color: var(--color-accent); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 1.5rem; list-style: none; }
.footer-links a { color: var(--color-text-muted); font-size: 0.9rem; }
.footer-copy { font-size: 0.8rem; color: var(--color-text-muted); }

/* ── Utility ──────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.page-content { padding: 2rem 0 3rem; }

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--color-error);
    color: #fff;
    border-radius: 999px;
}

/* ── Layout Helpers ───────────────────────────────────────── */

.intro-text {
    max-width: 42rem;
    margin: 0 auto 2rem;
}

.intro-text-narrow {
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

.section-alt {
    background: var(--color-bg-alt);
}

.subheading-accent {
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.form-narrow {
    max-width: 32rem;
    margin: 0 auto;
    padding: 2rem;
    background: var(--color-bg-card);
}

.content-narrow {
    max-width: 42rem;
    margin: 0 auto;
    padding: 2rem;
}

.service-list {
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

.section-compact {
    padding: 1.25rem 0;
}

.launch-counter-banner {
    margin: 0;
    font-size: 1rem;
}

.launch-counter-banner strong {
    color: var(--color-accent);
    font-size: 1.15em;
}

.services-section {
    margin-bottom: 2.5rem;
}

.launch-offer-card {
    padding: 1.75rem;
    background: var(--color-bg-card);
}

.launch-offer-list {
    margin-bottom: 0;
}

.pricing-tier-grid {
    margin-top: 1rem;
}

.pricing-tier-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pricing-tier-card-featured {
    border-color: var(--color-copper);
    box-shadow: inset 0 0 0 1px var(--color-border-muted), var(--shadow-md), 0 0 0 1px rgba(184, 115, 42, 0.25);
}

.tier-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-brass);
}

.tier-price {
    margin: 0.25rem 0 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1.2;
}

.tier-price-unit {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.tier-price-range {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.tier-custom-note {
    font-size: 1rem;
}

.tier-fine-print {
    margin-top: 0.5rem;
}

.addons-collapsible {
    background: var(--color-bg-card);
    padding: 0;
    overflow: hidden;
}

.addons-collapsible-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-accent);
    cursor: pointer;
    list-style: none;
}

.addons-collapsible-summary::-webkit-details-marker {
    display: none;
}

.addons-collapsible-summary::after {
    content: '+';
    margin-left: auto;
    font-size: 1.25rem;
    color: var(--color-brass);
    transition: transform 0.2s ease;
}

.addons-collapsible[open] .addons-collapsible-summary::after {
    content: '\2212';
}

.addons-collapsible-body {
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid var(--color-border-muted);
}

.addons-table td:last-child {
    white-space: nowrap;
    font-weight: 600;
    color: var(--color-accent);
}

.addons-seo-note {
    margin-top: 1rem;
    margin-bottom: 0;
}

.services-cta {
    padding-bottom: 1rem;
}

.dashboard-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-header-row .quick-links {
    margin-top: 0;
}

/* ── Questionnaires ─────────────────────────────────────────── */

.gear-icon {
    color: var(--color-brass);
    margin-right: 0.35rem;
}

.client-info-card,
.questionnaire-meta-card,
.questionnaire-form-header,
.questionnaire-create-card {
    padding: 1.5rem;
    background: var(--color-bg-card);
}

.info-list {
    margin: 0;
    padding: 0;
}

.info-list-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border-muted);
}

.info-list-row:last-child {
    border-bottom: none;
}

.info-list dt {
    font-weight: 600;
    color: var(--color-accent);
    min-width: 7rem;
}

.info-list dd {
    margin: 0;
    color: var(--color-text);
}

.info-list-inline .info-list-row {
    display: inline-flex;
    border-bottom: none;
    padding: 0.35rem 1.25rem 0.35rem 0;
}

.question-category-block {
    margin-bottom: 1.5rem;
}

.question-category {
    margin-top: 24px;
    margin-bottom: 8px;
    padding: 10px 14px;
    background: rgba(180, 130, 60, 0.15);
    border-left: 4px solid #b8732a;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.question-category-block:first-child .question-category {
    margin-top: 0;
}

.category-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.question-category-list {
    display: flex;
    flex-direction: column;
}

.question-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(180, 130, 60, 0.2);
}

.question-item:last-child {
    border-bottom: none;
}

.question-item input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #b8732a;
}

.question-item label {
    flex: 1;
    line-height: 1.5;
    cursor: pointer;
    color: var(--color-text);
}

.question-selector {
    margin-bottom: 1rem;
}

.question-selected-count {
    margin: 0;
    font-weight: 600;
    color: var(--color-accent);
    font-family: var(--font-heading);
    letter-spacing: 0.03em;
}

.questionnaire-form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.form-actions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (min-width: 600px) {
    .questionnaire-form-actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .form-actions-buttons {
        margin-left: auto;
    }
}

.question-category-group {
    margin: 0 0 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--color-bg-card);
    border: none;
}

.question-category-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 1rem;
    padding: 0;
}

.question-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0;
    cursor: pointer;
}

.question-checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
    accent-color: var(--color-copper);
}

.question-checkbox-text {
    line-height: 1.5;
    color: var(--color-text);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.questionnaire-field {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed var(--color-border-muted);
}

.questionnaire-field:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.questionnaire-field-label {
    display: block;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.65rem;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--color-text);
}

.radio-label input[type="radio"] {
    accent-color: var(--color-copper);
}

.answer-category-section {
    margin-bottom: 2rem;
}

.answer-card {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: var(--color-bg-card);
}

.answer-question {
    font-weight: 600;
    color: var(--color-accent);
    margin: 0 0 0.75rem;
}

.answer-response {
    color: var(--color-text);
    line-height: 1.65;
}

.answer-response a {
    font-weight: 600;
}

.questionnaire-list-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.questionnaire-thankyou {
    padding: 2.5rem 2rem;
    background: var(--color-bg-card);
}

.thankyou-icon {
    font-size: 2.5rem;
    color: var(--color-brass);
    margin-bottom: 0.75rem;
}

.questionnaire-answer-form {
    margin-bottom: 2rem;
}

@media (min-width: 600px) {
    .radio-group-inline {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem 1.5rem;
    }
}

/* Push notification prompt */
.push-prompt {
    display: none;
    margin-bottom: 24px;
    padding: 16px 20px;
}

.push-prompt.is-visible {
    display: block;
}

.push-prompt-inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.push-prompt-inner .gear-icon {
    font-size: 1.8rem;
    color: #b8732a;
    flex-shrink: 0;
    margin-top: 2px;
}

.push-prompt-text {
    flex: 1;
    min-width: 200px;
}

.push-prompt-text strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
    color: #b8732a;
}

.push-prompt-text p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.push-prompt-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* Color picker swatches */
.color-picker-section,
.logo-upload-section {
    display: none;
    margin-top: 14px;
    padding: 16px;
    background: rgba(180, 130, 60, 0.08);
    border: 1px solid rgba(180, 130, 60, 0.3);
    border-radius: 6px;
}

.color-picker-section.is-visible,
.logo-upload-section.is-visible {
    display: block;
}

.color-picker-instructions {
    margin-bottom: 12px;
    font-size: 0.875rem;
    line-height: 1.6;
}

.color-picker-instructions p {
    margin: 0 0 4px;
}

.color-picker-instructions ul {
    margin: 0;
    padding-left: 18px;
}

.color-picker-instructions li {
    margin-bottom: 2px;
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
    min-height: 20px;
}

.color-swatch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.color-swatch-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(180, 130, 60, 0.6);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.color-swatch-btn:hover {
    transform: scale(1.1);
    border-color: #b8732a;
}

.color-wheel-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.color-hex-label {
    font-size: 0.7rem;
    font-family: monospace;
    color: #b8732a;
    letter-spacing: 0.05em;
}

.color-remove-btn {
    margin-top: 4px;
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(180, 60, 60, 0.15);
    border: 1px solid rgba(180, 60, 60, 0.4);
    border-radius: 4px;
    color: #c0392b;
    cursor: pointer;
    transition: background 0.15s ease;
}

.color-remove-btn:hover {
    background: rgba(180, 60, 60, 0.3);
}

.add-color-btn {
    margin-top: 8px;
}
