/* /legacy-memories/public/css/dashboard.css
   My Legacy family room — same fireside palette as the sitting room, arranged
   as a quiet archive: memory cards, sessions, transcripts, and the message shelf. */

:root {
    --night:      #241b14;
    --night-2:    #2f241a;
    --card:       #33271b;
    --ivory:      #f3e9d8;
    --muted:      #c9b89f;
    --ember:      #e8a34c;
    --ember-deep: #c96f2e;
    --line:       rgba(243, 233, 216, 0.14);

    --display: "Fraunces", Georgia, serif;
    --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
}

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

body {
    background:
        radial-gradient(1200px 700px at 50% -10%, var(--night-2), transparent 70%),
        var(--night);
    color: var(--ivory);
    font-family: var(--body);
    font-size: 18px;
    line-height: 1.55;
    padding: 40px 20px 80px;
}

.hall {
    width: min(860px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* ---------- Masthead ---------- */

.masthead { text-align: center; }

.eyebrow {
    font-size: 14px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ember);
    margin-bottom: 12px;
}

.title {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(32px, 5vw, 44px);
}

.status-line { margin-top: 10px; color: var(--muted); min-height: 1.5em; }

/* ---------- Panels ---------- */

.panel-title {
    font-family: var(--display);
    font-weight: 500;
    font-size: 26px;
    margin-bottom: 6px;
}

.panel-copy { color: var(--muted); margin-bottom: 18px; }

.panel-title + .sessions, .panel-title + .messages { margin-top: 18px; }

/* ---------- Session cards ---------- */

.sessions { display: flex; flex-direction: column; gap: 18px; }

.session-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px 26px;
}

.session-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.session-name {
    font-family: var(--display);
    font-weight: 600;
    font-size: 24px;
}

