:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #b71c1c;
    /* Deep Red from logo */
    --primary-hover: #d32f2f;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #333333;
    --success-bg: #1b5e20;
    --success-text: #e8f5e9;
    --error-bg: #b71c1c;
    --error-text: #ffebee;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

a {
    color: #ef5350;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

header {
    background-color: var(--surface-color);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    width: 80%;
    margin: 10px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 50px;
    width: auto;
}

nav a {
    color: var(--text-color);
    margin-left: 15px;
    font-weight: 500;
}

nav a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.home-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.container {
    background-color: var(--surface-color);
    padding: 25px;
    width: 80%;
    margin: 10px auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Forms */
input,
select,
textarea {
    background-color: #2d2d2d;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Ensure datalist arrow is visible in dark mode */
input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--primary-hover);
    text-decoration: none;
}

.btn-secondary {
    background-color: #424242;
}

.btn-secondary:hover {
    background-color: #616161;
}

.btn-danger {
    background-color: #c62828;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th {
    background-color: #2d2d2d;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background-color: #2c2c2c;
}

/* Utilities */
.text-muted {
    color: var(--text-muted);
}

.flash {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    transition: opacity 1s ease-out;
    opacity: 1;
}

.flash.fade-out {
    opacity: 0;
}

.flash.success {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.flash.error {
    background-color: var(--error-bg);
    color: var(--error-text);
}

.flash.warning {
    background-color: #665200;
    color: #fff4c2;
}

.active-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
}

.active-true {
    background-color: rgba(27, 94, 32, 0.4);
    color: #a5d6a7;
    border: 1px solid #2e7d32;
}

.active-false {
    background-color: rgba(183, 28, 28, 0.4);
    color: #ef9a9a;
    border: 1px solid #c62828;
}

/* Responsive Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.search-container {
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input[name="q"] {
    flex-grow: 1;
}

.search-form select {
    width: auto;
}

.public-hero {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px;
    background: linear-gradient(145deg, #1e1e1e, #171717);
}

.public-about {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 18px;
    align-items: center;
}

.public-about-media {
    display: flex;
    justify-content: center;
}

.public-about-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: #141414;
    padding: 10px;
}

.public-about-content h2 {
    margin: 0 0 8px 0;
}

.public-kicker {
    color: var(--primary-hover);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    margin: 0 0 8px 0;
}

.public-lead {
    max-width: 700px;
}

.public-section {
    margin-top: 22px;
}

.cta-row {
    margin-top: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-services-dropdown {
    position: relative;
    padding-bottom: 6px;
    margin-bottom: -6px;
}

.hero-services-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    z-index: 1000;
    background: #1a1a1a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.hero-services-dropdown-menu a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 6px;
}

.hero-services-dropdown-menu a:hover {
    background-color: #2a2a2a;
    text-decoration: none;
}

.hero-services-dropdown:hover .hero-services-dropdown-menu,
.hero-services-dropdown:focus-within .hero-services-dropdown-menu {
    display: block;
}

.public-disclaimer {
    background-color: #2a1b1b;
    border-left: 4px solid var(--primary-color);
    padding: 10px 12px;
    border-radius: 6px;
}

.public-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.public-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    background-color: #222;
}

.public-card-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-shop {
    background-color: #8f1212;
}

.btn-shop:hover {
    background-color: #b71c1c;
}

.public-card-title {
    margin: 0;
    font-weight: 700;
}

.public-models {
    margin: 6px 0 0 0;
}

.public-intervention {
    margin: 12px 0 6px 0;
}

.public-price {
    color: #ffb4b4;
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0 0 8px 0;
}

.public-empty {
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    padding: 18px;
}

.contact-form .form-grid {
    margin-top: 14px;
}

.contact-callout {
    margin: 18px 0 20px 0;
    border-color: #4d2b2b;
    background: linear-gradient(135deg, #241616, #1a1a1a);
}

.contact-callout-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.contact-callout-head h3 {
    margin: 0;
}

.contact-callout-body p {
    margin: 0 0 8px 0;
}

.contact-phone-link {
    font-size: 1.15rem;
    font-weight: 700;
}

.contact-phone-link a {
    color: #ffd0d0;
    text-decoration: none;
}

.contact-phone-link a:hover {
    text-decoration: underline;
}

.contact-help {
    margin: 6px 0 0 0;
    font-size: 0.9rem;
}

.readonly-field {
    width: 100%;
    box-sizing: border-box;
    min-height: 42px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #242424;
    color: var(--text-muted);
}

.hp-field {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.login-drawer {
    position: fixed;
    right: -15px;
    top: 20px;
    z-index: 999;
}

.login-drawer-tab {
    display: inline-block;
    transform: translateX(36px);
    transition: transform 0.2s ease;
    background: #2a2a2a;
    border: 1px solid var(--border-color);
    border-right: none;
    color: #999;
    padding: 8px 10px;
    border-radius: 8px 0 0 8px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
}

.login-drawer:hover .login-drawer-tab,
.login-drawer-tab:focus {
    transform: translateX(-20px);
    color: #ddd;
    text-decoration: none;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        width: 100%;
        margin: 0 0 20px 0;
        box-sizing: border-box;
    }

    .logo-container {
        justify-content: center;
    }

    .container {
        padding: 15px;
        width: 100% !important;
        margin: 0;
        box-sizing: border-box;
    }

    nav {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    nav a {
        margin: 0;
        display: block;
        text-align: center;
        padding: 12px;
        background-color: var(--surface-color);
        border: 1px solid var(--border-color);
        border-radius: 4px;
    }

    .hero-services-dropdown {
        width: 100%;
    }

    .hero-services-dropdown > a {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .hero-services-dropdown-menu {
        position: static;
        display: block;
        min-width: 0;
        margin-top: 8px;
    }

    /* Forms Mobile */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form select {
        width: 100%;
    }

    .public-hero {
        padding: 18px;
    }

    .public-about {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .cta-row .btn {
        width: 100%;
        text-align: center;
    }

    .contact-callout-head .btn {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .login-drawer {
        top: auto;
        bottom: 16px;
    }

    input,
    select,
    textarea,
    button,
    .btn {
        min-height: 44px;
        /* Touch friendly */
    }

    /* Table Mobile Card View */
    thead {
        display: none;
    }

    tr {
        display: block;
        background-color: #262626;
        /* Slightly lighter card bg */
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px;
    }

    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-color);
        text-align: right;
    }

    td:last-child {
        border-bottom: none;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    td::before {
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
        color: var(--text-muted);
        margin-right: 15px;
    }

    .actions-cell a {
        display: block;
        text-align: center;
        margin-bottom: 5px;
    }
}

/* section home page  */
  .hero {
    padding: 56px 20px;
    background: #0f0f0f;
    color: #fff;
  }

  .hero-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
  }

  .hero-left h1 {
    margin: 0 0 10px 0;
    font-size: 38px;
    color: #e10600;
    letter-spacing: 0.2px;
  }

  .hero-left h2 {
    margin: 0 0 22px 0;
    font-size: 18px;
    font-weight: 400;
    color: #d6d6d6;
  }

  .hero-left p {
    margin: 0 0 14px 0;
    line-height: 1.6;
    color: #f1f1f1;
  }

  .hero-left .note {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #161616;
    border: 1px solid #2a2a2a;
    color: #dcdcdc;
  }

  .info-card {
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    padding: 18px 18px 14px 18px;
  }

  .info-card h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #e10600;
  }

  .small {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #cfcfcf;
    line-height: 1.5;
  }

  .link-list {
    list-style: none;
    padding: 0;
    margin: 0 0 14px 0;
  }

  .link-list li {
    padding: 10px 0;
    border-bottom: 1px solid #242424;
  }

  .link-list li:last-child {
    border-bottom: none;
  }

  .link-list a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
  }

  .link-list a:hover {
    text-decoration: underline;
  }

  .muted {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #a9a9a9;
  }

  hr {
    border: none;
    border-top: 1px solid #2a2a2a;
    margin: 14px 0;
  }

  .sep {
    margin: 0 6px;
    color: #666;
  }

  .info-card a {
    color: #e10600;
    text-decoration: none;
  }

  .info-card a:hover {
    text-decoration: underline;
  }

  @media (max-width: 900px) {
    .hero-container {
      grid-template-columns: 1fr;
    }
    .hero-left h1 {
      font-size: 32px;
    }
  }

  .gallery-section {
    padding: 50px 20px;
    background: #0d0d0d;
  }
  
  .gallery-section h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #e10600;
  }
  
  .gallery-carousel {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 10px;
  }

  .gallery-carousel.gallery-carousel-centered {
    justify-content: center;
    overflow-x: visible;
    flex-wrap: wrap;
  }
  
  .gallery-carousel img {
    height: 220px;
    border-radius: 12px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    transition: transform 0.3s ease;
    cursor: pointer;
    border: 1px solid #2a2a2a;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  }
  
  .gallery-carousel img:hover {
    transform: scale(1.03);
  }
  
  .gallery-carousel::-webkit-scrollbar {
    height: 6px;
  }
  
  .gallery-carousel::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
  }

  .lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
    box-sizing: border-box;
  }

  .lightbox.is-open {
    display: flex;
  }

  .lightbox-image {
    max-width: min(92vw, 1400px);
    max-height: 88vh;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #3b3b3b;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  }

  .lightbox-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 1px solid #585858;
    background: rgba(20, 20, 20, 0.9);
    color: #fff;
    border-radius: 999px;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    display: grid;
    place-items: center;
    padding: 0;
  }

  .lightbox-close:hover {
    background: #303030;
  }

  body.lightbox-open {
    overflow: hidden;
  }

