/* ==========================================================================
   Bear Services LLC - Theme & Application Styles
   Matches bearservices.com color tokens, typography, and layout.
   ========================================================================== */

:root {
    /* Exact Website Theme Color Mapping */
    --brand-primary: #511110;
    /* Primary: Main brand color for headers & primary buttons */
    --brand-primary-hover: #C8A14A;
    /* Primary Hover: Gold accent color on button hover */
    --brand-contrast-dark: #2f1110;
    /* Contrast Dark: "Near-black" burgundy for deep contrast */
    --brand-contrast-light: #FFFFFF;
    /* Contrast Light: Pure white text / cards */
    --brand-base: #FBF7F7;
    /* Base: Main background color, softer than pure white */
    --brand-mono-1: #2E2E2E;
    /* Mono 1: Deep Charcoal body text */
    --brand-mono-2: #727272;
    /* Mono 2: Secondary text, icon labels */
    --brand-mono-3: #DDCBCB;
    /* Mono 3: Muted rose/gray for subtle borders */
    --brand-mono-4: #E8E8E8;
    /* Mono 4: Soft neutral gray for inputs/decorations */
    --brand-featured: #A3907F;
    /* Featured: Warm taupe for highlights */

    /* Semantic Aliases */
    --brand-maroon: var(--brand-primary);
    --brand-navy: var(--brand-contrast-dark);
    --brand-deep-blue: #3d1413;
    --brand-primary-light: #fbeeed;
    /* Soft tinted maroon for active cards/tabs */
    --brand-slate: var(--brand-mono-2);
    --brand-slate-dark: var(--brand-mono-1);
    --brand-border: var(--brand-mono-3);
    --brand-border-dark: #c4b0b0;
    --brand-bg: #f7efef;
    /* Soft container background */
    --brand-page-bg: var(--brand-base);
    /* #FBF7F7 */
    --brand-white: var(--brand-contrast-light);

    --brand-gold: #C8A14A;
    --brand-gold-bg: #fdf8eb;
    --brand-gold-border: #ecd9a8;

    --brand-green: #15803d;
    --brand-green-bg: #f0fdf4;
    --brand-green-border: #bbf7d0;

    --brand-red: #b91c1c;
    --brand-red-bg: #fef2f2;
    --brand-red-border: #fecaca;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px 0 rgba(47, 17, 16, 0.05);
    --shadow-md: 0 4px 8px -1px rgba(47, 17, 16, 0.1), 0 2px 4px -2px rgba(47, 17, 16, 0.06);
    --shadow-lg: 0 10px 18px -3px rgba(47, 17, 16, 0.12), 0 4px 6px -4px rgba(47, 17, 16, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--brand-page-bg);
    color: var(--brand-slate-dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
    background: var(--brand-white);
    border-bottom: 1px solid var(--brand-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.brand-wrapper:hover {
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    height: 38px;
    width: auto;
    display: block;
}

.brand-title-wrap {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--brand-navy);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--brand-slate);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.phone-hotline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand-gold-bg);
    color: var(--brand-gold);
    border: 1px solid var(--brand-gold-border);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.phone-hotline:hover {
    background: #fde68a;
    color: #b45309;
}

.site-nav {
    background: var(--brand-contrast-dark);
    border-bottom: 2px solid var(--brand-primary);
    padding: 6px 20px;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    overflow: visible;
}

.nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    align-items: center;
}

