/* Custom styles migrated from shared/_custom_css.html.slim */

:root {
    --lg-tertiary-bg: #faf9f7;
    --lg-tertiary-bg-rgb: 250, 249, 247;
    --lg-secondary-bg: #f1f2ed;
    --lg-secondary-bg-rgb: 241, 242, 237;
}

[data-bs-theme="dark"] {
    --bs-body-bg: #0b1020;
    --bs-body-bg-rgb: 11, 16, 32;
    --bs-body-color: #e5e7eb;
    --bs-body-color-rgb: 229, 231, 235;
    --bs-emphasis-color: #f8fafc;
    --bs-emphasis-color-rgb: 248, 250, 252;
    --bs-secondary-bg: #111827;
    --bs-secondary-bg-rgb: 17, 24, 39;
    --bs-tertiary-bg: #0f172a;
    --bs-tertiary-bg-rgb: 15, 23, 42;
    --bs-border-color: #263244;
    --bs-border-color-translucent: rgba(148, 163, 184, 0.18);
    --bs-card-bg: #111827;
    --bs-card-border-color: #263244;
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] main,
[data-bs-theme="dark"] .main-content {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .bg-body {
    background-color: var(--bs-body-bg) !important;
}

[data-bs-theme="dark"] .bg-body-secondary {
    background-color: var(--bs-secondary-bg) !important;
}

[data-bs-theme="dark"] .bg-body-tertiary {
    background-color: var(--bs-tertiary-bg) !important;
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .list-group-item {
    background-color: #111827;
    border-color: #263244;
}

[data-bs-theme="dark"] .navbar,
[data-bs-theme="dark"] .sidebar-wrapper {
    background-color: var(--bs-body-bg) !important;
    border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-white {
    background-color: var(--bs-secondary-bg) !important;
}

[data-bs-theme="dark"] .text-dark {
    color: var(--bs-emphasis-color) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #94a3b8;
}

[data-bs-theme="dark"] .navbar-actions .btn-light,
[data-bs-theme="dark"] .navbar-mobile-actions .btn-light.mobile-action-button {
    background-color: transparent !important;
    border-color: rgba(248, 250, 252, 0.35) !important;
    color: var(--bs-emphasis-color) !important;
}

[data-bs-theme="dark"] .navbar-actions .btn-light:hover,
[data-bs-theme="dark"] .navbar-mobile-actions .btn-light.mobile-action-button:hover {
    background-color: rgba(248, 250, 252, 0.08) !important;
    border-color: rgba(248, 250, 252, 0.55) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: #111827;
    --bs-table-color: var(--bs-body-color);
    --bs-table-border-color: var(--bs-border-color);
    --bs-table-striped-bg: #141d2f;
    --bs-table-striped-color: var(--bs-body-color);
    --bs-table-hover-bg: rgba(59, 130, 246, 0.1);
    --bs-table-hover-color: var(--bs-emphasis-color);
}

[data-bs-theme="dark"] .table > :not(caption) > * > * {
    background-color: var(--bs-table-bg);
    border-bottom-color: var(--bs-table-border-color);
    color: var(--bs-table-color);
}

[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table .bg-body-tertiary {
    background-color: #172033 !important;
}

[data-bs-theme="dark"] .table tbody tr:hover {
    background-color: var(--bs-table-hover-bg);
}

[data-bs-theme="dark"] .table tbody tr:hover > * {
    background-color: var(--bs-table-hover-bg);
}

.rfp-progress-container {
    /* Half a marker (10px) plus breathing room, so endpoint markers and their
       centered labels never clip the container. Steps and the track both
       derive their geometry from this one value. */
    --rfp-track-inset: 12px;
    position: relative;
    height: 56px;
}

.rfp-progress-container .progress {
    height: 4px !important;
    position: absolute;
    top: 9px;
    left: var(--rfp-track-inset);
    right: var(--rfp-track-inset);
    z-index: 1;
    background-color: #e9ecef;
}

/* One step (marker + label), centered on its track fraction — the same
   fraction the fill width uses, keeping bar and markers aligned. */
.rfp-step-abs {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    text-align: center;
    z-index: 3;
}

.rfp-step-abs .rfp-step-label {
    white-space: nowrap;
}

/* Edge steps anchor flush to the track ends instead of centering, so their
   nowrap labels can't overflow the container at narrow widths. The half-marker
   negative margin keeps the marker itself centered on the track joint. */
.rfp-step-abs-first {
    transform: none;
    text-align: left;
}

.rfp-step-abs-first .rfp-step-marker {
    margin-left: -10px;
}

.rfp-step-abs-last {
    transform: translateX(-100%);
    text-align: right;
}

.rfp-step-abs-last .rfp-step-marker {
    margin-right: -10px;
}

/* On the narrowest phones the nowrap labels can still collide (worst case:
   the vendor stepper's six stages); shrink them just enough to keep clear. */
@media (max-width: 400px) {
    .rfp-step-abs .rfp-step-label {
        font-size: 10px !important;
        letter-spacing: -0.01em;
    }
}

.rfp-progress-container .progress-bar {
    height: 4px !important;
    z-index: 2;
    background-color: var(--bs-primary);
}

.rfp-step-wrapper {
    flex: 1;
    z-index: 3;
    position: relative;
}

.rfp-step-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #adb5bd;
    border: 3px solid #ffffff;
    margin: 0 auto;
    position: relative;
}

.rfp-step-marker.completed,
.rfp-step-marker.active {
    background-color: var(--bs-primary);
}

.rfp-step-marker.active {
    animation: rfp-progress-pulse 2s infinite;
}

.rfp-step-label {
    color: #6c757d;
    white-space: nowrap;
}

.rfp-step-label.active-text {
    font-weight: 700;
    color: #000000;
}

@keyframes rfp-progress-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--bs-primary-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0);
    }
}