.badge {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
}
.badge.active   { color: var(--ember); border-color: var(--ember); }
.badge.paused   { color: var(--ivory); }
.badge.complete { color: #a8c9a0; border-color: rgba(168, 201, 160, 0.5); }

.session-stats {
    margin-top: 6px;
    color: var(--muted);
    font-size: 16px;
}

.session-summary {
    margin-top: 14px;
    font-size: 17px;
    color: var(--ivory);
    opacity: 0.92;
    border-left: 3px solid var(--ember-deep);
    padding-left: 14px;
}

.session-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.session-player { width: 100%; margin-top: 14px; }
.session-player audio { width: 100%; }

.export-note { color: var(--muted); font-size: 15px; }

/* ---------- Messages shelf ---------- */

.messages { display: flex; flex-direction: column; gap: 12px; }

.message-row {
    display: flex;
    gap: 16px;
    align-items: baseline;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.message-for {
    font-family: var(--display);
    font-weight: 600;
    font-size: 20px;
    color: var(--ember);
    white-space: nowrap;
}

.message-context { color: var(--ivory); opacity: 0.92; flex: 1; min-width: 220px; }
.message-meta { color: var(--muted); font-size: 15px; }

.empty { color: var(--muted); font-style: italic; padding: 8px 2px; }

/* ---------- Buttons ---------- */

.btn {
    font-family: var(--body);
    font-weight: 700;
    font-size: 17px;
    padding: 12px 24px;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.btn-warm { background: var(--ember); color: #2a1708; }
.btn-warm:hover:not([disabled]) { background: #f0b061; }

.btn-quiet {
    background: transparent;
    color: var(--ivory);
    border-color: rgba(243, 233, 216, 0.4);
}
.btn-quiet:hover:not([disabled]) { border-color: var(--ivory); }

.btn-ghost {
    background: none;
    color: var(--muted);
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 4px;
    padding: 6px 10px;
}
.btn-ghost:hover { color: var(--ivory); }

/* ---------- Transcript reader ---------- */

.reader {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--night-2);
    color: var(--ivory);
    padding: 0;
    width: min(720px, 94vw);
    max-height: 84vh;
}
.reader::backdrop { background: rgba(16, 11, 7, 0.85); }

.reader-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 26px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: var(--night-2);
}

.reader-title { font-family: var(--display); font-weight: 500; font-size: 24px; }

.reader-body {
    padding: 24px 26px 34px;
    overflow-y: auto;
    max-height: calc(84vh - 78px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.turn-q {
    color: var(--ember);
    font-size: 16px;
}
.turn-a {
    font-size: 19px;
    line-height: 1.6;
    border-left: 3px solid var(--ember-deep);
    padding-left: 14px;
}

/* ---------- Access gate ---------- */

.gate {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--night-2);
    color: var(--ivory);
    padding: 36px;
    width: min(420px, 92vw);
}
.gate::backdrop { background: rgba(16, 11, 7, 0.85); }
.gate form { display: flex; flex-direction: column; gap: 18px; text-align: center; }
.gate-title { font-family: var(--display); font-weight: 500; font-size: 28px; }
.gate-input {
    font-size: 22px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid rgba(243, 233, 216, 0.3);
    background: var(--night);
    color: var(--ivory);
    text-align: center;
}
.gate-input:focus-visible { outline: none; border-color: var(--ember); }
.gate-error { color: #f0a48a; font-size: 17px; }

@media (max-width: 520px) {
    body { padding: 24px 14px 60px; }
    .session-actions .btn { width: 100%; }
}

/* ================= v2 additions: auth, wizard, subject cards ================= */
/* (file header note: this stylesheet lives at
   /legacy-memories/public/css/dashboard.css and supersedes family.css) */

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(460px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 40px 36px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-copy { color: var(--muted); font-size: 17px; }

.auth-tabs {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 6px;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--muted);
    font-family: var(--body);
    font-weight: 700;
    font-size: 16px;
    padding: 12px;
    cursor: pointer;
}
.auth-tab.is-active { background: var(--ember); color: #2a1708; }

.auth-form { display: flex; flex-direction: column; gap: 12px; }

.field {
    font-family: var(--body);
    font-size: 18px;
    padding: 13px 16px;
    border-radius: 10px;
    border: 2px solid rgba(243, 233, 216, 0.25);
    background: var(--night);
    color: var(--ivory);
    width: 100%;
}
.field:focus-visible { outline: none; border-color: var(--ember); }
textarea.field { resize: vertical; }

.form-error { color: #f0a48a; font-size: 16px; }

/* Masthead sign-out sits under the status line */
.masthead .btn-ghost { margin-top: 6px; }

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* ---------- Subject (memory) cards ---------- */

.subjects { display: flex; flex-direction: column; gap: 22px; }

.subject-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 26px 28px;
}

.subject-name {
    font-family: var(--display);
    font-weight: 600;
    font-size: 27px;
}

.subject-meta { color: var(--muted); font-size: 16px; margin-top: 4px; }

.share-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 16px;
    background: var(--night);
    border: 1px dashed rgba(232, 163, 76, 0.5);
    border-radius: 12px;
    padding: 12px 16px;
}

.share-label { color: var(--ember); font-weight: 700; font-size: 15px; white-space: nowrap; }

.share-link {
    flex: 1;
    min-width: 200px;
    color: var(--muted);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subject-sessions { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }

.session-card { background: var(--night-2); }

.new-story-row { margin-top: 14px; }

/* ---------- Create-a-memory sheet ---------- */

.sheet {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--night-2);
    color: var(--ivory);
    padding: 34px;
    width: min(560px, 94vw);
    max-height: 90vh;
    overflow-y: auto;
}
.sheet::backdrop { background: rgba(16, 11, 7, 0.85); }

.sheet form { display: flex; flex-direction: column; gap: 10px; }

.sheet-title { font-family: var(--display); font-weight: 500; font-size: 28px; }
.sheet-copy  { color: var(--muted); font-size: 16px; margin-bottom: 8px; }

.label { font-weight: 700; font-size: 16px; margin-top: 8px; text-align: left; }
.label-soft { font-weight: 400; color: var(--muted); }

.sheet-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}

/* Ensure the hidden attribute always wins over display:flex rules */
[hidden] { display: none !important; }