.nav-link {
    color: #f1e5e5;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 600;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.user-pill {
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-btn {
    color: #f1e5e5;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    margin-top: 0;
    background: #ffffff;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    min-width: 215px;
    z-index: 99999;
    padding: 6px 0;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown-menu.show {
    display: block;
}

.nav-dropdown-item {
    display: block;
    padding: 8px 16px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--brand-navy);
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}

.nav-dropdown-item:hover {
    background: #f8fafc;
    color: var(--brand-primary);
}

.nav-link:hover,
.nav-link.active {
    color: var(--brand-primary-hover);
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.highlight {
    background: var(--brand-primary);
    color: var(--brand-white);
    border: 1px solid rgba(200, 161, 74, 0.3);
}

.nav-link.highlight:hover {
    background: var(--brand-primary-hover);
    color: var(--brand-contrast-dark);
    border-color: var(--brand-primary-hover);
}

/* ==========================================================================
   Main Layout & Container
   ========================================================================== */

.main-content {
    flex: 1;
    max-width: 1000px;
    width: 100%;
    margin: 24px auto;
    padding: 0 16px;
}

.card {
    background: var(--brand-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--brand-border);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--brand-slate);
    margin-bottom: 18px;
}

/* ==========================================================================
   Metrics Grid & Dashboard
   ========================================================================== */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--brand-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--brand-border);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--brand-navy);
    line-height: 1.1;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand-slate);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Quick Search / Scan Bar */
.search-banner {
    background: linear-gradient(135deg, #2f1110 0%, #511110 60%, #681a18 100%);
    color: var(--brand-white);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(81, 17, 16, 0.3);
}

.search-banner h2 {
    font-size: 1.35rem;
    margin-bottom: 6px;
}

.search-banner p {
    color: #e5b9b8;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.search-form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 220px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--brand-border);
    font-size: 1rem;
    background: var(--brand-white);
    color: var(--brand-slate-dark);
}

.search-input:focus {
    outline: 2px solid var(--brand-primary);
}

/* ==========================================================================
   Buttons & Controls
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--brand-primary);
    color: var(--brand-white);
    border: 1px solid var(--brand-primary);
}

.btn-primary:hover {
    background: var(--brand-primary-hover);
    color: var(--brand-contrast-dark);
    border-color: var(--brand-primary-hover);
}

.btn-navy {
    background: var(--brand-contrast-dark);
    color: var(--brand-white);
}

.btn-navy:hover {
    background: var(--brand-primary);
    color: var(--brand-white);
}

.btn-secondary {
    background: var(--brand-white);
    color: var(--brand-slate-dark);
    border-color: var(--brand-border);
}

.btn-secondary:hover {
    background: var(--brand-bg);
    border-color: var(--brand-featured);
    color: var(--brand-primary);
}

.btn-success {
    background: var(--brand-green);
    color: var(--brand-white);
}

.btn-success:hover {
    background: #047857;
}

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

.btn-outline:hover {
    background: var(--brand-primary);
    color: var(--brand-white);
}

.btn-lg {
    padding: 14px 24px;
    font-size: 1.05rem;
    font-weight: 700;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

/* ==========================================================================
   Form Styling (8-Section Microsoft Form Replication)
   ========================================================================== */

.form-header-card {
    background: var(--brand-white);
    border-radius: var(--radius-md);
    border-top: 5px solid var(--brand-maroon);
    border-left: 1px solid var(--brand-border);
    border-right: 1px solid var(--brand-border);
    border-bottom: 1px solid var(--brand-border);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.form-section {
    background: var(--brand-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--brand-border);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.form-section.locked {
    display: none;
}

.form-section.revealed {
    animation: fadeInSection 0.35s ease-out forwards;
}

@keyframes fadeInSection {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section:focus-within {
    border-color: var(--brand-primary);
}

.section-badge-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--brand-border);
}

.section-number {
    background: var(--brand-navy);
    color: var(--brand-white);
    font-size: 0.8rem;
    font-weight: 800;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.section-number.completed {
    background: var(--brand-green);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-navy);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.section-hint {
    font-size: 0.85rem;
    color: var(--brand-slate);
    margin-top: -6px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group:last-child {
    margin-bottom: 0;
}

label.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand-slate-dark);
}

.required-star {
    color: var(--brand-red);
    font-weight: bold;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--brand-border-dark);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--brand-slate-dark);
    background-color: var(--brand-white);
    transition: all 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(81, 17, 16, 0.15);
}

