/* ==========================================================================
   GEV Biz — Global Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Bitwarden Popup Invisibility — Investigation Notes (T-XX)
   --------------------------------------------------------------------------
   ISSUE: Bitwarden browser extension popup appears invisible but blocks
   clicks on gev-biz pages, while working normally on other sites.

   INVESTIGATED (static CSS analysis):
   1. .bg-animation .line elements use `will-change: transform` and
      `filter: blur(2px)` — these create new stacking contexts that can
      trap child elements (including extension-injected iframes).
   2. .public-content has `position: relative; z-index: 1` which creates
      a stacking context that may clip Bitwarden's injected iframe.
   3. .admin-sidebar has `position: fixed; z-index: 1040` — creates a
      stacking context on admin pages.
   4. No overly broad `iframe { display: none }` rules were found.
   5. Modal z-index overrides (.modal z-index: 1055, .modal-backdrop: 1050)
      are present but should not affect extension popups.

   LIKELY ROOT CAUSE: The `will-change: transform` on .bg-animation .line
   elements and the `filter: blur(2px)` both create stacking contexts.
   Combined with the `position: relative; z-index: 1` on .public-content,
   Bitwarden's popup (which is injected into the page DOM) may be rendered
   behind these stacking contexts.

   FIX APPLIED: Removed `will-change: transform` from .bg-animation .line
   (the animation still works without it; the hint was a premature
   optimisation). The `filter: blur()` is necessary for the visual effect
   so it is kept, but its parent .bg-animation already has
   `pointer-events: none` and `z-index: 0`, so extension iframes injected
   outside .bg-animation should not be affected.

   NOTE: If the issue persists, a live browser debug session is needed to
   inspect the exact Bitwarden iframe selector and its computed stacking
   context. This investigation is deferred for that scenario.
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Brand Color Palette)
   -------------------------------------------------------------------------- */
:root {
    --primary: #249ca9;
    --primary-dark: #1d7f8a;
    --secondary: #184377;
    --secondary-dark: #102e54;
    --light-bg: #f0f7f8;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --admin-sidebar-width: 260px;
    --admin-main-bg: #f4f6f9;
}

/* --------------------------------------------------------------------------
   Base / Reset
   -------------------------------------------------------------------------- */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Animated Background (Public Layout)
   -------------------------------------------------------------------------- */
body.public-body {
    background: linear-gradient(to bottom, var(--light-bg), #ffffff);
}

.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-animation .line {
    position: absolute;
    bottom: -100%;
    width: 4px;
    height: 70vh;
    background: rgba(36, 156, 169, 1);
    filter: blur(2px);
    animation: riseUp linear infinite;
    opacity: 0;
}

@keyframes riseUp {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    15% {
        opacity: 0.12;
    }
    30% {
        opacity: 0.22;
    }
    50% {
        opacity: 0.18;
    }
    70% {
        opacity: 0.12;
    }
    85% {
        opacity: 0.06;
    }
    100% {
        transform: translateY(-220vh);
        opacity: 0;
    }
}

.bg-animation .line-1 {
    left: 8%;
    width: 2px;
    height: 65vh;
    animation-duration: 18s;
    animation-delay: 0s;
}

.bg-animation .line-2 {
    left: 18%;
    width: 1px;
    height: 75vh;
    animation-duration: 24s;
    animation-delay: 3s;
}

.bg-animation .line-3 {
    left: 28%;
    width: 3px;
    height: 60vh;
    animation-duration: 20s;
    animation-delay: 7s;
}

.bg-animation .line-4 {
    left: 36%;
    width: 2px;
    height: 70vh;
    animation-duration: 27s;
    animation-delay: 2s;
}

.bg-animation .line-5 {
    left: 45%;
    width: 1px;
    height: 80vh;
    animation-duration: 22s;
    animation-delay: 10s;
}

.bg-animation .line-6 {
    left: 55%;
    width: 2px;
    height: 65vh;
    animation-duration: 16s;
    animation-delay: 5s;
}

.bg-animation .line-7 {
    left: 64%;
    width: 3px;
    height: 72vh;
    animation-duration: 28s;
    animation-delay: 12s;
}

.bg-animation .line-8 {
    left: 73%;
    width: 1px;
    height: 68vh;
    animation-duration: 19s;
    animation-delay: 8s;
}

.bg-animation .line-9 {
    left: 82%;
    width: 2px;
    height: 76vh;
    animation-duration: 25s;
    animation-delay: 15s;
}

.bg-animation .line-10 {
    left: 91%;
    width: 1px;
    height: 62vh;
    animation-duration: 30s;
    animation-delay: 18s;
}

/* --------------------------------------------------------------------------
   Public Layout
   -------------------------------------------------------------------------- */
.public-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.public-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary);
}

