/* ─── Design tokens ─── */
:root {
    --font: 'Vazirmatn', system-ui, sans-serif;

    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-muted: #f1f5f9;
    --bg-subtle: #e2e8f0;

    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #dbeafe;
    --primary-ring: rgba(59, 130, 246, 0.25);

    --accent: #60a5fa;
    --accent-light: #eff6ff;

    --warning-bg: #fffbeb;
    --warning-text: #b45309;
    --warning-border: #fcd34d;

    --success-bg: #ecfdf5;
    --success-text: #047857;
    --success-border: #6ee7b7;

    --danger-bg: #fef2f2;
    --danger-text: #b91c1c;
    --danger-border: #fca5a5;

    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 48px rgba(15, 23, 42, 0.12);

    --header-h: 64px;
    --footer-h: 88px;
    --container-max: 1080px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    --landing-bg-start: #0f172a;
    --landing-bg-mid: #1e293b;
    --landing-bg-accent: #1e40af;
    --landing-bg-end: #0c4a6e;
    --landing-highlight: #60a5fa;
    --landing-text: #f8fafc;
    --landing-muted: rgba(248, 250, 252, 0.75);

    --bs-primary: var(--primary);
    --bs-primary-rgb: 59, 130, 246;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(147, 197, 253, 0.06), transparent);
    pointer-events: none;
    z-index: -1;
}

/* ─── Layout ─── */
.site-container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

main.site-main {
    flex: 1;
    padding-block: 2rem 3rem;
}

/* ─── Header ─── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header .site-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 1rem;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.125rem;
    transition: opacity var(--transition);
}

.site-brand:hover {
    color: var(--text);
    opacity: 0.85;
}

.site-brand__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary) 0%, var(--landing-highlight) 100%);
    color: #fff;
    flex-shrink: 0;
}

.site-brand__icon svg {
    width: 20px;
    height: 20px;
}

.site-tagline {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: none;
}

@media (min-width: 768px) {
    .site-tagline {
        display: block;
    }
}

/* ─── Footer ─── */
.site-footer {
    margin-top: auto;
    padding-block: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.site-footer__copy {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}

.site-footer__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.site-footer__nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.site-footer__nav a:hover {
    color: var(--primary);
}

.site-footer__sep {
    color: var(--text-muted);
    user-select: none;
}

.site-footer--landing {
    position: relative;
    z-index: 1;
    border-top: none;
    background: transparent;
}

.site-footer--landing .site-footer__nav a,
.site-footer--landing .site-footer__copy {
    color: var(--landing-muted);
}

.site-footer--landing .site-footer__nav a:hover {
    color: var(--landing-text);
}

.site-footer--landing .site-footer__sep {
    color: rgba(248, 250, 252, 0.4);
}

/* ─── Cards ─── */
.card-surface {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ─── Hero ─── */
.hero {
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: -40%;
    left: -10%;
    width: 50%;
    height: 120%;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}

.hero__content {
    position: relative;
    z-index: 1;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.hero__title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.hero__lead {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    max-width: 36rem;
}

/* ─── Steps ─── */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 640px) {
    .steps {
        grid-template-columns: 1fr;
    }
}

.step-card {
    padding: 1.25rem;
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}

.step-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.step-card__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

.step-card__title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.step-card__desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}

/* ─── Section headers ─── */
.section-header {
    margin-bottom: 1.25rem;
}

.section-header__title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.section-header__sub {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* ─── Sample grid ─── */
.sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.875rem;
}

.sample-grid__item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 3 / 4;
    border: 1px solid var(--border);
    background: var(--bg-muted);
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition), box-shadow var(--transition);
}

.sample-grid__item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.sample-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ─── Upload form ─── */
.upload-section {
    padding: 2rem;
}

