﻿:root {
    --ig-navy: #14213d;
    --ig-navy-2: #1c2e54;
    --ig-gold: #c8a46a;
    --ig-gold-light: #e8d7b9;
    --ig-gold-dark: #a3814f;
    --ig-bg: #f8f5f0;
    --ig-surface: #ffffff;
    --ig-text: #232323;
    --ig-text-muted: #5b6472;
    --ig-border: #e4e1da;
    --ig-radius: 10px;
    --ig-font-heading: "Playfair Display", Georgia, "Iowan Old Style", "Palatino Linotype", serif;
    --ig-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    background: var(--ig-bg);
    color: var(--ig-text);
    font-family: var(--ig-font-body);
    font-size: 16px;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: var(--ig-font-heading);
    color: var(--ig-navy);
    line-height: 1.2;
    margin-top: 0;
}

a, .btn-link {
    color: var(--ig-navy);
}

a:hover {
    color: var(--ig-gold-dark);
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-block;
    border-radius: 999px;
    padding: 0.7rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    color: #fff;
    background-color: var(--ig-navy);
    border-color: var(--ig-navy);
}

    .btn-primary:hover {
        background-color: var(--ig-navy-2);
        border-color: var(--ig-navy-2);
        color: #fff;
    }

.btn-outline {
    color: var(--ig-navy);
    background-color: transparent;
    border-color: var(--ig-border);
}

    .btn-outline:hover {
        border-color: var(--ig-navy);
    }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--ig-gold);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Shared form field styling (request-quote form, admin pages) */
.quote-form__field {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

    .quote-form__field label {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--ig-navy);
        margin-bottom: 0.4rem;
    }

    .quote-form__field input,
    .quote-form__field select,
    .quote-form__field textarea {
        border: 1px solid var(--ig-border);
        border-radius: 6px;
        padding: 0.65rem 0.8rem;
        font-family: var(--ig-font-body);
        font-size: 0.95rem;
        color: var(--ig-text);
        background: var(--ig-bg);
    }

        .quote-form__field input:focus,
        .quote-form__field select:focus,
        .quote-form__field textarea:focus {
            outline: none;
            border-color: var(--ig-gold);
        }

/* Admin area */
.admin-section {
    padding: 3rem 0 4.5rem;
}

.admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-header__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-empty {
    color: var(--ig-text-muted);
}

.admin-table-wrap {
    background: var(--ig-surface);
    border: 1px solid var(--ig-border);
    border-radius: var(--ig-radius);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

    .admin-table th {
        text-align: left;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--ig-text-muted);
        padding: 0.9rem 1.25rem;
        border-bottom: 1px solid var(--ig-border);
    }

    .admin-table td {
        padding: 0.9rem 1.25rem;
        border-bottom: 1px solid var(--ig-border);
        vertical-align: top;
    }

    .admin-table tr:last-child td {
        border-bottom: none;
    }

.admin-client {
    font-weight: 600;
    color: var(--ig-navy);
}

.admin-client-email {
    font-size: 0.85rem;
    color: var(--ig-text-muted);
}

.admin-table-link {
    color: var(--ig-gold-dark);
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
}

    .admin-table-link:hover {
        text-decoration: underline;
    }

.status-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    text-transform: capitalize;
}

.status-badge--new {
    background: #eef2f8;
    color: var(--ig-navy);
}

.status-badge--quoted {
    background: #eaf6ee;
    color: #1e7a3c;
}

.status-badge--declined {
    background: #fbecec;
    color: #a32020;
}

