:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #0f172a;
    --muted: #607089;
    --line: #d7deea;
    --line-soft: #e8edf5;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --green: #078855;
    --red: #c7352f;
    --yellow: #946200;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
    --shadow-soft: 0 4px 14px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
}

a {
    color: var(--blue);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--blue-dark);
}

.app-header {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 14px 28px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    font-size: 18px;
    font-weight: 800;
    gap: 10px;
    letter-spacing: 0;
    text-decoration: none;
}

.brand-mark {
    align-items: center;
    background: #111827;
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-size: 16px;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.app-header nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.user-pill,
.nav-link {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    min-height: 36px;
    padding: 8px 12px;
}

.user-pill {
    background: #eef2ff;
    color: #334155;
    font-weight: 700;
}

.nav-link {
    border: 1px solid var(--line);
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.nav-link:hover {
    background: var(--surface-soft);
    color: var(--blue);
}

.container {
    margin: 0 auto;
    max-width: 1200px;
    padding: 42px 24px 60px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    padding: 28px;
}

.auth-card {
    margin: 46px auto;
    max-width: 560px;
}

.proof-form-card {
    padding: 0;
    overflow: hidden;
}

.proof-new-hero {
    margin-bottom: 28px;
}

.form-card-header {
    align-items: center;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 24px 28px;
}

.section-kicker {
    color: var(--blue);
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.proof-form-layout {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr) 300px;
    padding: 28px;
}

.proof-form-main {
    display: grid;
    gap: 20px;
}

.form-section {
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 22px;
}

.form-section-title {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.form-section-title h3,
.proof-form-aside h3 {
    font-size: 20px;
    margin: 0 0 4px;
}

.optional-label {
    background: #eef2ff;
    border-radius: 999px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 8px;
    vertical-align: middle;
}

.form-section-title p {
    margin: 0;
}

.step-mark {
    align-items: center;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: var(--blue-dark);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.proof-form-aside {
    align-self: start;
    background: #101827;
    border-radius: 8px;
    color: #fff;
    padding: 22px;
}

.proof-form-aside .section-kicker {
    color: #93c5fd;
}

.proof-form-aside h3 {
    color: #fff;
}

.proof-form-aside ul {
    display: grid;
    gap: 12px;
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
}

.proof-form-aside li {
    color: #dbe4f0;
    line-height: 1.45;
    padding-left: 24px;
    position: relative;
}

.proof-form-aside li::before {
    background: #22c55e;
    border-radius: 999px;
    content: "";
    height: 8px;
    left: 2px;
    position: absolute;
    top: 8px;
    width: 8px;
}

.checkbox-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-card {
    align-items: flex-start;
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 14px;
}

.checkbox-card:hover {
    border-color: #bfdbfe;
}

.checkbox-card input {
    flex: 0 0 auto;
    margin-top: 3px;
    min-height: auto;
    width: auto;
}

.checkbox-card span {
    margin: 0;
}

.checkbox-card strong,
.checkbox-card small {
    display: block;
}

.checkbox-card small {
    color: var(--muted);
    font-weight: 700;
    margin-top: 3px;
}

.small-note {
    font-size: 14px;
    margin-top: 6px;
}

.form-footer-actions {
    background: var(--surface-soft);
    border-top: 1px solid var(--line-soft);
    justify-content: flex-end;
    margin-top: 0;
    padding: 20px 28px;
}

.hero {
    align-items: center;
    display: flex;
    gap: 22px;
    justify-content: space-between;
    margin-bottom: 22px;
}

.hero h1 {
    font-size: 38px;
    line-height: 1.12;
    margin-bottom: 8px;
}

h1,
h2 {
    color: var(--text);
    letter-spacing: 0;
    margin: 0 0 12px;
}

h2 {
    font-size: 25px;
}

p {
    line-height: 1.45;
}

.muted {
    color: var(--muted);
}

.stats-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 20px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    padding: 18px 20px;
}

.stat-card span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    font-size: 34px;
    line-height: 1;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: block;
    font-weight: 800;
    margin-bottom: 16px;
}

label span {
    display: block;
    margin-bottom: 8px;
}

input,
textarea,
select {
    background: #fff;
    border: 1px solid #b8c3d4;
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    min-height: 46px;
    outline: none;
    padding: 11px 13px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
    width: 100%;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

textarea {
    min-height: 124px;
    resize: vertical;
}

.button,
button {
    background: var(--blue);
    border: 1px solid var(--blue);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    line-height: 1.2;
    min-height: 44px;
    padding: 12px 16px;
    text-align: center;
    text-decoration: none;
    transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.button:hover,
button:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    box-shadow: 0 10px 22px rgba(29, 78, 216, 0.22);
    color: #fff;
    transform: translateY(-1px);
}

.button-secondary {
    background: #fff;
    box-shadow: none;
    color: var(--blue);
}

.button-secondary:hover {
    background: #eff6ff;
    color: var(--blue-dark);
}

.button-danger {
    background: var(--red);
    border-color: var(--red);
    box-shadow: 0 8px 18px rgba(199, 53, 47, 0.16);
}

.button-danger:hover {
    background: #a92722;
    border-color: #a92722;
}

.button-small {
    min-height: 40px;
    padding: 10px 13px;
}

button:disabled,
.button.is-disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.status {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 10px;
    white-space: nowrap;
}

.status-pending_review {
    background: #fff3c4;
    color: var(--yellow);
}

.status-approved {
    background: #dcfce7;
    color: var(--green);
}

.status-changes_requested {
    background: #fee2e2;
    color: var(--red);
}

.table {
    border-collapse: collapse;
    width: 100%;
}

.table th,
.table td {
    border-bottom: 1px solid var(--line-soft);
    padding: 16px 12px;
    text-align: left;
    vertical-align: middle;
}

.table th {
    color: #334155;
    font-size: 13px;
    text-transform: uppercase;
}

.table tbody tr {
    transition: background 140ms ease;
}

.table tbody tr:hover {
    background: #f8fbff;
}

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

.row-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.row-actions form {
    margin: 0;
}

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

.auth-actions {
    justify-content: space-between;
}

.hero .actions {
    justify-content: flex-end;
    margin-top: 0;
}

.flash {
    border-radius: 8px;
    border: 1px solid transparent;
    margin-bottom: 18px;
    padding: 14px 16px;
}

.flash-success {
    background: #e8f8ef;
    border-color: #b7ebcb;
    color: var(--green);
}

.flash-error {
    background: #fdeceb;
    border-color: #f7c0bd;
    color: var(--red);
}

.page-loader {
    align-items: center;
    background: rgba(15, 23, 42, 0.36);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    padding: 20px;
    pointer-events: none;
    position: fixed;
    transition: opacity 160ms ease;
    z-index: 100;
}

.page-loader.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.loader-box {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: var(--text);
    display: grid;
    justify-items: center;
    max-width: 320px;
    padding: 24px;
    text-align: center;
    width: 100%;
}

.loader-box strong {
    font-size: 18px;
    margin-top: 14px;
}

.loader-box small {
    color: var(--muted);
    display: block;
    line-height: 1.4;
    margin-top: 6px;
}

.loader-spinner {
    animation: loader-spin 780ms linear infinite;
    border: 4px solid #dbeafe;
    border-radius: 999px;
    border-top-color: var(--blue);
    display: block;
    height: 42px;
    width: 42px;
}

@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}

.hp-field {
    height: 1px;
    left: -10000px;
    overflow: hidden;
    position: absolute;
    top: auto;
    width: 1px;
}

.review-frame {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 650px;
    width: 100%;
}

.timeline {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.timeline-item {
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    padding: 18px 20px;
}

.timeline-item p {
    margin: 0 0 12px;
}

.timeline-item p:last-child {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .proof-form-layout {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .app-header,
    .hero {
        align-items: stretch;
        flex-direction: column;
    }

    .app-header nav {
        justify-content: flex-start;
    }

    .container {
        padding: 28px 14px 42px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
    }

    .proof-form-card {
        padding: 0;
    }

    .form-card-header,
    .form-footer-actions {
        align-items: stretch;
        flex-direction: column;
        padding: 20px;
    }

    .proof-form-layout {
        padding: 20px;
    }

    .form-section {
        padding: 18px;
    }

    .table {
        min-width: 720px;
    }

    .card:has(.table) {
        overflow-x: auto;
    }

    .actions,
    .hero .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .button,
    button {
        width: 100%;
    }
}