.upload-section__title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.upload-section__sub {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.form-control {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.875rem;
    font-family: var(--font);
    font-size: 0.9375rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.form-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.file-drop {
    position: relative;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-muted);
    transition: border-color var(--transition), background var(--transition);
    margin-bottom: 0.5rem;
}

.file-drop:has(input:focus),
.file-drop:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-drop__icon {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.file-drop__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.75rem;
}

.file-drop input[type="file"] {
    font-size: 0.8125rem;
    max-width: 100%;
}

.file-drop input[type="file"]::file-selector-button {
    font-family: var(--font);
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: background var(--transition);
}

.file-drop input[type="file"]::file-selector-button:hover {
    background: var(--primary-hover);
}

/* ─── Buttons ─── */
.btn {
    font-family: var(--font);
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.625rem 1.25rem;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-ring);
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--border-strong);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-hover);
}

.btn-outline-secondary {
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: var(--bg-muted);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-success {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-success:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-link {
    color: var(--text-secondary);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--primary);
}

/* ─── Status blocks ─── */
.status-block {
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    border: 1px solid;
}

.status-block--pending {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-border);
}

.status-block--completed {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

.status-block__title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-block__text {
    margin: 0.5rem 0 0;
    opacity: 0.9;
    font-size: 0.9375rem;
}

/* ─── Result summary ─── */
.result-summary {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.result-summary__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.result-summary__body {
    display: block;
    width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-family: var(--font);
    font-size: 0.9375rem;
    line-height: 1.8;
    margin: 0;
    color: var(--text);
    direction: rtl;
    unicode-bidi: plaintext;
    text-align: start;
}

/* ─── Result page (AI chat) ─── */
.result-page__header {
    margin-bottom: 2rem;
}

.result-page__brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-page__brand-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary-light), #e0e7ff);
    color: var(--primary);
    font-size: 1.35rem;
    flex-shrink: 0;
}

.result-thread {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-message {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.result-message--user {
    flex-direction: row-reverse;
}

.result-message__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg-muted);
    color: var(--text-secondary);
    font-size: 1.1rem;
    border: 1px solid var(--border);
}

.result-message__avatar--ai {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.result-message__bubble {
    flex: 1;
    min-width: 0;
    max-width: min(100%, 640px);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}

.result-message--user .result-message__bubble {
    background: var(--bg-muted);
    border-color: var(--border-strong);
}

.result-message__bubble--answer {
    background: linear-gradient(180deg, #f8faff 0%, var(--bg-elevated) 100%);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-xs);
}

.result-message__bubble--error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
}

.result-message--pending .result-message__bubble {
    background: var(--warning-bg);
    border-color: var(--warning-border);
}

.result-message__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.result-message__sender {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
}

.result-message__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
}

.result-message__badge--done {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

.result-message__text {
    font-size: 0.9375rem;
    line-height: 1.7;
    margin: 0;
}

.result-message__footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.result-invoice-preview {
    display: block;
    margin-bottom: 0.75rem;
}

.result-invoice-preview .preview-image {
    margin-bottom: 0;
}

.result-invoice-pdf {
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-muted);
}

.result-invoice-pdf__frame {
    display: block;
    width: 100%;
    height: min(420px, 60vh);
    border: 0;
}