.admin-back {
    display: inline-block;
    color: var(--ig-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

    .admin-back:hover {
        color: var(--ig-navy);
    }

.admin-detail-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.admin-detail-card {
    background: var(--ig-surface);
    border: 1px solid var(--ig-border);
    border-radius: var(--ig-radius);
    padding: 2rem;
}

    .admin-detail-card h1 {
        font-size: 1.75rem;
        margin-bottom: 1.25rem;
    }

    .admin-detail-card h2 {
        font-size: 1.35rem;
        margin-bottom: 1.25rem;
    }

    .admin-detail-card h3 {
        font-size: 1rem;
        margin: 1.5rem 0 0.6rem;
    }

.admin-detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1rem;
    margin: 0;
}

    .admin-detail-list dt {
        font-size: 0.8rem;
        color: var(--ig-text-muted);
    }

    .admin-detail-list dd {
        margin: 0;
        font-size: 0.9rem;
    }

.admin-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-feature-tag {
    font-size: 0.8rem;
    color: var(--ig-navy);
    background: var(--ig-bg);
    border: 1px solid var(--ig-border);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
}

.admin-details-text {
    color: var(--ig-text);
    white-space: pre-wrap;
    margin: 0;
}

.admin-saved {
    color: #1e7a3c;
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

.admin-error {
    color: #a32020;
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

.admin-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 780px) {
    .admin-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Shared page-shell / footer / error-banner styles, used by every layout
   (MainLayout, HomeLayout, and any future one). Kept global rather than in
   a per-layout .razor.css, since Blazor's CSS isolation scopes those styles
   to the one component that defines them, so a second layout using the
   same markup/classes would render completely unstyled otherwise. */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-main {
    flex: 1;
}

.app-footer {
    border-top: 1px solid var(--ig-border);
    background: var(--ig-surface);
}

.app-footer__inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 1.5rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 2rem;
    color: var(--ig-text-muted);
    font-size: 0.875rem;
}

.app-footer__brand strong {
    display: block;
    color: var(--ig-navy);
    font-family: var(--ig-font-heading);
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.app-footer__tag {
    font-style: italic;
}

.app-footer__links,
.app-footer__contact {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

    .app-footer__links a,
    .app-footer__contact a {
        color: var(--ig-text-muted);
        text-decoration: none;
    }

        .app-footer__links a:hover,
        .app-footer__contact a:hover {
            color: var(--ig-navy);
        }

.app-footer__bottom {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--ig-border);
    color: var(--ig-text-muted);
    font-size: 0.8rem;
}

@media (max-width: 720px) {
    .app-footer__inner {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem 1rem;
    }
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Scroll-reveal: elements fade/rise into view as they enter the viewport
   (see wwwroot/reveal.js). Staggered variants cascade cards in sequence. */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal--stagger-1.is-visible { transition-delay: 0.08s; }
.reveal--stagger-2.is-visible { transition-delay: 0.16s; }
.reveal--stagger-3.is-visible { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Mobile polish */
@media (max-width: 640px) {
    .quote-form__field input,
    .quote-form__field select,
    .quote-form__field textarea {
        font-size: 1rem;
    }

    .admin-header {
        flex-wrap: wrap;
    }
}

/* Admin analytics */
.an-subtle {
    color: var(--ig-text-muted);
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

.an-live {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0.6rem;
    color: var(--ig-navy);
    font-weight: 600;
}

.an-live__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2e8b57;
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.18);
}

.an-range {
    display: inline-flex;
    border: 1px solid var(--ig-border);
    border-radius: 999px;
    background: var(--ig-surface);
    padding: 3px;
    gap: 2px;
    flex-wrap: wrap;
}

.an-range__btn {
    border: 0;
    background: transparent;
    color: var(--ig-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
}

    .an-range__btn:hover {
        color: var(--ig-navy);
    }

    .an-range__btn.is-active {
        background: var(--ig-navy);
        color: #fff;
    }

.an-range--small .an-range__btn {
    font-size: 0.78rem;
    padding: 0.3rem 0.75rem;
}

.an-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.an-kpi {
    background: var(--ig-surface);
    border: 1px solid var(--ig-border);
    border-radius: var(--ig-radius);
    padding: 1rem 1.1rem;
}

.an-kpi__label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ig-text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.an-kpi__hint {
    display: inline-grid;
    place-items: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid var(--ig-border);
    font-size: 0.65rem;
    cursor: help;
}

.an-kpi__value {
    font-family: var(--ig-font-heading);
    font-size: 1.75rem;
    color: var(--ig-navy);
    margin-top: 0.2rem;
    line-height: 1.2;
}

.an-kpi__delta {
    font-size: 0.75rem;
    margin-top: 0.3rem;
    color: var(--ig-text-muted);
}

.an-kpi__delta--up span { color: #2e7d4f; }
.an-kpi__delta--down span { color: #b3412f; }

.an-card {
    background: var(--ig-surface);
    border: 1px solid var(--ig-border);
    border-radius: var(--ig-radius);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.25rem;
}

.an-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

    .an-card__head h2 {
        font-size: 1.1rem;
        margin: 0;
    }

.an-card--compact {
    margin-bottom: 0;
}

.an-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

/* Daily bar chart */
.an-chart {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 220px auto;
    column-gap: 0.6rem;
}

.an-chart__grid {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--ig-text-muted);
    text-align: right;
    line-height: 1;
    transform: translateY(-0.35em);
}

.an-chart__plot {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 2px;
    border-bottom: 1px solid var(--ig-border);
    background-image: linear-gradient(to bottom, var(--ig-border) 1px, transparent 1px);
    background-size: 100% 50%;
}

.an-chart__axis {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--ig-text-muted);
    padding-top: 0.4rem;
}

.an-col {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    outline: none;
}

.an-bar {
    width: 100%;
    max-width: 28px;
    margin: 0 auto;
    background: var(--ig-navy);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
}

    .an-bar.is-zero {
        background: var(--ig-border);
    }

.an-col:hover .an-bar,
.an-col:focus-visible .an-bar {
    background: var(--ig-gold-dark);
}

.an-tip {
    display: none;
    position: absolute;
    bottom: calc(100% - 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    background: var(--ig-navy);
    color: #fff;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-size: 0.78rem;
    white-space: nowrap;
    pointer-events: none;
    flex-direction: column;
    gap: 0.1rem;
    box-shadow: 0 6px 18px rgba(20, 33, 61, 0.2);
}

    .an-tip.is-left { left: 0; transform: none; }
    .an-tip.is-right { left: auto; right: 0; transform: none; }

.an-col:hover .an-tip,
.an-col:focus-visible .an-tip {
    display: flex;
}

.an-table-toggle {
    margin-top: 1rem;
}

    .an-table-toggle summary {
        cursor: pointer;
        font-size: 0.85rem;
        color: var(--ig-gold-dark);
        font-weight: 600;
        margin-bottom: 0.75rem;
    }

/* Lists with meters */
.an-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.an-list__text,
.an-funnel__label {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.an-list__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ig-text);
}

.an-list__count,
.an-funnel__count {
    color: var(--ig-navy);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.an-meter {
    height: 6px;
    border-radius: 999px;
    background: var(--ig-bg);
    overflow: hidden;
}

.an-meter__fill {
    height: 100%;
    border-radius: 999px;
    background: var(--ig-navy);
}

.an-funnel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

    .an-funnel .an-subtle {
        margin-left: 0.4rem;
        font-weight: 400;
    }

.an-note {
    font-size: 0.78rem;
    color: var(--ig-text-muted);
    margin: 1rem 0 0;
}

@media (max-width: 640px) {
    .an-chart { grid-template-rows: 170px auto; }
    .an-card { padding: 1rem; }
    .an-kpis { grid-template-columns: repeat(2, 1fr); }
    .an-grid { grid-template-columns: 1fr; }
}