.public-navbar .navbar-brand:hover {
    color: var(--primary-dark);
}

.public-navbar .nav-link {
    color: var(--text);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
}

.public-navbar .nav-link:hover {
    color: var(--primary);
}

.public-main {
    flex: 1;
    padding: 2rem 1rem;
}

.public-footer {
    text-align: center;
    padding: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Welcome Card
   -------------------------------------------------------------------------- */
.welcome-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.welcome-card {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(24, 67, 119, 0.12);
    max-width: 500px;
    width: 100%;
    padding: 2.5rem;
    text-align: center;
}

.welcome-card .welcome-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.welcome-card .welcome-subtitle {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 1.25rem;
}

.welcome-card .welcome-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.welcome-card .welcome-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.welcome-card .welcome-actions .btn {
    min-width: 140px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
}

@media (max-width: 576px) {
    .welcome-card {
        padding: 1.75rem 1.25rem;
        margin: 0 0.5rem;
        border-radius: 12px;
    }

    .welcome-card .welcome-title {
        font-size: 2rem;
    }

    .welcome-card .welcome-actions .btn {
        flex: 1 1 100%;
    }
}

/* --------------------------------------------------------------------------
   Admin Layout — Sidebar
   -------------------------------------------------------------------------- */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--admin-sidebar-width);
    background-color: var(--secondary);
    color: #ffffff;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.admin-sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.admin-sidebar-header .sidebar-brand {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: block;
}

.admin-sidebar-header .sidebar-brand:hover {
    color: var(--primary);
}

.admin-sidebar-nav {
    padding: 0.75rem 0;
    flex: 1;
}

.sidebar-nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.6rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    border-radius: 6px;
    margin: 2px 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
    background-color: var(--primary);
    color: #ffffff;
}

.sidebar-nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* --------------------------------------------------------------------------
   Admin Layout — Main Area
   -------------------------------------------------------------------------- */
.admin-main {
    margin-left: var(--admin-sidebar-width);
    min-height: 100vh;
    background-color: var(--admin-main-bg);
    transition: margin-left 0.3s ease;
}

.admin-topbar {
    background: #ffffff;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-topbar .page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.admin-topbar .sidebar-toggle {
    display: none;
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    font-size: 1.2rem;
    color: var(--text);
    cursor: pointer;
    margin-right: 1rem;
    transition: background-color 0.2s ease;
}

.admin-topbar .sidebar-toggle:hover {
    background-color: var(--light-bg);
}

.admin-topbar .admin-user-dropdown .btn {
    font-weight: 500;
    color: var(--text);
}

.admin-content {
    padding: 1.5rem;
}

/* Admin sidebar overlay for mobile */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1035;
}

.admin-sidebar-overlay.show {
    display: block;
}

/* --------------------------------------------------------------------------
   Admin Layout — Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-260px);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-topbar .sidebar-toggle {
        display: inline-flex;
    }
}

/* --------------------------------------------------------------------------
   Bootstrap Overrides
   -------------------------------------------------------------------------- */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-primary:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(36, 156, 169, 0.35);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.btn-outline-primary:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(36, 156, 169, 0.35);
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
}

.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger);
}