.links-editor-row {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background-color: #232323;
}

.pagination-row {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.content-cover {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin: 0 0 16px 0;
}

.content-hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 22px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: linear-gradient(135deg, #1e1e1e, #161616);
}

.content-hero h1 {
  margin: 0 0 8px 0;
  font-size: 2rem;
}

.content-hero-excerpt {
  color: #d3d3d3;
  margin: 0 0 12px 0;
}

.content-hero-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.content-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.content-badge {
  background: #231515;
  border: 1px solid #4d2b2b;
  color: #ffb9b9;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.86rem;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 68%) minmax(260px, 32%);
  gap: 20px;
  align-items: start;
}

.content-main {
  min-width: 0;
}

.content-aside {
  position: sticky;
  top: 90px;
}

.content-conversion-card {
  border: 1px solid #3b2626;
  background: #1a1515;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.content-conversion-card h3 {
  margin-top: 0;
}

.content-conversion-card ul {
  margin: 0 0 12px 0;
  padding-left: 20px;
}

.toc-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc-list li {
  margin: 0 0 8px 0;
}

.content-body {
  line-height: 1.78;
  font-size: 1.04rem;
  word-wrap: break-word;
}

.content-body p {
  margin: 0 0 14px 0;
  max-width: 85ch;
}

.content-body h2 {
  margin: 34px 0 14px 0;
  padding: 0 0 8px 0;
  border-bottom: 1px solid #472828;
  color: #ff8a80;
  font-size: 1.55rem;
}

.content-body h3 {
  margin: 28px 0 12px 0;
  padding-left: 10px;
  border-left: 3px solid var(--primary-color);
  color: #ff9a92;
  font-size: 1.25rem;
}

.content-body ul,
.content-body ol {
  padding-left: 24px;
  margin: 8px 0 16px 0;
}

.content-body li {
  margin-bottom: 8px;
}

.content-body a {
  color: #ff6f6f;
  text-decoration: underline;
}

.content-body a:hover {
  color: #ff9f9f;
}

.content-body blockquote {
  margin: 16px 0;
  border-left: 3px solid var(--primary-color);
  padding: 10px 14px;
  background-color: #1b1b1b;
  border-radius: 6px;
}

.content-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  margin: 14px 0;
}

.content-body hr {
  border: none;
  border-top: 1px solid #3a2a2a;
  margin: 26px 0;
}

.content-box {
  margin-top: 22px;
  border: 1px solid #3b2626;
  background: #1a1515;
  border-radius: 10px;
  padding: 14px;
}

.embed-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
}

.embed-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
}

@media (max-width: 980px) {
  .content-hero {
    grid-template-columns: 1fr;
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .content-aside {
    position: static;
    top: auto;
  }
}
  
