:root {
    --primary: #1e3a5f;
    --primary-hover: #284b78;
    --primary-soft: #e8eef6;
    --bg: #f3f5f8;
    --surface: #ffffff;
    --text: #1a2230;
    --muted: #6b7686;
    --border: #d9dee6;
    --danger: #c62828;
    --radius: 14px;
    --bar-height: 56px;
    --action-height: 76px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Colour themes: the default (navy) is in :root above. The header picker sets data-theme on <html>.
   Keep the ids and swatch colours in MainLayout.razor in step with these. */
[data-theme="rose"] { --primary: #863c55; --primary-hover: #9e4764; --primary-soft: #f5eaee; }
[data-theme="plum"] { --primary: #6d3662; --primary-hover: #854278; --primary-soft: #f5eaf3; }
[data-theme="burgundy"] { --primary: #712832; --primary-hover: #8c313d; --primary-soft: #f5eaec; }
[data-theme="terracotta"] { --primary: #84422a; --primary-hover: #9f4f32; --primary-soft: #f5edea; }
[data-theme="ochre"] { --primary: #80591e; --primary-hover: #9d6d25; --primary-soft: #f5f1ea; }
[data-theme="olive"] { --primary: #53642b; --primary-hover: #687d36; --primary-soft: #f2f5ea; }
[data-theme="forest"] { --primary: #265e44; --primary-hover: #317757; --primary-soft: #eaf5f0; }
[data-theme="sage"] { --primary: #487055; --primary-hover: #568666; --primary-soft: #eaf5ee; }
[data-theme="teal"] { --primary: #216363; --primary-hover: #2a7e7e; --primary-soft: #eaf5f5; }
[data-theme="violet"] { --primary: #4f3b72; --primary-hover: #60478a; --primary-soft: #eeeaf5; }

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

h1, h2 {
    margin: 0;
}

h1:focus {
    outline: none;
}

/* ---------- App shell ---------- */

.app-bar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 10;
    padding-top: var(--safe-top);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.app-bar-inner {
    position: relative; /* the dropdown menu is positioned against this */
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 640px;
    height: var(--bar-height);
    margin: 0 auto;
    padding: 0 16px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.app-brand:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
    border-radius: 6px;
}

/* Theme picker (header) */
.theme-picker {
    position: relative;
}

.theme-picker summary {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    list-style: none;
    cursor: pointer;
}

.theme-picker summary::-webkit-details-marker {
    display: none;
}

.theme-picker summary:hover,
.theme-picker[open] summary {
    background: rgba(255, 255, 255, 0.16);
}

.theme-picker summary:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.theme-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 36px);
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 6px 24px rgba(16, 24, 40, 0.22);
}

.theme-swatch {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: var(--sw);
    box-shadow: 0 0 0 1px var(--border);
    cursor: pointer;
}

/* Free accounts see the colours but can't pick them. */
.theme-swatch:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.theme-locked {
    grid-column: 1 / -1;
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
}

.theme-locked p {
    margin: 0 0 10px;
}

.theme-locked form {
    margin: 0;
}

.theme-locked .btn {
    width: 100%;
}

.theme-locked a {
    color: var(--primary);
}

.theme-swatch[aria-pressed="true"] {
    box-shadow: 0 0 0 2px var(--text);
}

.theme-swatch:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.app-logo {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
}

.app-strapline {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.78);
}

/* The account links and theme picker live in a dropdown opened by the hamburger button, at every screen width.
   (The toggle script is in App.razor.) Rules below must stay after the base .app-account rules above. */
.app-menu-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #fff;
    cursor: pointer;
}

.app-menu-toggle:hover,
.app-bar.menu-open .app-menu-toggle {
    background: rgba(255, 255, 255, 0.16);
}

.app-menu-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.app-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: min(320px, 100%);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0 16px 8px;
    border-radius: 0 0 12px 12px;
    background: var(--primary);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18);
}

.app-bar.menu-open .app-menu {
    display: flex;
}

/* On phones the menu spans the whole screen width. */
@media (max-width: 560px) {
    .app-menu {
        width: 100%;
        border-radius: 0;
    }
}

.app-account {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    font-size: 16px;
}

.app-account a,
.app-account button {
    color: #fff;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.app-account form {
    margin: 0;
}

/* "Logged in as ..." label: not clickable, so no hover state. */
.menu-user {
    display: block;
    padding: 4px 0 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    overflow-wrap: anywhere;
}

.menu-user strong {
    display: block;
    margin-top: 2px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

/* Each item is its own full-width row. */
.app-account a,
.app-account form,
.theme-picker {
    margin: 0 -16px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.app-account a,
.app-account button,
.theme-picker summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    padding: 14px 16px;
    border-radius: 0;
    text-align: left;
    transition: background-color 0.15s;
}

.theme-picker .menu-label {
    display: inline;
}

.app-account a:hover,
.app-account button:hover,
.theme-picker summary:hover,
.theme-picker[open] summary {
    background: rgba(255, 255, 255, 0.14);
    text-decoration: none;
}

.app-account a:active,
.app-account button:active,
.theme-picker summary:active {
    background: rgba(255, 255, 255, 0.24);
}

.app-account a:focus-visible,
.app-account button:focus-visible,
.theme-picker summary:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.theme-panel {
    position: static;
    justify-content: space-around;
    grid-template-columns: repeat(4, 36px);
    border-radius: 0;
    box-shadow: none;
}

.app-content {
    max-width: 640px;
    margin: 0 auto;
    padding: calc(var(--bar-height) + var(--safe-top) + 20px) 16px calc(var(--action-height) + var(--safe-bottom) + 24px);
}

.page-heading {
    margin: 0 4px 16px;
    font-size: 24px;
    font-weight: 700;
}

/* ---------- Cards ---------- */

.card {
    margin-bottom: 14px;
    padding: 18px 16px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.04);
}

.card-title {
    margin-bottom: 14px;
    font-size: 17px;
    font-weight: 600;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 24px 4px 12px;
}

.section-header h2 {
    font-size: 19px;
    font-weight: 700;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.center {
    text-align: center;
}

/* ---------- Form fields ---------- */

.field {
    margin-bottom: 14px;
    min-width: 0;
}

.field:last-child {
    margin-bottom: 0;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.field-row:last-child {
    margin-bottom: 0;
}

.field-row .field {
    margin-bottom: 0;
}

.field-row-3 {
    grid-template-columns: 0.8fr 1.3fr 1fr;
}

label, .label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.optional {
    font-weight: 400;
    opacity: 0.75;
}

input, textarea {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcfd;
    color: var(--text);
    font: inherit;
    font-size: 16px; /* 16px stops iOS zooming in on focus */
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
}

textarea {
    height: auto;
    padding: 12px 14px;
    resize: vertical;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15);
}

/* Checkboxes: the global input rule removes the native look, so draw the box and tick here. */
input[type=checkbox] {
    flex: none;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 2px solid var(--muted);
    border-radius: 5px;
    background: #fff center / 14px no-repeat;
    cursor: pointer;
}

input[type=checkbox]:checked {
    border-color: var(--primary);
    background-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3.2 3.2L13 4.5'/%3E%3C/svg%3E");
}

input[type=checkbox]:focus-visible {
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.25);
}

input.invalid {
    border-color: var(--danger);
}

input.invalid:focus {
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15);
}

input.uppercase {
    text-transform: uppercase;
}

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

.input-prefix {
    position: relative;
}

.input-prefix > span {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.input-prefix > input {
    padding-left: 26px;
}

.validation-message {
    margin-top: 6px;
    color: var(--danger);
    font-size: 13px;
}

/* ---------- Line items ---------- */

.line-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    margin-bottom: 10px;
}

.line-item-number {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.line-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 48px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 22px;
    border: none;
    border-radius: 12px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.08s;
    user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn:focus-visible, .btn-icon:focus-visible {
    outline: 3px solid rgba(30, 58, 95, 0.35);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--primary-soft);
    color: var(--primary);
}

.btn-add {
    width: 100%;
    border: 1.5px dashed #b4c0d0;
    background: transparent;
    color: var(--primary);
}

.btn-add:hover {
    background: var(--primary-soft);
}

.btn-add > span {
    font-size: 20px;
    line-height: 1;
}

.btn-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.btn-icon:hover, .btn-icon:active {
    background: #fdecec;
    color: var(--danger);
}

/* ---------- Bottom action bar ---------- */

.action-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    padding-bottom: var(--safe-bottom);
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.action-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 640px;
    height: var(--action-height);
    margin: 0 auto;
    padding: 0 16px;
}

.action-total {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.action-total strong {
    font-size: 20px;
    white-space: nowrap;
}

.action-bar .btn {
    flex-shrink: 0;
}

/* ---------- Summary ---------- */

.summary {
    padding: 32px 20px;
    text-align: center;
}

.summary-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #e6f4ea;
    color: #1e7b34;
    font-size: 26px;
    font-weight: 700;
}

/* Persistent reminder under the header until the business details are saved. */
.profile-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 14px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #fff4e0;
    border: 1px solid #f2d49b;
    border-radius: 10px;
    color: #6b4300;
    font-size: 14px;
    text-align: center;
}
.app-content .profile-banner a { color: inherit; font-weight: 600; }

.notice {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--text);
}

.notice-success {
    background: #e6f4ea;
    color: #14532d;
}

.notice strong {
    display: block;
}

.notice-dismiss {
    display: block;
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.summary h1 {
    font-size: 21px;
}

.summary p {
    margin: 6px 0 0;
}

.summary-total {
    margin-top: 16px !important;
    font-size: 30px;
    font-weight: 700;
}

.summary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

/* Rows that span both columns: Download | Edit, then New invoice, then (optionally) Upgrade / Manage subscription. */
.summary-action-wide {
    grid-column: 1 / -1;
}

.summary-action-wide.btn,
.summary-action-wide > .btn {
    width: 100%;
}

.summary-action-apart,
.summary-action-after {
    margin: 0;
}

/* Extra space on top of the grid gap, so the billing button reads as a separate action. */
.summary-action-apart { margin-top: 12px; }
.summary-action-after { margin-bottom: 12px; }

/* A disabled button (e.g. Download PDF once the free downloads are used up) must look unavailable. */
.btn:disabled {
    background: #e3e7ee;
    color: #8a94a3;
    cursor: not-allowed;
    transform: none;
}

/* ---------- Footer and legal pages ---------- */

.app-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
}

.app-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.app-footer a { color: var(--muted); }

.legal { padding: 22px 18px; }
.legal h1 { margin: 0 0 4px; font-size: 24px; }
.legal h2 { margin: 24px 0 8px; font-size: 17px; font-weight: 700; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal .muted { margin-bottom: 16px; }

/* A legal-page value that hasn't been configured yet (Legal:* settings): hard to miss on purpose. */
.legal-placeholder { background: #fff4a8; color: #5c4b00; padding: 0 4px; border-radius: 4px; font-weight: 600; }

/* ---------- About page ---------- */

.about-card p { margin: 0 0 12px; }
.about-card p:last-child { margin-bottom: 0; }
.about-card .card-title { margin-bottom: 8px; }
.about-lead { font-size: 19px; font-weight: 600; }

/* ---------- Contact page ---------- */

select {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcfd;
    color: var(--text);
    font: inherit;
    font-size: 16px;
}

select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* Spam trap: off-screen rather than display:none, which some bots skip. */
.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Home page ---------- */

a.btn { text-decoration: none; }

.home-hero {
    padding: 12px 4px 8px;
    text-align: center;
}

.home-title {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.home-lead {
    margin: 0 auto 20px;
    max-width: 460px;
    font-size: 17px;
    color: var(--text);
}

.home-actions {
    display: grid;
    gap: 12px;
    margin: 20px 0 12px;
}

.home-actions form { margin: 0; }
.home-actions .btn { width: 100%; }

.home-welcome { padding: 22px 18px; }
.home-welcome .muted { margin: 0; }

.home-section { margin-top: 32px; }

.home-heading {
    margin: 0 4px 14px;
    font-size: 21px;
    font-weight: 700;
}

.home-steps {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-steps .card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.home-steps p { margin: 4px 0 0; }

.home-step-number {
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}

.home-plans {
    display: grid;
    gap: 14px;
}

.home-plan {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.home-plan h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.home-plan form { margin: 0; }
.home-plan .btn { width: 100%; margin-top: auto; }

.home-plan-featured { border: 2px solid var(--primary); }

.home-price {
    margin: 6px 0 14px;
    font-size: 30px;
    font-weight: 700;
}

.home-price-unit {
    font-size: 15px;
    font-weight: 500;
    color: var(--muted);
}

.home-features {
    flex: 1;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.home-features li {
    position: relative;
    padding: 0 0 10px 26px;
}

.home-features li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 4px;
    width: 12px;
    height: 7px;
    border-left: 2.5px solid var(--primary);
    border-bottom: 2.5px solid var(--primary);
    transform: rotate(-45deg);
}

.home-section > .muted { margin-top: 14px; }
.home-contact { margin-top: 32px; }

/* ---------- Small phones ---------- */

@media (max-width: 360px) {
    .field-row:not(.field-row-3) {
        grid-template-columns: 1fr;
    }

    .field-row-3 {
        grid-template-columns: 1fr 1fr;
    }

    .field-row-3 .field:last-child {
        grid-column: 1 / -1;
    }

    .line-total {
        justify-content: flex-start;
        height: auto;
    }
}

/* ---------- Blazor error UI ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1000;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    padding-bottom: calc(0.7rem + var(--safe-bottom));
    background: #fff8e1;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    color: var(--text);
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    cursor: pointer;
}

.blazor-error-boundary {
    padding: 1rem;
    border-radius: var(--radius);
    background: #b32121;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ---------- Account pages (Identity UI uses Bootstrap class names) ---------- */

.row { display: flex; flex-wrap: wrap; gap: 24px; }
.row > [class*="col-"] { flex: 1 1 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.mb-3 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.text-secondary { color: var(--muted); }
.text-danger { color: var(--danger); }

.form-floating { display: flex; flex-direction: column-reverse; gap: 6px; margin-bottom: 16px; }
.form-floating > label, .form-label { font-size: 14px; font-weight: 500; }
.form-floating > .form-control::placeholder { color: transparent; }
.form-check-input { width: auto; margin-right: 8px; }
.checkbox label { display: flex; align-items: center; }

.btn-lg { padding: 14px 20px; }
.btn-link { background: none; color: var(--primary); text-decoration: underline; }
.btn.w-100 { width: 100%; }

.app-content h1 { font-size: 24px; margin-bottom: 8px; }
.app-content h2 { font-size: 16px; font-weight: 500; color: var(--muted); margin-bottom: 16px; }
.app-content hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.app-content a { color: var(--primary); }
/* Links styled as solid buttons keep white text whatever the theme (the rule above would otherwise recolour them). */
.app-content a.btn-primary, .app-content a.btn-danger { color: #fff; }
.app-content .app-account a { color: #fff; }

/* Status messages (StatusMessage.razor uses Bootstrap's alert classes) */
.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.45;
}
.alert-danger { background: #fdecea; border-color: #f5c2c0; color: #8a1c1c; }
.alert-success { background: #e6f4ea; border-color: #b7e0c1; color: #14532d; }
.alert-warning { background: #fff4e0; border-color: #f2d49b; color: #6b4300; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a82121; }
a.btn { text-decoration: none; }

/* Account area (manage pages) */
.manage-nav {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
    padding-bottom: 4px;
    overflow-x: auto;
}
.manage-nav a {
    flex: none;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}
.manage-nav a.active { background: var(--primary); color: #fff; }
.manage-content h3 { margin-bottom: 12px; font-size: 17px; font-weight: 600; }
.manage-content .btn { margin-top: 4px; }

.info-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--primary-soft);
}
.info-label { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.info-value { font-weight: 600; overflow-wrap: anywhere; }
.info-badge { padding: 2px 10px; border-radius: 999px; background: #e6f4ea; color: #14532d; font-size: 13px; font-weight: 600; }
.info-badge-warn { background: #fff4e0; color: #6b4300; }

.login-list { margin: 0; padding: 0; list-style: none; }
.login-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.login-list li:last-child { border-bottom: 0; }
.login-list form { margin: 0; }

.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 12px; }
.detail-list dt { color: var(--muted); font-size: 14px; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }

/* Confirmation screens */
.steps { margin: 16px 0; padding: 0; list-style: none; text-align: left; font-size: 14px; color: var(--muted); }
.steps li { margin: 6px 0; }
.steps-numbered { counter-reset: step; }
.steps-numbered li { position: relative; margin: 12px 0; padding-left: 38px; color: var(--text); font-size: 15px; }
.steps-numbered li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: -1px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}
.steps-title { margin: 24px 0 4px; font-size: 16px; font-weight: 600; text-align: left; color: var(--text); }
.summary-icon-warn { background: #fdecea; color: var(--danger); }
.auth-email { color: var(--text); overflow-wrap: anywhere; }
.auth-fineprint { margin: 16px 0 0; font-size: 13px; }
.summary-actions-single { grid-template-columns: 1fr; }
.summary-actions-single .btn { display: flex; height: auto; min-height: 48px; padding-top: 12px; padding-bottom: 12px; text-align: center; text-decoration: none; }

/* Login page */
.auth-card { max-width: 440px; margin: 0 auto 14px; padding: 24px 20px; }
.auth-title { margin-bottom: 4px; text-align: center; }
.auth-subtitle { margin-bottom: 20px; text-align: center; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--muted);
    font-size: 13px;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

.auth-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}
.auth-options label { display: flex; align-items: center; margin: 0; }

.auth-register { margin: 20px 0 8px; text-align: center; font-size: 15px; }
.auth-register a { font-weight: 600; }

.social-buttons { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #747775;
    border-radius: 999px;
    background: #fff;
    color: #1f1f1f;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s, box-shadow 0.15s;
}

.btn-google:hover { background: #f8faff; box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3); }
.btn-google:active { background: #eef3fd; }
.btn-google:focus-visible { outline: 2px solid #4285f4; outline-offset: 2px; }

/* ---------- "Watch how it works" popup (Components/Layout/PromoVideo.razor, wwwroot/promo.js) ---------- */

.home-watch { margin-top: 16px; text-align: center; }
.promo-open { display: inline-flex; align-items: center; gap: 8px; }

.promo-dialog {
    width: min(94vw, 440px);
    max-height: 94vh;
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: var(--surface, #fff);
    color: var(--text);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(26, 34, 48, 0.4);
}
.promo-dialog::backdrop { background: rgba(26, 34, 48, 0.65); }
.promo-frame { position: relative; display: flex; flex-direction: column; max-height: 94vh; max-height: 94dvh; overflow: hidden; }
.promo-close {
    position: absolute; top: 8px; right: 8px; z-index: 5;
    width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, 0.9); color: var(--primary);
    font-size: 24px; line-height: 1; cursor: pointer;
}
.promo-close:focus-visible, .promo-controls .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.promo-stage {
    position: relative;
    width: 100%;
    /* Tall as a 4:5 picture, but never so tall that the caption and buttons are pushed off a short screen (no scrollbar). */
    height: min(550px, calc(94vh - 160px));
    height: min(550px, calc(94dvh - 160px));
    min-height: 300px;
    flex: none;
    overflow: hidden;
    background: linear-gradient(160deg, var(--primary), var(--primary-hover));
    color: #fff;
}
.promo-scene {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    padding: 28px 22px;
    text-align: center;
    opacity: 0; visibility: hidden;
    transition: opacity .4s ease;
}
.promo-scene.is-active { opacity: 1; visibility: visible; }

.promo-logo {
    width: 76px; height: 76px; border-radius: 20px;
    background: #fff; color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700;
}
.promo-title { margin: 0; font-size: 30px; color: #fff; }
.promo-sub { margin: 0; font-size: 17px; opacity: .9; }
.promo-step { margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }

.promo-card, .promo-doc, .promo-plan {
    width: 100%; max-width: 330px;
    background: #fff; color: var(--text);
    border-radius: 12px; padding: 16px;
    text-align: left;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.promo-card { display: flex; flex-direction: column; gap: 6px; }
.promo-label { font-size: 12px; color: var(--muted); }
.promo-field { display: block; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; min-height: 40px; }
.promo-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.promo-total { border-bottom: 0; font-weight: 700; font-size: 17px; color: var(--primary); }

.promo-doc { padding: 14px; font-size: 12px; }
.promo-doc-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; color: var(--primary); }
.promo-doc-head span { color: var(--muted); font-size: 10px; text-align: right; }
.promo-doc-cols { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.promo-doc-cols b { display: block; font-size: 9px; letter-spacing: .08em; color: var(--muted); }
.promo-doc-line { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--border); }
.promo-doc-total { font-weight: 700; color: var(--primary); }

.promo-fake-button { width: 100%; max-width: 330px; background: #fff; color: var(--primary); text-align: center; pointer-events: none; }
.promo-file { padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); font-size: 13px; }

.promo-plan { display: flex; flex-direction: column; gap: 2px; }
.promo-plan strong { font-size: 18px; color: var(--primary); }
.promo-plan span { font-size: 14px; color: var(--muted); }
.promo-plan .promo-plan-price { font-style: normal; font-size: 20px; font-weight: 700; color: var(--text); }
.promo-plan .promo-plan-price span { font-size: 14px; font-weight: 400; }
.promo-plan-featured { outline: 3px solid rgba(255, 255, 255, 0.7); }
.promo-logo-xl { width: 128px; height: 128px; border-radius: 34px; font-size: 48px; }

.promo-bar { height: 4px; background: var(--primary-soft); }
.promo-bar-fill { display: block; height: 100%; width: 0; background: var(--primary); transition: width .1s linear; }
.promo-caption { margin: 0; padding: 14px 18px 6px; min-height: 3.2em; text-align: center; font-size: 16px; }
.promo-controls { display: flex; justify-content: center; gap: 8px; padding: 6px 14px 16px; }
.promo-controls .btn { width: auto; min-width: 44px; padding: 8px 14px; }

/* Starting states, and the animations that run once a scene becomes active. */
.promo-rise { opacity: 0; transform: translateY(14px); }
.promo-pop { opacity: 0; transform: scale(.8); }
.promo-type { display: block; clip-path: inset(0 100% 0 0); }
.is-active .promo-rise { animation: promo-rise .5s ease-out var(--delay, 0s) forwards; }
.is-active .promo-pop { animation: promo-pop .5s cubic-bezier(.2, .9, .3, 1.3) var(--delay, 0s) forwards; }
.is-active .promo-type { animation: promo-type var(--d, 1s) steps(var(--n, 12), end) var(--delay, 0s) forwards; }
.is-active .promo-fake-button { animation: promo-rise .5s ease-out var(--delay, 0s) forwards, promo-press .5s ease-in-out calc(var(--delay, 0s) + 1s) 1; }
.promo-stage.is-paused .promo-scene * { animation-play-state: paused !important; }

@keyframes promo-rise { to { opacity: 1; transform: none; } }
@keyframes promo-pop { to { opacity: 1; transform: none; } }
@keyframes promo-type { to { clip-path: inset(0 0 0 0); } }
@keyframes promo-press { 40% { transform: scale(.94); } }

@media (prefers-reduced-motion: reduce) {
    .promo-scene { transition: none; }
    .promo-rise, .promo-pop { opacity: 1; transform: none; animation: none !important; }
    .promo-type { clip-path: none; animation: none !important; }
    .promo-bar-fill { transition: none; }
}
@media (max-height: 700px) {
    .promo-scene { gap: 8px; padding: 16px 18px; }
    .promo-logo { width: 56px; height: 56px; font-size: 22px; border-radius: 16px; }
    .promo-logo.promo-logo-xl { width: 96px; height: 96px; font-size: 36px; border-radius: 26px; }
    .promo-title { font-size: 24px; }
    .promo-card, .promo-doc, .promo-plan { padding: 12px; }
    .promo-row { padding: 7px 0; }
    .promo-caption { padding-top: 10px; min-height: 2.8em; font-size: 15px; }
    .promo-controls { padding-bottom: 12px; }
}
