:root {
    --sp-navy: #213946;
    --sp-navy-2: #172b36;
    --sp-red: #C93B32;
    --sp-red-dark: #b5332b;
    --sp-teal: #1F5E64;
    --sp-aqua: #7dc8e0;
    --sp-mint: #7dd4c0;
    --sp-cream: #f7f6f4;
    --sp-cream-2: #eceae6;
    --sp-ink: #213946;
    --sp-muted: #7a8a92;
    --sp-faint: #a0a8ab;
    --sp-line: #e4e1dc;
    --sp-shadow: 0 8px 40px rgba(33, 57, 70, 0.08);
    --sp-shadow-strong: 0 18px 50px rgba(33, 57, 70, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    color: var(--sp-ink);
    background: var(--sp-cream);
    font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
    background:
        linear-gradient(rgba(247, 246, 244, 0.94), rgba(247, 246, 244, 0.97)),
        url('https://images.ctfassets.net/zkpxzicsuxng/33fDoON5bFMIwS2WlmPPXl/4c92ac6d7febed0d928cf513f0bc6b2b/TurfPavers.webp') center top / cover fixed;
}

a {
    color: var(--sp-red);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.18s ease;
}

a:hover {
    color: var(--sp-red-dark);
}

button,
.btn,
.form-control,
.form-select {
    font-family: inherit;
}

.min-vh-100 {
    background: transparent;
}

.content {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding-top: 2rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--sp-ink);
    font-weight: 900;
}

h1:focus {
    outline: none;
}

.section-title,
h2.fw-bold {
    margin-bottom: 1rem;
    color: var(--sp-ink);
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 900;
    letter-spacing: 0;
}

.text-muted {
    color: var(--sp-muted) !important;
}

.text-primary {
    color: var(--sp-red) !important;
}

.text-dark {
    color: var(--sp-ink) !important;
}

/* ========== HERO / BRAND ========== */
.portal-hero {
    position: relative;
    isolation: isolate;
    min-height: 250px;
    overflow: hidden;
    color: #fff;
    background: var(--sp-navy);
}

.portal-hero::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    height: 3px;
    background: var(--sp-red);
    content: "";
}

.portal-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(90deg, rgba(33, 57, 70, 0.98) 0%, rgba(33, 57, 70, 0.88) 46%, rgba(33, 57, 70, 0.42) 100%),
        url('https://images.ctfassets.net/zkpxzicsuxng/7I2qKxVanAWr9BOarZZzj6/ed7b20a2df2d3df8127889dbf3b05d69/herogallery.webp?w=1920&q=80&fm=webp') center / cover;
}

.portal-hero__content {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    min-height: 250px;
    margin: 0 auto;
    padding: 26px 2rem 34px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.portal-brand__mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
    background: var(--sp-red);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
    transform: rotate(45deg);
    text-indent: -1px;
    writing-mode: horizontal-tb;
    text-transform: uppercase;
    padding-top: 1px;
    box-shadow: 0 8px 20px rgba(201, 59, 50, 0.25);
    font-size: 0;
}

.portal-brand__mark::before {
    content: "SP";
    font-size: 15px;
    font-weight: 900;
    transform: rotate(-45deg);
}