[data-bs-theme="dark"] .rfp-progress-container .progress {
    background-color: #263244 !important;
}

[data-bs-theme="dark"] .rfp-progress-container .progress-bar {
    background-color: #60a5fa !important;
}

[data-bs-theme="dark"] .rfp-step-marker {
    background-color: #475569 !important;
    border-color: var(--bs-body-bg) !important;
}

[data-bs-theme="dark"] .rfp-step-marker.completed,
[data-bs-theme="dark"] .rfp-step-marker.active {
    background-color: #60a5fa !important;
}

[data-bs-theme="dark"] .rfp-step-label {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .rfp-step-label.active-text {
    color: var(--bs-emphasis-color) !important;
}

/* Hover-lift card treatment + clamped compact-card text, shared by the RFP
   index cards (light-mode base; the dark-mode hover override follows). */
.interactive-card {
    transition: all 0.15s ease-in-out;
}

.interactive-card:hover {
    border-color: #007bff;
    background-color: #f8fbff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.compact-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.compact-card-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

[data-bs-theme="dark"] .interactive-card:hover {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.32);
}

[data-bs-theme="dark"] .card.cursor-pointer,
[data-bs-theme="dark"] .template-card {
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .card.cursor-pointer:hover,
[data-bs-theme="dark"] .template-card:hover {
    background-color: #172033 !important;
    border-color: #3b82f6 !important;
}

[data-bs-theme="dark"] .card.selected,
[data-bs-theme="dark"] .template-card.selected {
    background-color: rgba(59, 130, 246, 0.18) !important;
    border-color: #3b82f6 !important;
    color: var(--bs-emphasis-color);
}

[data-bs-theme="dark"] .card.selected .text-muted,
[data-bs-theme="dark"] .template-card.selected .text-muted {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .badge.bg-body-secondary.text-muted,
[data-bs-theme="dark"] .badge.bg-info-subtle.text-primary {
    background-color: #111827 !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .badge.bg-body-secondary.text-muted:hover,
[data-bs-theme="dark"] .badge.bg-info-subtle.text-primary:hover {
    background-color: #172033 !important;
    border-color: #3b82f6 !important;
    color: var(--bs-emphasis-color) !important;
}

[data-bs-theme="dark"] #welcome-lex-link,
[data-bs-theme="dark"] .welcome-secondary-card {
    background-color: var(--bs-secondary-bg) !important;
    border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] #welcome-lex-link:hover,
[data-bs-theme="dark"] .welcome-secondary-card:hover {
    background-color: #172033 !important;
    border-color: #3b82f6 !important;
}

@font-face {
    font-family: "Legalio";
    src: url(/fonts/Legalio-Medium.otf) format("opentype"),
         url(/fonts/Legalio-Medium.ttf) format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

.card-title, .font-title, .h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
    font-family: "Legalio", Arial, sans-serif;
    font-style: normal;
    letter-spacing: -.02em;
}

.masthead-title {
    font-family: "Legalio", Arial, sans-serif;
    font-style: normal;
    letter-spacing: -.04em;
    font-size: 3.25rem;
    line-height: 100%;
}

.masthead-subtitle {
    font-family: "Legalio", Arial, sans-serif;
    font-style: normal;
    letter-spacing: -.04em;
    font-size: 2.5rem;
    line-height: 100%;
}

@media (max-width: 1200px) {
    .masthead-title {
        font-size: 3rem;
    }
    .masthead-subtitle {
        font-size: 2rem;
    }
}
@media (max-width: 768px) {
    .masthead-title {
        font-size: 2.5rem;
    }
    .masthead-subtitle {
        font-size: 1.5rem;
    }
}
@media (max-width: 576px) {
    .masthead-title {
        font-size: 2rem;
    }
    .masthead-subtitle {
        font-size: 1.25rem;
    }
}