.result-invoice-file {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.result-actions__form {
    margin: 0;
}

.result-action-btn {
    text-align: center;
    font-weight: 500;
}

.result-message--animated {
    animation: result-message-in 0.35s ease-out both;
}

.result-message--thinking .result-message__bubble {
    background: var(--warning-bg);
    border-color: var(--warning-border);
}

.result-thinking {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.result-thinking__dots {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.result-thinking__dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.35;
    animation: result-thinking-dot 1.2s ease-in-out infinite;
}

.result-thinking__dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.result-thinking__dots span:nth-child(3) {
    animation-delay: 0.3s;
}

.result-typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-inline-start: 2px;
    vertical-align: text-bottom;
    background: var(--primary);
    animation: result-cursor-blink 0.9s step-end infinite;
}

@keyframes result-message-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes result-thinking-dot {
    0%,
    80%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

@keyframes result-cursor-blink {
    0%,
    50% {
        opacity: 1;
    }
    51%,
    100% {
        opacity: 0;
    }
}

.admin-action-button-row {
    background: var(--bg-muted);
}

.admin-template-picker {
    background: var(--bg-muted);
}

.result-invoice-file a {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
}

.result-invoice-file a:hover {
    text-decoration: underline;
}

.result-summary--ai {
    background: transparent;
    border: none;
    padding: 0;
}

.result-summary--ai .result-summary__body {
    font-size: 0.9375rem;
    background: transparent;
    border: none;
    padding: 0;
}

/* ─── Success page ─── */
.success-page {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 480px;
    margin-inline: auto;
}

.success-page__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success-bg);
    color: var(--success-text);
    border-radius: 50%;
    border: 2px solid var(--success-border);
}

.success-page__icon svg {
    width: 36px;
    height: 36px;
}

.success-page__title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.success-page__text {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ─── Page header (inner pages) ─── */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.page-header__sub {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
}

/* ─── Admin ─── */
.admin-card {
    padding: 2rem;
}

.admin-queue-badge {
    background: var(--primary-light);
    color: var(--primary-hover);
    border: 1px solid var(--border-strong);
    font-weight: 600;
    font-size: 0.8125rem;
}

.admin-queue-badge .bi {
    color: var(--primary);
}

.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.admin-filter {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-muted);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.admin-filter:hover {
    color: var(--primary-hover);
    background: var(--primary-light);
    border-color: var(--primary);
}

.admin-filter--active {
    color: var(--primary-hover);
    background: var(--primary-light);
    border-color: var(--primary);
}

.admin-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.admin-status--ok {
    background: var(--success-bg);
    color: var(--success-text);
}

.admin-status--warn {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.admin-status--pending {
    background: var(--accent-light);
    color: var(--primary-hover);
}

.admin-result-summary {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    direction: rtl;
    unicode-bidi: plaintext;
    text-align: start;
    padding: 1rem 1.25rem;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    line-height: 1.8;
}

.admin-table {
    margin: 0;
    font-size: 0.875rem;
}

.admin-table thead th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    white-space: nowrap;
    background: var(--bg-muted);
}

.admin-table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background: var(--bg-muted);
}

.admin-table__link-cell {
    min-width: 12rem;
    max-width: 18rem;
}

.result-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}

.result-link__anchor {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    min-width: 0;
    word-break: break-all;
}

.result-link__anchor:hover {
    text-decoration: underline;
}

.result-link--compact .result-link__anchor {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
}

.result-link__copy {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.admin-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.admin-empty__icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

/* ─── Login ─── */
.login-card {
    max-width: 400px;
    margin-inline: auto;
    padding: 2rem;
}

.login-card__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-muted);
    border-radius: var(--radius);
    color: var(--text-secondary);
}

/* ─── Job detail ─── */
.detail-list {
    display: grid;
    gap: 0;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.detail-list__row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.detail-list__row:last-child {
    border-bottom: none;
}

.detail-list__row:nth-child(even) {
    background: var(--bg-muted);
}

.detail-list__dt {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
}

.detail-list__dd {
    margin: 0;
    font-size: 0.9375rem;
}

.preview-image {
    max-height: 480px;
    width: 100%;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-muted);
    margin-bottom: 1.5rem;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* ─── Alerts (Bootstrap override) ─── */
.alert {
    border-radius: var(--radius-sm);
    border-width: 1px;
    font-size: 0.875rem;
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}

.alert-danger {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
}

.validation-summary-valid {
    display: none;
}

.alert-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}

/* ─── Utilities ─── */
.text-muted {
    color: var(--text-muted) !important;
}

.text-danger {
    color: var(--danger-text) !important;
}

