/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Avenir', 'Avenir Next', 'Nunito Sans', 'Segoe UI', sans-serif;
    font-size: 15px;
    background-color: #ECEAEB;
    color: #08223D;
    min-height: 100dvh;
    padding: 16px 16px 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Optima', 'Optima Nova', 'Palatino', 'Palatino Linotype', serif;
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
    max-width: 680px;
    margin: 0 auto;
}

/* ── Header ───────────────────────────────────────────────── */
header {
    display: flex;
    flex-direction: column;        /* mobile: stack */
    gap: 0.75rem;
    margin-bottom: 28px;
}

@media (min-width: 640px) {
    header {
        flex-direction: row;
        align-items: flex-end;     /* buttons sit at bottom of logo */
        justify-content: center;
    }
}

/* Logo wrapper: centered on mobile, left on desktop */
.logo-wrap {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding-top: 0.5rem;
    padding-bottom: 1rem;
}

@media (min-width: 640px) {
    .logo-wrap {
        justify-content: flex-start;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.header-logo {
    width: 240px;
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Nav ──────────────────────────────────────────────────── */
nav {
    display: flex;
    flex-direction: column;        /* stacked on mobile */
    gap: 0.5rem;
    width: 100%;                   /* full width on mobile */
}

@media (min-width: 640px) {
    nav {
        align-items: flex-end;     /* right-aligned on desktop */
        width: auto;
    }
}

.nav-link {
    display: block;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    color: #3A5A40;
    background-color: rgba(58, 90, 64, 0.1);
    transition: background-color 0.2s, transform 0.15s;
    letter-spacing: 0.02em;
    text-align: center;
}

.nav-link:hover {
    background-color: rgba(58, 90, 64, 0.2);
    transform: translateY(-1px);
}

.nav-link.active {
    background-color: #08223D;
    color: #fff;
    box-shadow: 0 4px 14px rgba(8, 34, 61, 0.22);
}

.nav-link.active:hover {
    background-color: #3A5A40;
    box-shadow: 0 6px 18px rgba(58, 90, 64, 0.28);
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px 28px 32px;
    box-shadow: 0 4px 24px rgba(8, 34, 61, 0.07);
    margin-bottom: 20px;
}

.card h2 {
    font-family: 'Optima', 'Optima Nova', 'Palatino', 'Palatino Linotype', serif;
    color: #3A5A40;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    display: inline-block;
    padding: 0.3rem 0;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 0.875rem;
    color: #5a6a7a;
    margin-bottom: 24px;
}

/* ── Form ─────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #08223D;
    letter-spacing: 0.01em;
}

input[type="text"] {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 14px;
    background-color: #f0eeec;
    color: #08223D;
    font-size: 16px;
    font-family: inherit;
    transition: box-shadow 0.2s, background-color 0.2s;
}

input[type="text"]:focus {
    outline: none;
    background-color: #e8ede8;
    box-shadow: 0 0 0 3px rgba(58, 90, 64, 0.22);
}

/* Inline form (search bar) */
.form-group--inline {
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 0;
}

.form-group--inline input[type="text"] {
    flex: 1;
}

/* ── Button ───────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn--primary {
    background-color: #08223D;
    color: #fff;
    width: 100%;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(8, 34, 61, 0.22);
}

.btn--primary:hover {
    background-color: #3A5A40;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(58, 90, 64, 0.28);
}

.btn--primary:active {
    transform: scale(0.99);
}

.form-group--inline .btn {
    width: auto;
    margin-top: 0;
    white-space: nowrap;
}

/* ── Alert ────────────────────────────────────────────────── */
.alert {
    border-radius: 18px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: none;
}

.alert__message {
    font-weight: 600;
    font-size: 0.95rem;
}

.alert__detail {
    font-size: 0.875rem;
    opacity: 0.85;
}

.alert--success {
    background-color: rgba(58, 90, 64, 0.1);
    color: #3A5A40;
}

.alert--error {
    background-color: rgba(220, 38, 38, 0.08);
    color: #DC2626;
}

.alert--warning {
    background-color: rgba(184, 116, 50, 0.1);
    color: #7a4a10;
}

/* ── Table ────────────────────────────────────────────────── */
.results-heading {
    font-size: 0.9rem;
    font-weight: 500;
    color: #5a6a7a;
    margin-bottom: 16px;
}

.results-heading strong {
    color: #08223D;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
    font-size: 0.9rem;
}

thead tr {
    background-color: #3A5A40;
}

thead th {
    text-align: left;
    font-family: 'Optima', 'Optima Nova', 'Palatino', 'Palatino Linotype', serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ECEAEB;
    padding: 0.85rem 12px;
}

thead th:first-child { border-radius: 12px 0 0 0; }
thead th:last-child  { border-radius: 0 12px 0 0; }

tbody tr {
    border-bottom: 1px solid rgba(8, 34, 61, 0.06);
    transition: background 0.1s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background-color: rgba(115, 139, 101, 0.1);
}

tbody td {
    padding: 11px 12px;
    color: #08223D;
}

.col-num {
    color: #aaa;
    font-size: 0.8rem;
    width: 36px;
}

.col-date {
    color: #5a6a7a;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
    color: #5a6a7a;
    font-size: 0.9rem;
    text-align: center;
    padding: 16px 0 4px;
}

/* ── Avalon footer branding ───────────────────────────────── */
.avalon-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 0 1rem;      /* pt-6 pb-4 */
    gap: 0.75rem;                 /* space-y-3 */
}

.avalon-logo {
    max-width: 200px;
    width: 100%;
    height: auto;
}

.avalon-tagline {
    font-family: 'Optima', 'Optima Nova', 'Palatino', serif;
    font-size: 1rem;
    color: #08223D;
    margin: 0;
}

.avalon-sub {
    font-family: 'Avenir', 'Avenir Next', 'Nunito Sans', 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    color: #4a5568;
    margin: 0;
}

/* ── Support footer ───────────────────────────────────────── */
footer {
    text-align: center;
    padding: 0 1rem 2rem;
    font-size: 0.78rem;
    color: #9aa8b2;
}

footer a {
    color: #738B65;
    text-decoration: none;
}

.admin-footer-link {
    font-weight: 600;
    color: #08223D !important;
    letter-spacing: 0.02em;
}
.admin-footer-link:hover { color: #3A5A40 !important; }

.footer-divider {
    margin: 0 6px;
    color: #ccc;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .card { padding: 20px 18px 24px; }
    .col-date { font-size: 0.78rem; }
}

/* ── Email / Tel inputs ───────────────────────────────────── */
input[type="email"],
input[type="tel"],
input[type="password"] {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 14px;
    background-color: #f0eeec;
    color: #08223D;
    font-size: 16px;
    font-family: inherit;
    transition: box-shadow 0.2s, background-color 0.2s;
}
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus {
    outline: none;
    background-color: #e8ede8;
    box-shadow: 0 0 0 3px rgba(58, 90, 64, 0.22);
}

/* ── Select ───────────────────────────────────────────────── */
select {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 14px;
    background-color: #f0eeec;
    color: #08223D;
    font-size: 16px;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2308223D' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
    transition: box-shadow 0.2s, background-color 0.2s;
}
select:focus {
    outline: none;
    background-color: #e8ede8;
    box-shadow: 0 0 0 3px rgba(58, 90, 64, 0.22);
}
select:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Persona Toggle ───────────────────────────────────────── */
.persona-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.persona-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 1.25rem;
    border: 2px solid rgba(58, 90, 64, 0.25);
    border-radius: 50px;
    background: transparent;
    color: #3A5A40;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}
.persona-btn:hover {
    border-color: #3A5A40;
    background-color: rgba(58, 90, 64, 0.06);
}
.persona-btn.active {
    background-color: #08223D;
    border-color: #08223D;
    color: #fff;
    box-shadow: 0 4px 14px rgba(8, 34, 61, 0.22);
}

/* ── No-selection prompt ──────────────────────────────────── */
.no-selection-msg {
    text-align: center;
    padding: 24px 0 8px;
    color: #9aa8b2;
    font-size: 0.9rem;
}

/* ── Form section header (within card) ───────────────────── */
.form-section-header {
    font-family: 'Optima', 'Optima Nova', 'Palatino', serif;
    font-size: 1rem;
    font-weight: 600;
    color: #08223D;
    letter-spacing: 0.05em;
    margin: 4px 0 22px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(58, 90, 64, 0.15);
}

/* ── Section divider ──────────────────────────────────────── */
.form-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 22px;
}
.form-section-divider::before,
.form-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(8, 34, 61, 0.1);
}
.form-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #3A5A40;
    letter-spacing: 0.1em;
    white-space: nowrap;
    font-family: 'Optima', 'Palatino', serif;
}

/* ── Required asterisk ────────────────────────────────────── */
.req {
    color: #DC2626;
    margin-left: 1px;
}

/* ── Field hint (below label) ─────────────────────────────── */
.field-hint {
    font-size: 0.8rem;
    color: #5a6a7a;
    margin: -2px 0 4px;
}

/* ── Character counter ────────────────────────────────────── */
.char-counter {
    font-size: 0.78rem;
    color: #9aa8b2;
    margin-top: 2px;
}

/* ── File drop area ───────────────────────────────────────── */
.file-drop-area {
    position: relative;
    border: 2px dashed rgba(58, 90, 64, 0.3);
    border-radius: 14px;
    background: #f0eeec;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
}
.file-drop-area:hover,
.file-drop-area.drag-over {
    border-color: #3A5A40;
    background: #e8ede8;
}
.file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.file-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 16px;
    text-align: center;
    pointer-events: none;
}
.file-drop-icon {
    color: #3A5A40;
    opacity: 0.6;
}
.file-drop-text {
    font-size: 0.83rem;
    color: #5a6a7a;
    margin: 0;
}
.file-drop-name {
    font-size: 0.83rem;
    font-weight: 600;
    color: #3A5A40;
    margin: 0;
    word-break: break-all;
}
