:root {
    color-scheme: light;
    --ink: #172238;
    --muted: #667085;
    --line: #e4e8ef;
    --surface: #ffffff;
    --canvas: #f5f7fb;
    --navy: #102a56;
    --blue: #2458d3;
    --blue-dark: #1946b4;
    --blue-soft: #eaf0ff;
    --green: #12805c;
    --gold: #c17a16;
    --danger: #b42318;
    --radius: 16px;
    --shadow: 0 18px 45px rgba(16, 42, 86, 0.1);
    font-family: Inter, Aptos, "Segoe UI", sans-serif;
}

.button-danger {
    background: #a72b34;
    color: white;
}

.button-small {
    min-height: 34px;
    padding: 0.35rem 0.75rem;
}

.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

* {
    box-sizing: border-box;
}

.table-edit-row td {
    background: #f7f9fd;
    white-space: normal;
}

.inline-edit-form {
    align-items: end;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(180px, 1.2fr) minmax(170px, 1fr) minmax(130px, 0.6fr) auto;
}

.inline-edit-actions,
.form-actions {
    display: flex;
    gap: 0.65rem;
}

.role-management-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: 300px minmax(0, 1fr);
}

.role-list {
    display: grid;
    gap: 0.4rem;
}

.role-form > .field {
    max-width: 360px;
}

.role-list-item {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    display: flex;
    gap: 0.65rem;
    justify-content: space-between;
    padding: 0.6rem 0.7rem;
    text-decoration: none;
}

.role-list-item.selected {
    background: #eef3ff;
    border-color: var(--blue);
}

.role-list-item span:first-child,
.permission-option span,
.permission-readonly-grid span {
    display: grid;
    gap: 0.2rem;
}

.role-list-item small,
.permission-option small,
.permission-readonly-grid small {
    color: var(--muted);
}

.role-form,
.permission-fieldset {
    display: grid;
    gap: 0.65rem;
}

.permission-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.permission-fieldset legend {
    font-weight: 750;
    margin-bottom: 0.45rem;
}

.permission-option {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    gap: 0.6rem;
    padding: 0.6rem 0.7rem;
}

.permission-readonly-grid {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.permission-readonly-grid span {
    background: var(--canvas);
    border-radius: 10px;
    padding: 0.7rem;
}

.danger-zone {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
}

.danger-zone p {
    margin: 0.25rem 0 0;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--canvas);
    color: var(--ink);
}

body {
    min-width: 320px;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    letter-spacing: -0.045em;
    line-height: 1.05;
}

h2 {
    letter-spacing: -0.025em;
}

p {
    color: var(--muted);
    line-height: 1.65;
}