.mb-section {
    margin-bottom: 2rem;
}

/* ─── Landing page ─── */
body.body--landing {
    overflow: hidden;
    background-color: var(--landing-bg-start);
    color: var(--landing-text);
}

body.body--landing::before {
    display: none;
}

.landing-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        135deg,
        var(--landing-bg-start) 0%,
        var(--landing-bg-mid) 35%,
        var(--landing-bg-accent) 70%,
        var(--landing-bg-end) 100%
    );
    background-size: 200% 200%;
    animation: landingGradient 12s ease infinite;
}

.landing-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, rgba(30, 64, 175, 0.25) 0%, transparent 60%);
}

@keyframes landingGradient {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .landing-bg {
        animation: none;
        background-position: 0% 50%;
    }
}

main.site-main--landing {
    position: relative;
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - var(--footer-h));
}

.landing {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - var(--footer-h));
    overflow-x: clip;
    overflow-y: visible;
}

.landing__particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.landing-hero {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem 1rem;
    text-align: center;
}

.landing-logo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--landing-text);
    margin-bottom: 1.5rem;
    transition: color var(--transition), opacity var(--transition);
}

.landing-logo:hover,
.landing-logo:focus-visible {
    color: var(--landing-text);
    text-decoration: none;
}

.landing-logo:hover .landing-logo__text,
.landing-logo:focus-visible .landing-logo__text {
    color: #ffffff;
}

.landing-logo:hover .landing-logo__icon,
.landing-logo:focus-visible .landing-logo__icon {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.landing-logo__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: background var(--transition), border-color var(--transition);
}

.landing-logo__icon svg {
    width: 36px;
    height: 36px;
    color: #fef08a;
}

.landing-logo__text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.landing-hero__title {
    font-size: clamp(1.25rem, 3.5vw, 1.5rem);
    font-weight: 600;
    color: var(--landing-text);
    max-width: 28rem;
    margin: 0 auto 0.75rem;
    line-height: 1.5;
}

.landing-hero__subtitle {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    font-weight: 400;
    color: var(--landing-muted);
    max-width: 28rem;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.landing-hero__free {
    font-weight: 700;
    color: var(--landing-text);
}

.landing-form {
    width: 100%;
    max-width: 420px;
}

.landing-form__error:not(:empty) {
    background: rgba(254, 226, 226, 0.95);
    border-color: #fca5a5;
    color: #b91c1c;
}

.landing-upload {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 1.25rem 1.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.landing-upload:hover,
.landing-upload:focus-within {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.landing-upload__icon {
    font-size: 1.5rem;
    color: var(--landing-text);
    opacity: 0.9;
}

.landing-upload__label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--landing-text);
}

.landing-upload__hint {
    font-size: 0.75rem;
    color: var(--landing-muted);
}

.landing-upload__plan-note {
    margin: 0.625rem 0 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--landing-muted);
    text-align: center;
}

.landing-upload__filename {
    font-size: 0.8125rem;
    color: #bfdbfe;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.landing-upload__filename:not([hidden]) {
    display: block;
}

label.landing-upload {
    display: flex;
}

.landing-upload--has-file {
    border-color: rgba(191, 219, 254, 0.5);
}

.landing-upload--error {
    border-color: rgba(252, 165, 165, 0.85);
    background: rgba(254, 226, 226, 0.15);
}

.landing-upload--error:hover,
.landing-upload--error:focus-within {
    border-color: rgba(252, 165, 165, 0.95);
    background: rgba(254, 226, 226, 0.22);
}