.portal-brand__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.portal-brand__name {
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.portal-brand__tagline {
    color: rgba(255, 255, 255, 0.44);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.portal-hero__copy {
    max-width: 680px;
}

.portal-hero__eyebrow {
    margin: 0 0 12px;
    color: #f08078;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.portal-hero h1 {
    margin: 0 0 10px;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: 0;
}

.portal-hero p:last-child {
    max-width: 560px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
    line-height: 1.7;
}

/* ========== NAVBAR ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 58px;
    padding: 0 2rem !important;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--sp-navy) !important;
    box-shadow: 0 10px 28px rgba(33, 57, 70, 0.18) !important;
}

.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(201, 59, 50, 0.26);
}

.navbar-toggler-icon {
    filter: invert(1) grayscale(1) brightness(2);
}

.navbar-nav {
    gap: 4px;
}

.navbar-nav .nav-link {
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 0 14px !important;
    border-bottom: 2px solid transparent;
    color: rgba(255, 255, 255, 0.58) !important;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    border-bottom-color: var(--sp-red);
    color: #fff !important;
    background: rgba(255, 255, 255, 0.04);
}

.navbar label {
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.navbar .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.4' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    min-height: 36px;
    border-color: rgba(255, 255, 255, 0.12);
    background-color: rgba(255, 255, 255, 0.07);
    background-image: var(--bs-form-select-bg-img) !important;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    color: #fff;
    appearance: none;
    -webkit-appearance: none;
    font-size: 16px;
    font-weight: 900;
    padding-right: 2.25rem;
}

.navbar .form-select option {
    color: var(--sp-ink);
}

/* ========== BUTTONS ========== */
.btn {
    border-radius: 8px;
    font-weight: 900;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.btn-primary {
    border-color: var(--sp-red);
    background: var(--sp-red);
    color: #fff;
    box-shadow: 0 10px 22px rgba(201, 59, 50, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--sp-red-dark);
    background: var(--sp-red-dark);
    color: #fff;
}

.btn-primary:disabled {
    border-color: #d6d2cc;
    background: #d6d2cc;
    color: #fff;
    box-shadow: none;
}

.btn-success {
    border-color: var(--sp-teal);
    background: var(--sp-teal);
    color: #fff;
}

.btn-success:hover,
.btn-success:focus {
    border-color: #174950;
    background: #174950;
}

.btn-outline-primary,
.btn-outline-secondary {
    border-color: var(--sp-line);
    color: var(--sp-ink);
    background: #fff;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-check:checked + .btn-outline-primary {
    border-color: var(--sp-red);
    background: var(--sp-red);
    color: #fff;
}

.btn-link {
    color: var(--sp-red);
    font-weight: 900;
    text-transform: none;
    letter-spacing: 0;
}

.btn-link:hover {
    color: var(--sp-red-dark);
}

/* ========== CARDS / PANELS ========== */
.card {
    overflow-wrap: break-word;
    word-break: break-word;
    border: 1px solid var(--sp-line) !important;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--sp-shadow) !important;
}

.card-body {
    padding: 1.6rem;
}

.card-body.bg-light,
.card-body.bg-white {
    background: #fff !important;
}

.card-title,
.card-text {
    white-space: normal;
}

.list-group-item {
    border-color: var(--sp-line);
    color: var(--sp-ink);
}

.border,
.border-top,
.border-bottom {
    border-color: var(--sp-line) !important;
}

.rounded {
    border-radius: 10px !important;
}

.badge {
    font-weight: 900;
    letter-spacing: 0.5px;
}

.text-bg-light,
.bg-light {
    background-color: var(--sp-cream) !important;
    color: var(--sp-ink) !important;
}

.bg-success-subtle {
    background: rgba(31, 94, 100, 0.12) !important;
}

.border-success {
    border-color: rgba(31, 94, 100, 0.34) !important;
}

.bg-success {
    background: var(--sp-teal) !important;
}

.bg-secondary-subtle {
    background: #eceae6 !important;
}

.text-secondary {
    color: var(--sp-muted) !important;
}

.alert {
    border-radius: 10px;
    border-color: var(--sp-line);
    font-weight: 700;
}

.alert-info,
.alert-light {
    background: #fff;
    color: var(--sp-muted);
}

.alert-warning {
    border-color: rgba(201, 59, 50, 0.22);
    background: rgba(201, 59, 50, 0.08);
    color: var(--sp-ink);
}

.alert-danger {
    border-color: rgba(201, 59, 50, 0.32);
    background: rgba(201, 59, 50, 0.1);
    color: var(--sp-red-dark);
}

/* ========== FORMS ========== */
.form-control,
.form-select {
    min-height: 44px;
    border: 1px solid #d7d3cd;
    border-radius: 8px;
    background-color: #fff;
    color: var(--sp-ink);
    font-weight: 700;
}

.form-control::placeholder {
    color: #aeb5b8;
    font-weight: 400;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sp-red);
    box-shadow: 0 0 0 0.2rem rgba(201, 59, 50, 0.18);
}

label,
.form-label {
    color: var(--sp-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ========== TABLES ========== */
.table-responsive {
    margin-bottom: 1.5rem;
    border: 1px solid var(--sp-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--sp-shadow);
}

.table {
    margin-bottom: 0;
    color: var(--sp-ink);
}

.table > :not(caption) > * > * {
    padding: 1rem;
    border-bottom-color: var(--sp-line);
}

.table thead th,
.table-light th {
    background: var(--sp-cream) !important;
    color: var(--sp-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.table thead p {
    color: var(--sp-muted) !important;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.table-hover > tbody > tr:hover > * {
    background: rgba(201, 59, 50, 0.045);
}

/* ========== PROGRESS / LOADING ========== */
.progress {
    height: 12px;
    border-radius: 100px;
    background: var(--sp-cream-2);
}

.progress-bar {
    border-radius: 100px;
    background: var(--sp-red);
    transition: width 0.4s ease;
}

.spinner-border {
    color: var(--sp-red);
}

.spinner-border.text-primary {
    color: var(--sp-red) !important;
}

/* ========== LOGIN ========== */
.login-container {
    position: relative;
    height: auto !important;
    min-height: calc(100vh - 311px);
    padding: 2rem;
    overflow: hidden;
    background:
        linear-gradient(rgba(33, 57, 70, 0.92), rgba(33, 57, 70, 0.92)),
        url('https://images.ctfassets.net/zkpxzicsuxng/33fDoON5bFMIwS2WlmPPXl/4c92ac6d7febed0d928cf513f0bc6b2b/TurfPavers.webp') center / cover !important;
}

.login-card {
    width: min(420px, 100%);
    max-width: 420px;
    border-radius: 16px;
    border: 1px solid var(--sp-line) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22) !important;
}

.login-card img {
    width: 56px;
    height: 56px;
    padding: 8px;
    border-radius: 12px;
    background: var(--sp-red);
    object-fit: contain;
}

.login-card h3 {
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: 0;
}

.login-loading-overlay {
    z-index: 10;
    color: var(--sp-red);
}

.login-password-input::-ms-reveal,
.login-password-input::-ms-clear {
    display: none;
}

/* ========== MODALS ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1rem;
    overflow-y: auto;
    background: rgba(23, 43, 54, 0.66);
}

.modal-container {
    width: 95%;
    max-width: 900px;
    max-height: 95vh;
    margin: auto;
    overflow-y: auto;
    border: 1px solid var(--sp-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--sp-shadow-strong);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--sp-line);
}

.modal-header h5 {
    margin: 0;
    font-weight: 900;
}

.modal-close {
    border: none;
    background: none;
    color: var(--sp-muted);
    cursor: pointer;
    font-size: 1.75rem;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--sp-red);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--sp-line);
}

.form_header {
    padding-top: 10px;
    padding-bottom: 10px;
    background: var(--sp-navy);
    color: #fff;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.form_cell {
    padding: 15px;
}

.form_shadow {
    box-shadow: var(--sp-shadow);
}

.text-end {
    text-align: right;
}

.payment-modal .form-control {
    padding: 0;
    border: none;
    border-bottom: 1px solid #d7d3cd;
    border-radius: 0;
    box-shadow: none !important;
    font-size: 16px;
}

.payment-modal .form-control:focus {
    border-bottom-color: var(--sp-red);
    outline: none;
    box-shadow: none;
}

.payment-modal label {
    margin: 0 0 5px;
    color: var(--sp-muted);
    font-size: 11px;
    font-weight: 900;
}

.payment-confirmation-overlay {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(23, 43, 54, 0.66);
}

.payment-confirmation-dialog {
    width: min(480px, 100%);
    border: 1px solid var(--sp-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--sp-shadow-strong);
}

.payment-confirmation-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--sp-teal);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 900;
}

.payment-confirmation-message {
    margin-bottom: 0.75rem;
    text-align: center;
    font-size: 1rem;
}

.payment-confirmation-detail {
    margin-bottom: 0;
    text-align: center;
    color: var(--sp-muted);
    font-size: 0.9rem;
}

.modal,
.modal-backdrop {
    z-index: 1050;
}

.modal.fade.show {
    display: block;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.blazor-modal-backdrop {
    position: fixed;
    z-index: 1050;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: rgba(23, 43, 54, 0.66);
}

.blazor-modal {
    width: 100%;
    max-width: 600px;
    margin: auto;
    padding: 0;
    border-radius: 12px;
    background: #fff;
}

.blazor-modal .modal-content {
    padding: 20px;
}

/* ========== FOOTER / STATES ========== */
footer {
    margin-top: auto;
    border-top: 1px solid var(--sp-line) !important;
    background: #fff !important;
    color: var(--sp-muted);
    font-size: 0.875rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--sp-teal);
}

.invalid {
    outline: 1px solid var(--sp-red);
}

.validation-message {
    color: var(--sp-red);
}

.blazor-error-boundary {
    padding: 1rem 1rem 1rem 3.7rem;
    background: var(--sp-red-dark);
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

#components-reconnect-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(247, 246, 244, 0.9);
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

#components-reconnect-modal.components-reconnect-hide {
    display: none;
}

.reconnect-dialog {
    width: min(440px, 100%);
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--sp-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--sp-shadow-strong);
}

.reconnect-state {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .reconnect-state-show,
#components-reconnect-modal.components-reconnect-failed .reconnect-state-failed,
#components-reconnect-modal.components-reconnect-rejected .reconnect-state-rejected {
    display: block;
}

.step {
    min-width: 60px;
    padding: 0 10px;
}

.circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.connector {
    height: 2px;
    top: 18px;
    left: 36px;
}

#blazor-error-ui {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: none;
    width: 100%;
    padding: 0.6rem 1.25rem 0.7rem;
    background: lightyellow;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    cursor: pointer;
}

@media (max-width: 991.98px) {
    .navbar {
        padding: 0.65rem 1rem !important;
    }

    .navbar-collapse {
        padding: 0.75rem 0 1rem;
    }

    .navbar-nav .nav-link {
        min-height: 44px;
        border-bottom: 0;
        border-radius: 8px;
    }

    .navbar .d-flex.align-items-center.ms-3 {
        align-items: stretch !important;
        margin-left: 0 !important;
        margin-top: 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .navbar .form-select {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .content {
        padding: 1.5rem 1rem 0 !important;
    }

    .portal-hero {
        min-height: 300px;
    }

    .portal-hero__media {
        background:
            linear-gradient(rgba(33, 57, 70, 0.94), rgba(33, 57, 70, 0.78)),
            url('https://images.ctfassets.net/zkpxzicsuxng/7I2qKxVanAWr9BOarZZzj6/ed7b20a2df2d3df8127889dbf3b05d69/herogallery.webp?w=1200&q=80&fm=webp') center / cover;
    }

    .portal-hero__content {
        min-height: 300px;
        padding: 24px 1rem 32px;
    }

    .portal-brand__tagline {
        display: none;
    }

    .portal-hero p:last-child {
        font-size: 0.95rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .table > :not(caption) > * > * {
        padding: 0.8rem;
    }

    .login-container {
        min-height: calc(100vh - 303px);
        padding: 1rem;
    }
}