.eyebrow {
    color: var(--blue);
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.brand-mark {
    align-items: center;
    background: linear-gradient(145deg, #3268e6, #173f9d);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(36, 88, 211, 0.28);
    color: white;
    display: inline-flex;
    font-size: 1.05rem;
    font-weight: 900;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.brand-lockup {
    align-items: center;
    display: flex;
    font-weight: 800;
    gap: 0.8rem;
}

.button {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 750;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 1.1rem;
    text-decoration: none;
    transition: background 150ms ease, border 150ms ease, transform 150ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--blue);
    color: white;
}

.button-primary:hover {
    background: var(--blue-dark);
}

.button-secondary {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
}

.button-link {
    background: transparent;
    color: var(--blue);
    padding-inline: 0;
}

.button-block {
    width: 100%;
}

.landing-page {
    background: radial-gradient(circle at 75% 35%, #e3ecff 0, transparent 28%), var(--surface);
    min-height: 100vh;
    padding: 0 clamp(1.25rem, 5vw, 5rem);
}

.landing-nav {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: auto;
    max-width: 1280px;
    padding: 1.5rem 0;
}

.landing-hero {
    align-items: center;
    display: grid;
    gap: clamp(3rem, 8vw, 8rem);
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
    margin: auto;
    max-width: 1180px;
    min-height: calc(100vh - 100px);
    padding: 4rem 0 7rem;
}

.landing-hero h1 {
    max-width: 760px;
}

.landing-hero p {
    font-size: 1.08rem;
    max-width: 650px;
}

.hero-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.hero-actions span {
    color: var(--muted);
    font-size: 0.9rem;
}

.hero-visual {
    background: linear-gradient(145deg, #153d91, #071a3d);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(9, 31, 73, 0.25);
    min-height: 390px;
    padding: 3rem;
    position: relative;
}

.visual-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.4rem;
}

.visual-card span {
    color: var(--muted);
    font-size: 0.8rem;
}

.visual-card-main {
    margin-top: 3rem;
    min-height: 190px;
}

.visual-card-float {
    bottom: 2rem;
    position: absolute;
    right: -1.5rem;
    width: 220px;
}

.visual-lines {
    display: grid;
    gap: 0.7rem;
    margin-top: 1.5rem;
}

.visual-lines i {
    background: #e5eaf3;
    border-radius: 5px;
    height: 10px;
}

.visual-lines i:nth-child(2) {
    width: 76%;
}

.visual-lines i:nth-child(3) {
    width: 52%;
}

.auth-page {
    background: var(--surface);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
    min-height: 100vh;
}

.auth-brand-panel {
    background: radial-gradient(circle at 70% 20%, #315fb9, transparent 32%), linear-gradient(150deg, #102a56, #07162f);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 7vw, 6.5rem);
}

.auth-brand-panel h1 {
    max-width: 720px;
}

.auth-brand-panel p,
.auth-brand-panel small {
    color: #c8d5ec;
    max-width: 620px;
}

.auth-brand-panel .eyebrow {
    color: #9dbdff;
}

.auth-form-panel {
    align-items: center;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 460px;
    padding: clamp(1.5rem, 4vw, 2.75rem);
    width: 100%;
}

.auth-card-flat {
    border: 0;
    box-shadow: none;
}

.auth-card .brand-mark {
    margin-bottom: 2rem;
}

.auth-page-centered {
    align-items: center;
    background: radial-gradient(circle at 50% 0, #e7eeff, transparent 36%), var(--canvas);
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.stacked-form,
.field-grid {
    display: grid;
    gap: 1.2rem;
}

.stacked-form {
    margin-top: 2rem;
}

.field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.field-wide {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    font-size: 0.88rem;
    font-weight: 750;
    margin-bottom: 0.45rem;
}

.field input {
    background: white;
    border: 1px solid #cfd5df;
    border-radius: 10px;
    color: var(--ink);
    min-height: 46px;
    outline: none;
    padding: 0.7rem 0.85rem;
    transition: border 150ms ease, box-shadow 150ms ease;
    width: 100%;
}

.field input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36, 88, 211, 0.12);
}

.field small {
    color: var(--muted);
    display: block;
    margin-top: 0.4rem;
}

.validation-message {
    color: var(--danger);
    display: block;
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.invalid {
    border-color: var(--danger) !important;
}

.alert {
    border-radius: 10px;
    font-size: 0.9rem;
    margin: 1rem 0;
    padding: 0.85rem 1rem;
}

.alert-error {
    background: #fff0ee;
    color: var(--danger);
}

.alert-success {
    background: #eaf8f2;
    color: #08704d;
}

.company-picker {
    max-width: 580px;
}

.company-list {
    display: grid;
    gap: 0.75rem;
    margin: 2rem 0 1rem;
}

.company-option {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    cursor: pointer;
    display: grid;
    gap: 1rem;
    grid-template-columns: auto 1fr auto;
    padding: 1rem;
    text-align: left;
    width: 100%;
}

.company-option:hover {
    background: var(--blue-soft);
    border-color: #b8c9f5;
}

.company-option small {
    color: var(--muted);
    display: block;
    margin-top: 0.2rem;
}

.company-avatar,
.user-avatar {
    align-items: center;
    background: var(--blue-soft);
    border-radius: 10px;
    color: var(--blue);
    display: inline-flex;
    font-weight: 850;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.page-shell,
.workspace-content {
    margin: 0 auto;
    max-width: 1240px;
    width: 100%;
}

.workspace-content {
    font-size: 0.85rem;
    margin: 0;
    max-width: 1120px;
}

.workspace-content .button {
    border-radius: 7px;
    font-size: 0.78rem;
    min-height: 34px;
    padding: 0.4rem 0.75rem;
}

.workspace-content .field label {
    font-size: 0.76rem;
    margin-bottom: 0.3rem;
}

.workspace-content .field input,
.workspace-content .field select {
    border-radius: 7px;
    font-size: 0.82rem;
    min-height: 36px;
    padding: 0.45rem 0.6rem;
    width: 100%;
}

.workspace-content .field-grid {
    grid-template-columns: repeat(2, minmax(220px, 360px));
    justify-content: start;
}

.workspace-content .invitation-link-result {
    max-width: 730px;
}

.workspace-content .insurer-management-grid .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.insurer-management-grid .role-list-item strong {
    overflow-wrap: anywhere;
}

.customer-modal {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    font-size: 0.82rem;
    margin: auto;
    max-height: calc(100dvh - 2rem);
    max-width: 920px;
    overflow-y: auto;
    padding: 1rem;
    width: calc(100% - 2rem);
}

.customer-modal::backdrop {
    background: rgba(7, 22, 47, 0.55);
}

.customer-modal-header {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
}

.customer-modal h2 {
    font-size: 1.05rem;
    margin: 0;
}

.customer-modal h3 {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.customer-form fieldset {
    border: 1px solid var(--line);
    border-radius: 7px;
    margin: 0 0 0.8rem;
    min-width: 0;
    padding: 0.65rem;
}

.customer-form legend {
    font-size: 0.8rem;
    font-weight: 750;
    padding: 0 0.3rem;
}

.customer-field-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-form .field select {
    background: white;
    border: 1px solid #cfd5df;
    color: var(--ink);
}

.customer-form p,
.customer-file-list {
    font-size: 0.76rem;
}

.customer-file-list {
    list-style: none;
    margin: 0.65rem 0;
    padding: 0;
}

.customer-file-list li {
    align-items: center;
    display: flex;
    gap: 0.7rem;
    justify-content: space-between;
    padding: 0.35rem 0;
}

.customer-file-list a {
    overflow-wrap: anywhere;
}

.customer-file-list label,
.customer-file-list small {
    flex-shrink: 0;
}

.customer-photo {
    border-radius: 7px;
    height: 96px;
    margin-bottom: 0.8rem;
    object-fit: cover;
    width: 96px;
}

.customer-profile-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vehicle-rc-photo {
    border-radius: 7px;
    display: block;
    max-height: 280px;
    max-width: 100%;
    object-fit: contain;
}

.customer-details {
    margin: 0 0 0.7rem;
}

.customer-details div {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 110px minmax(0, 1fr);
    padding: 0.2rem 0;
}

.customer-details dt {
    color: var(--muted);
}

.customer-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    .customer-field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 460px) {
    .customer-field-grid {
        grid-template-columns: 1fr;
    }
}

.page-shell {
    padding: clamp(1.5rem, 4vw, 4rem);
}

.page-heading {
    margin-bottom: 2rem;
}

.workspace-content .page-heading {
    margin-bottom: 1rem;
}

.page-heading h1 {
    font-size: clamp(2rem, 4vw, 2.85rem);
    margin-bottom: 0.65rem;
}

.workspace-content .page-heading h1 {
    font-size: 1.55rem;
    margin-bottom: 0.3rem;
}

.workspace-content .page-heading p {
    font-size: 0.82rem;
}

.workspace-content .eyebrow {
    font-size: 0.67rem;
}

.page-heading p {
    margin-bottom: 0;
}

.split-heading,
.section-heading,
.getting-started {
    align-items: center;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
}

.form-card,
.content-card,
.metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 25px rgba(16, 42, 86, 0.055);
}

.form-card,
.content-card {
    padding: clamp(1.25rem, 3vw, 2rem);
}

.workspace-content .form-card,
.workspace-content .content-card {
    border-radius: 10px;
    padding: 1rem;
}

.admin-page .form-card {
    max-width: 760px;
}

.workspace-content .metric-grid {
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.metric-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.workspace-content .metric-card {
    border-radius: 10px;
    gap: 0.25rem;
    padding: 1rem;
}

.metric-card {
    border-top: 4px solid var(--blue);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.5rem;
}

.metric-card > span,
.metric-card small {
    color: var(--muted);
}

.metric-card strong {
    font-size: 2.2rem;
}

.workspace-content .metric-card strong {
    font-size: 1.55rem;
}

.metric-card.accent-gold {
    border-top-color: var(--gold);
}

.workspace-content .section-heading {
    gap: 0.8rem;
    margin-bottom: 0.7rem;
    padding-bottom: 0.7rem;
}

.metric-card.accent-green {
    border-top-color: var(--green);
}

.getting-started,
.permissions-card {
    margin-top: 1.5rem;
}

.getting-started p,
.section-heading p {
    margin-bottom: 0;
}

.muted {
    color: var(--muted);
}

.section-heading {
    border-bottom: 1px solid var(--line);
    margin: -0.25rem -0.25rem 1rem;
    padding: 0.25rem 0.25rem 1rem;
}

.section-heading h2 {
    margin-bottom: 0.3rem;
}

.workspace-content .section-heading h2,
.workspace-content .content-card h2 {
    font-size: 1rem;
}

.workspace-content .section-heading p {
    font-size: 0.76rem;
}

.responsive-table {
    overflow-x: auto;
}

.workspace-content th,
.workspace-content td {
    padding: 0.65rem 0.75rem;
}

.workspace-content td {
    font-size: 0.8rem;
}

table {
    border-collapse: collapse;
    width: 100%;
}

.workspace-content .status-pill,
.workspace-content .permission-tags span {
    font-size: 0.68rem;
    padding: 0.25rem 0.55rem;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 1rem;
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.status-pill,
.permission-tags span {
    background: #f0f2f6;
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
}

.status-active {
    background: #e8f7f1;
    color: var(--green);
}

.permissions-card {
    align-items: center;
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
}

.invitation-card {
    margin-bottom: 1.5rem;
    scroll-margin-top: 1.5rem;
}

.invitation-form {
    margin-bottom: 0;
}

.invitation-link-result {
    display: grid;
    gap: 0.45rem;
}

.invitation-link-result input {
    background: white;
    border: 1px solid #a8d9c7;
    border-radius: 8px;
    color: var(--ink);
    padding: 0.7rem;
    width: 100%;
}

.setup-card {
    max-width: 560px;
}

.setup-card h1 {
    font-size: clamp(2rem, 5vw, 2.8rem);
}

.invitation-details {
    background: var(--canvas);
    border-radius: 10px;
    display: grid;
    gap: 0.8rem;
    margin: 1.5rem 0;
    padding: 1rem;
}

.invitation-details div {
    display: grid;
    gap: 0.2rem;
}

.invitation-details dt {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.invitation-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.permission-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.blazor-error-boundary {
    background: #b42318;
    color: white;
    padding: 1rem;
}

@media (max-width: 850px) {
    .auth-page,
    .landing-hero {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        min-height: 45vh;
        padding: 2rem;
    }

    .auth-brand-panel small {
        display: none;
    }

    .landing-hero {
        padding-top: 2rem;
    }

    .hero-visual {
        min-height: 330px;
    }

    .visual-card-float {
        right: 1rem;
    }

    .metric-grid,
    .permissions-card,
    .role-management-grid {
        grid-template-columns: 1fr;
    }

    .workspace-content .field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inline-edit-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .landing-nav .brand-lockup span,
    .workspace-brand small {
        display: none;
    }

    .landing-page {
        padding-inline: 1rem;
    }

    .hero-visual {
        padding: 1.5rem;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: auto;
    }

    .split-heading,
    .getting-started,
    .danger-zone {
        align-items: flex-start;
        flex-direction: column;
    }

    .inline-edit-form,
    .permission-readonly-grid {
        grid-template-columns: 1fr;
    }

    .workspace-content .insurer-management-grid .field-grid {
        grid-template-columns: 1fr;
    }
}
