:root {
    color-scheme: dark;

    --bg: #12141a;
    --surface: #1c1f28;
    --surface-raised: #262a35;
    --border: #2e323e;

    --text: #e7e9ee;
    --text-muted: #9aa2b1;

    /* Warm gold accent -- reads as "marquee lights" against the dark backdrop, fits the
       Movie Night Club branding better than a generic blue while staying easy on the eyes. */
    --accent: #e3a83b;
    --accent-hover: #f0ba55;
    --accent-text: #1a1300;

    --danger: #ff6b6b;
    --danger-bg: #3a1618;
    --danger-border: #6b2326;
    --danger-text: #ffb4b0;

    --success: #4caf72;
}

html, body {
    background: var(--bg);
    color: var(--text);
}

h1:focus {
    outline: none;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
    color: var(--accent);
}

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

.btn-primary, .btn-secondary {
    display: inline-block;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--surface-raised);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* Real buttons with a real tap target, not underlined text -- thin inline links were hard to hit
   precisely on mobile. */
.btn-action {
    background: var(--surface-raised);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    min-height: 2.25rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-action:hover {
    background: var(--border);
}

.btn-action.danger {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
}

.btn-action.danger:hover {
    background: var(--danger-border);
}

.table-scroll {
    margin-top: 1rem;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
}

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

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table tbody tr:hover {
    background: var(--surface-raised);
}

/* A row that opens a detail view on click (e.g. the party list) -- the actions column's own
   buttons stop propagation so this doesn't also fire when e.g. Delete is clicked. */
.data-table tbody tr.row-link {
    cursor: pointer;
}

/* The party view/edit modal's heading -- the party's own name/title, not a generic "Edit party"
   label, so it reads like a page title rather than a form caption. */
.view-title {
    font-size: 1.4rem;
    margin: 0 0 0.75rem;
}

.party-view-meta {
    color: var(--text-muted);
}

.party-view-headcount {
    font-weight: 600;
}

/* Marks where one major section of the admin party view ends and the next begins (status,
   invited-guest management, potluck items) -- without this, the view modal was just a long
   uninterrupted stack of .field labels (small, muted, meant for form captions) reading as one
   undifferentiated stream. Mirrors the plain <h2> section headers the guest-facing RSVP page
   already uses for the same sections ("Party status", "What to bring") -- the rule below only
   adds the divider those headers don't need out in the open page, where there's more breathing
   room between sections than inside this one tall scrolling modal. */
.modal-section-heading {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.alert {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    width: min(480px, 92vw);
    max-height: 85vh;
    overflow-y: auto;
    color: var(--text);
}

/* The party view/edit modal carries a lot more than a simple form (both guest tables, the potluck
   list) -- pinning every modal to the same narrow width regardless of viewport is what made the
   admin UI look phone-sized even on a full desktop window. Wider modals opt in via this class
   rather than widening .modal itself, so simple ones (Guests, "copy a previous party") stay compact. */
.modal-wide {
    width: min(880px, 94vw);
}

/* Not modal-scoped (despite most current uses being inside one) -- the guest-facing RSVP page
   reuses the same .field/.field-row conventions outside any modal, so these style any .field on
   the page rather than duplicating the block for a non-modal context. */
.field {
    margin-bottom: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.field label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.field input[type=text],
.field input[type=tel],
.field input[type=number],
.field input[type=datetime-local],
.field input[type=month],
.field input:not([type]),
.field textarea,
.field select {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
}

.field textarea {
    resize: vertical;
    min-height: 4rem;
}

/* flex-wrap + min-width: 0 (overriding flex's default min-width: auto) lets these reflow onto
   their own lines on a narrow screen instead of overflowing -- e.g. the three response label
   inputs, which used to scroll off the edge on mobile instead of just stacking. */
.field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.field-row .field {
    flex: 1 1 100px;
    min-width: 0;
}

.field input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: normal;
    color: var(--text);
}

.checkbox-list {
    max-height: 220px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.4rem;
}

/* The party edit form's invite list -- a real table (checkbox / name / response / action columns
   that line up row to row) rather than one flex row per guest, which put the copy-link button at
   a different horizontal position on every row depending on name length, and made a full-size
   button look oversized next to a single name. */
.invite-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.invite-table th,
.invite-table td {
    text-align: left;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.invite-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.invite-table tbody tr:last-child td {
    border-bottom: none;
}

.invite-table-actions {
    text-align: right;
    white-space: nowrap;
}

/* Potluck list (requirements.md #9) -- shown read-only to the admin and to guests on their RSVP
   page, and editable (sign-up controls, "add an item") on the RSVP page and the admin's item
   creation form. Reuses .invite-table's row layout; these tweak it for the extra content an item
   row carries (a description line, an inline notes input + sign-up button). */
.item-description {
    color: var(--text-muted);
}

.items-table .invite-table-actions {
    white-space: normal;
}

/* The sign-up control (a notes input plus its button) used to be two bare inline elements crammed
   into the actions cell with no wrap behavior of their own -- fine at the modal's old fixed 420px,
   but cramped and non-reflowing at any other width. Flex-wrap lets the button drop below the input
   once the cell gets tight instead of overflowing it. */
.claim-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.claim-notes-input {
    flex: 1 1 110px;
    min-width: 90px;
    max-width: 160px;
}

.new-item-row {
    margin-top: 0.75rem;
    align-items: flex-end;
}

/* Below this width, none of .invite-table's variants (the invited-guest list, the potluck items
   list) fit their 3-4 columns side by side no matter how narrow each gets -- .table-scroll's
   horizontal scroll technically "worked" but left content (a sign-up control, the Copy link
   button) scrolled out of the initial view, which is what actually prompted this: it read as
   cramped and non-reflowing, not just scrollable. Below the breakpoint, each row stacks into its
   own block instead, with the (now-hidden) column headers reproduced inline via each cell's
   data-label attribute -- a cell with no data-label (the invite checkbox, an action button) just
   renders unlabeled, which reads fine since the control speaks for itself. */
@media (max-width: 640px) {
    .invite-table thead {
        display: none;
    }

    .invite-table, .invite-table tbody, .invite-table tr, .invite-table td {
        display: block;
        width: 100%;
    }

    .invite-table tr {
        padding: 0.6rem 0;
    }

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

    .invite-table td {
        border-bottom: none;
        padding: 0.15rem 0;
    }

    .invite-table td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--text-muted);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .invite-table .invite-table-actions {
        text-align: left;
        padding-top: 0.3rem;
    }
}

.btn-action.btn-small {
    padding: 0.2rem 0.5rem;
    min-height: unset;
    font-size: 0.75rem;
}

.party-image-preview {
    display: block;
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    margin-top: 0.5rem;
    object-fit: cover;
}

/* Visually hides the native <input type="file"> itself -- not display:none, which some browsers
   don't reliably forward a <label for=...> click to. The label (styled as a regular button) is
   what the user actually sees and clicks; this just removes the native "Choose File" / "No file
   chosen" chrome from view without breaking the click-delegation. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-picker-button {
    margin-bottom: 0.5rem;
}

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

.rsvp-image {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.rsvp-meta {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.rsvp-choices {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rsvp-saved {
    color: var(--success);
    margin-top: 0.75rem;
}

.sms-optin-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.sms-optin-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.sms-optin-section .legal-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success);
}

.invalid {
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger-text);
}

.field-error {
    color: var(--danger-text);
    font-size: 0.85rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d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1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--danger-bg);
    border: 1px solid var(--danger-border);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--danger-text);
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Privacy / terms / SMS-reminders pages -- plain prose, needs comfortable reading width and
   line-height rather than the dense app-page table/form styling. */
.legal-page {
    line-height: 1.6;
}

.legal-page h1 {
    margin-bottom: 0.25rem;
}

.legal-page .legal-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0;
}

.legal-page h2 {
    margin-top: 2rem;
    font-size: 1.15rem;
}

.legal-page .legal-back {
    margin-top: 2.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.home-footer-links {
    margin-top: 2.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