.upload-step {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.upload-step--hidden {
    display: none;
}

.upload-step[data-step="2"]:not(.upload-step--hidden) {
    animation: stepReveal 0.4s ease;
}

@keyframes stepReveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-form__label {
    color: var(--landing-text);
    text-align: right;
}

.landing-form__input {
    background: rgba(255, 255, 255, 0.95);
    border-color: transparent;
    text-align: center;
}

.landing-form__input:focus {
    border-color: var(--landing-highlight);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.landing-form__submit {
    background: #fff;
    color: var(--landing-bg-accent);
    border: none;
    font-weight: 600;
    border-radius: 999px;
    padding-block: 0.75rem;
    transition: transform var(--transition), box-shadow var(--transition);
}

.landing-form__submit:hover,
.landing-form__continue:hover {
    background: #f1f5f9;
    color: var(--landing-bg-start);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.landing-form__continue {
    background: #fff;
    color: var(--landing-bg-accent);
    border: none;
    font-weight: 600;
    border-radius: 999px;
    padding-block: 0.75rem;
    transition: transform var(--transition), box-shadow var(--transition);
}

.landing-form .text-danger {
    color: #fecaca !important;
    font-size: 0.8125rem;
}

.landing-plan-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 0.625rem;
}

.landing-plan-row .landing-upload__plan-note {
    margin: 0;
}

.landing-plus-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.14);
    color: var(--landing-text);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.landing-plus-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.landing-plus-btn i {
    font-size: 1rem;
    line-height: 1;
}

/* ─── Plus plan & upload modals (responsive width) ─── */
.plus-modal .modal-dialog,
.upload-modal .modal-dialog {
    width: calc(100% - 1.5rem);
    max-width: 22rem;
    margin-inline: auto;
}

@media (min-width: 576px) {
    .plus-modal .modal-dialog,
    .upload-modal .modal-dialog {
        max-width: 26rem;
    }
}

@media (min-width: 768px) {
    .plus-modal .modal-dialog,
    .upload-modal .modal-dialog {
        max-width: 30rem;
    }

    .plus-modal .modal-body,
    .upload-modal .modal-body {
        padding-inline: 1.75rem;
    }
}

@media (min-width: 992px) {
    .plus-modal .modal-dialog,
    .upload-modal .modal-dialog {
        max-width: 32rem;
    }
}

.app-modal__title-icon {
    color: var(--primary);
    vertical-align: -0.125em;
}

.app-modal__hero {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.app-modal__hero-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    font-size: 1.375rem;
}

.app-modal__hero-icon--upload,
.app-modal__hero-icon--waitlist {
    background: var(--primary-light);
    color: var(--primary);
}

.app-modal__hero-icon--plus {
    background: rgba(234, 179, 8, 0.15);
    color: #ca8a04;
}

.upload-modal__label i,
.plus-modal__label i {
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.upload-modal__file {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.upload-modal__file i {
    color: var(--text-muted);
    flex-shrink: 0;
}

.upload-modal__action,
.plus-modal__action,
.plus-modal__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.otp-flow__resend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.plus-modal__back {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.plus-modal__title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.upload-modal__title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* ─── Plus plan modal ─── */
.plus-modal .modal-content {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 1.25rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
}

.plus-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.plus-modal__lead {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.plus-modal__feature {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.375rem 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text);
}

.plus-modal__feature i {
    color: var(--success-text);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.plus-modal__full {
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #854d0e;
    font-size: 0.875rem;
    line-height: 1.6;
}

.plus-modal__panel--hidden {
    display: none !important;
}

.plus-modal__label {
    color: var(--text);
}

.plus-modal__input {
    text-align: center;
}

.plus-modal__back {
    color: var(--text-muted);
    text-decoration: none;
}

.plus-modal__back:hover {
    color: var(--text);
}

.plus-modal__error:not([hidden]) {
    display: block;
    font-size: 0.8125rem;
}

.plus-modal__success-icon {
    font-size: 2.5rem;
    color: var(--success-text);
    display: block;
    margin-bottom: 0.75rem;
}

.plus-modal__success-text {
    font-size: 1rem;
    color: var(--text);
}

/* ─── Upload verify modal ─── */
.upload-modal .modal-content {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 1.25rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
}

.upload-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.upload-modal__lead {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.upload-modal__label {
    color: var(--text);
}

.upload-modal__input {
    text-align: center;
}

.upload-modal__cancel {
    color: var(--text-muted);
    text-decoration: none;
}

.upload-modal__cancel:hover {
    color: var(--text);
}

.upload-modal__field-error {
    font-size: 0.8125rem;
}

.upload-modal__file:not([hidden]) {
    padding: 0.375rem 0.75rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    background: var(--surface-muted, #f1f5f9);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.upload-modal__file span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-modal__action[hidden],
.plus-modal__action[hidden] {
    display: none !important;
}

.otp-flow--unified .otp-flow__code {
    letter-spacing: 0.35em;
    font-size: 1.25rem;
    font-weight: 600;
}

.otp-flow__resend:not([hidden]) {
    display: inline-flex !important;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    min-height: auto;
    margin-top: 0.35rem;
    color: var(--bs-primary, #0d6efd);
}

.otp-flow__resend:disabled {
    opacity: 0.65;
    pointer-events: none;
}

/* ─── OTP verification ─── */
.otp-flow__row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.otp-flow__code {
    flex: 1;
    min-width: 0;
    letter-spacing: 0.15em;
    text-align: center;
}

.otp-flow__verify-btn {
    flex-shrink: 0;
    align-self: stretch;
}

.otp-flow__verify--hidden {
    display: none;
}

.otp-flow__error:not([hidden]),
.otp-flow__message:not([hidden]),
.otp-flow__resend:not([hidden]) {
    display: block;
}

.otp-flow__error {
    font-size: 0.8125rem;
}

.otp-flow__message,
.otp-flow__resend {
    font-size: 0.8125rem;
}

.landing-form__submit:disabled,
.landing-form__continue:disabled,
[data-upload-submit]:disabled,
[data-otp-action]:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ─── Processed invoices marquee ─── */
.processed-strip {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(100%, 28rem);
    margin: auto auto 0;
    padding: 0 1.25rem 1.25rem;
}

.processed-strip__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--landing-muted);
    text-align: center;
    margin: 0 0 0.75rem;
}

.processed-marquee {
    overflow: hidden;
    min-height: 10rem;
    border-radius: var(--radius-sm);
    direction: ltr;
    mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}

@keyframes marqueeScroll {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(calc(-1 * var(--marquee-shift, 50%)), 0, 0); }
}

.processed-marquee__track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: max-content;
    direction: ltr;
    will-change: transform;
    animation: marqueeScroll 36s linear infinite;
}

.processed-marquee--js .processed-marquee__track {
    animation: none;
}

.processed-marquee:hover .processed-marquee__track {
    animation-play-state: paused;
}

.processed-marquee__set {
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    align-items: flex-start;
    gap: 0.875rem;
    padding-inline-end: 0.875rem;
}

.processed-card {
    flex: 0 0 auto;
    width: 96px;
}

.processed-card__image {
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.processed-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.processed-card__time {
    display: block;
    font-size: 0.6875rem;
    color: var(--landing-muted);
    text-align: center;
    margin-top: 0.375rem;
}

/* ─── Static pages ─── */
.static-page {
    padding: 2rem;
    max-width: 640px;
    margin-inline: auto;
}

.static-page__contact a {
    color: var(--primary);
    text-decoration: none;
}

.static-page__contact a:hover {
    text-decoration: underline;
}

.admin-toolbar {
    border-color: var(--border-subtle, rgba(0, 0, 0, 0.08)) !important;
}

.admin-form-narrow {
    max-width: 420px;
}

@media (prefers-reduced-motion: reduce) {
    .upload-step[data-step="2"]:not(.upload-step--hidden) {
        animation: none;
    }

    .processed-marquee__track {
        animation: none;
    }

    .result-message--animated,
    .result-thinking__dots span,
    .result-typing-cursor {
        animation: none;
    }
}