.btn-warning {
    background-color: var(--warning);
    border-color: var(--warning);
    color: var(--text);
}

a {
    color: var(--primary);
    transition: color 0.2s ease;
}

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

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-primary-brand {
    color: var(--primary) !important;
}

.text-secondary-brand {
    color: var(--secondary) !important;
}

.bg-primary-brand {
    background-color: var(--primary) !important;
}

.bg-secondary-brand {
    background-color: var(--secondary) !important;
}

/* --------------------------------------------------------------------------
   Form Styles
   -------------------------------------------------------------------------- */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(36, 156, 169, 0.2);
}

/* --------------------------------------------------------------------------
   Scrollbar Styling (Admin Sidebar)
   -------------------------------------------------------------------------- */
.admin-sidebar::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* --------------------------------------------------------------------------
   Dashboard Cards
   -------------------------------------------------------------------------- */
.dashboard-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
    height: 100%;
}

.dashboard-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dashboard-card .card-header {
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.dashboard-card .card-header i {
    font-size: 1.15rem;
}

.dashboard-card .card-body {
    padding: 1.25rem;
}

.dashboard-stat {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-card .list-unstyled li {
    border-bottom: 1px solid #f5f5f5;
}

.dashboard-card .list-unstyled li:last-child {
    border-bottom: none;
}

/* --------------------------------------------------------------------------
   Wizard — Application Form Multi-Step
   -------------------------------------------------------------------------- */
.wizard-container {
    max-width: 900px;
}

.wizard-top-bar {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
}

/* Desktop progress bar */
.wizard-progress-desktop {
    padding: 16px 0;
}

.wizard-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 0 0 auto;
}

.wizard-progress-step .step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.wizard-progress-step.visited .step-number {
    background: #c3e6cb;
    color: #155724;
}

.wizard-progress-step.active .step-number {
    background: var(--primary);
    color: #ffffff;
}

.wizard-progress-step .step-title {
    color: #6c757d;
    max-width: 100px;
    word-wrap: break-word;
}

.wizard-progress-step.active .step-title {
    color: var(--secondary);
    font-weight: 600;
}

.wizard-progress-step .step-link.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.wizard-progress-step .step-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wizard-progress-step .step-link:hover {
    color: inherit;
}

.wizard-progress-step.visited .step-link[href]:hover .step-number {
    background: var(--primary);
    color: #ffffff;
}

.wizard-progress-line {
    height: 2px;
    background: #dee2e6;
    margin: 18px 8px 0 8px;
}

/* Mobile progress bar */
.wizard-progress-mobile {
    background: #f8f9fa;
    padding: 10px 16px;
    border-radius: 8px;
}

/* --------------------------------------------------------------------------
   Wizard — Summary Stage
   -------------------------------------------------------------------------- */
.summary-field-row {
    transition: background-color 0.2s;
}

.summary-field-row:hover {
    background-color: #f8f9fa;
}

.bg-danger-subtle {
    background-color: #f8d7da !important;
}

.summary-field-row.bg-danger-subtle:hover {
    background-color: #f1c0c5 !important;
}

.summary-field-row .text-danger {
    color: #842029 !important;
}

/* Wizard progress step — summary icon alignment */
.wizard-progress-step .step-number i {
    font-size: 1rem;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   Document Cards
   -------------------------------------------------------------------------- */
.document-card .document-content {
    line-height: 1.7;
}

.document-card .document-content h1,
.document-card .document-content h2,
.document-card .document-content h3 {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
}

.document-card .document-content p {
    margin-bottom: 0.75rem;
}

.document-card .document-content ul,
.document-card .document-content ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

/* --------------------------------------------------------------------------
   Acknowledgment Controls
   -------------------------------------------------------------------------- */
.ack-controls {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
}

.ack-controls .form-check-label {
    font-size: 0.95rem;
}


/* Modal stacking fix — ensure modals escape any parent stacking context */
.modal {
    z-index: 1055;
}
.modal-backdrop {
    z-index: 1050;
}