.form-control[readonly] {
    background-color: var(--brand-bg);
    color: var(--brand-slate);
    cursor: not-allowed;
}

/* Radio Pill Buttons */
.radio-cards-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 6px;
}

.radio-card {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1.5px solid var(--brand-border);
    border-radius: var(--radius-sm);
    background: var(--brand-white);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.radio-card:hover {
    border-color: var(--brand-primary);
    background: var(--brand-bg);
}

.radio-card input[type="radio"] {
    margin-right: 10px;
    accent-color: var(--brand-primary);
    width: 18px;
    height: 18px;
}

.radio-card.active {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    font-weight: 600;
}

/* Take 5 Verification Box */
.verification-box {
    margin-top: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    display: none;
}

.verification-box.success {
    display: block;
    background: var(--brand-green-bg);
    border: 1px solid var(--brand-green-border);
    color: var(--brand-green);
}

.verification-box.error {
    display: block;
    background: var(--brand-red-bg);
    border: 1px solid var(--brand-red-border);
    color: var(--brand-red);
}

.verification-box.warning,
.verification-box.notice {
    display: block;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.verification-box.loading {
    display: block;
    background: var(--brand-bg);
    border: 1px solid var(--brand-border);
    color: var(--brand-slate);
}

/* Dropbox Photo Box */
.dropbox-card {
    background: #faf6f6;
    border: 1.5px dashed var(--brand-border-dark);
    border-radius: var(--radius-md);
    padding: 18px;
    margin: 18px 0;
}

.dropbox-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.dropbox-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brand-navy);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropbox-btn {
    background: #0061fe;
    color: var(--brand-white);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.dropbox-btn:hover {
    background: #004ecc;
}

.dropbox-checklist {
    list-style: disc;
    margin-left: 20px;
    font-size: 0.85rem;
    color: var(--brand-slate-dark);
    margin-bottom: 12px;
}

.dropbox-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--brand-navy);
    cursor: pointer;
}

.dropbox-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-primary);
}

/* Asset Info Banner for /tag/<id> */
.asset-banner {
    background: linear-gradient(135deg, #2f1110 0%, #511110 60%, #681a18 100%);
    color: var(--brand-white);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(81, 17, 16, 0.3);
}

.asset-banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.asset-banner-tag {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.asset-banner-status {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.asset-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    font-size: 0.88rem;
}

.asset-meta-item span {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #e5b9b8;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ==========================================================================
   Tables & Data Presentation
   ========================================================================== */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
}

table.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

table.data-table th {
    background: var(--brand-bg);
    color: var(--brand-navy);
    font-weight: 700;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 2px solid var(--brand-border);
    white-space: nowrap;
}

table.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--brand-border);
    color: var(--brand-slate-dark);
}

table.data-table tbody tr:hover {
    background-color: var(--brand-bg);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.badge-active {
    background: var(--brand-green-bg);
    color: var(--brand-green);
    border: 1px solid var(--brand-green-border);
}

.badge-replaced {
    background: var(--brand-gold-bg);
    color: var(--brand-gold);
    border: 1px solid var(--brand-gold-border);
}

.badge-out-of-service {
    background: var(--brand-red-bg);
    color: var(--brand-red);
    border: 1px solid var(--brand-red-border);
}

/* Flash Messages */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.92rem;
    font-weight: 500;
}

.alert-success {
    background: var(--brand-green-bg);
    color: var(--brand-green);
    border: 1px solid var(--brand-green-border);
}

.alert-error {
    background: var(--brand-red-bg);
    color: var(--brand-red);
    border: 1px solid var(--brand-red-border);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--brand-white);
    border-top: 1px solid var(--brand-border);
    padding: 24px 20px;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--brand-slate);
    text-align: center;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .radio-cards-group {
        grid-template-columns: 1fr;
    }

    .main-content {
        margin: 14px auto;
        padding: 0 12px;
    }

    .card,
    .form-section {
        padding: 16px;
    }
}