:root {
    --primary-glow: #1AC6CE;
    --deep-navy: #043E48;
    --dark-bg: #022329;
    --light-card: rgba(255, 255, 255, 0.04);
    --light-card-hover: rgba(255, 255, 255, 0.08);
    --border-color: rgba(26, 198, 206, 0.15);
    --text-muted: #a3c2c6;
}

/* Bootstrap's display utilities are !important and would otherwise beat [hidden]. */
[hidden] {
    display: none !important;
}

body {
    background-color: var(--dark-bg);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

.container {
    overflow-x: hidden;
}

/* Keep anchor targets clear of the sticky navbar. */
section[id],
#share {
    scroll-margin-top: 90px;
}

/* High-End Background Gradients */
.bg-gradient-cyber {
    background: linear-gradient(135deg, var(--deep-navy) 0%, var(--dark-bg) 100%);
    position: relative;
}

.bg-gradient-cyber::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(26, 198, 206, 0.15) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* Navigation */
.navbar {
    background: rgb(249 249 247) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    color: #000;
}

.nav-link {
    color: #17242b !important;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
    padding: 0.5rem 1.2rem !important;
    transition: all 0.2s ease;
}

.nav-link:hover {
    opacity: 1;
    color: var(--primary-glow) !important;
}

.navbar-toggler {
    background: #17242b !important;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Newsreader', serif;
    font-style: italic;
    font-size: 22px;
    font-weight: 500;
    text-decoration: none;
    color: var(--ink);
}

.logo-mark {
    width: 22px;
    height: 22px;
    flex: none;
}

/* Modern Typography Elements */
.eyebrow {
    color: var(--primary-glow);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.eyebrow::before {
    content: "";
    width: 12px;
    height: 2px;
    background: var(--primary-glow);
    display: inline-block;
}

.text-muted-soft {
    color: var(--text-muted) !important;
}

/* Buttons styling */
.btn-glow {
    background: var(--dark-bg);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.75rem;
    border-radius: 4px;
    border: 1px solid var(--dark-bg);
    box-shadow: 0 4px 15px rgba(26, 198, 206, 0.2);
    transition: all 0.3s ease;
}

.btn-glow:hover {
    background: transparent;
    color: var(--primary-glow);
    border: 1px solid var(--primary-glow);
    box-shadow: 0 4px 25px rgba(26, 198, 206, 0.4);
}

.btn-outline-glow {
    background: transparent;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.75rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-outline-glow:hover {
    border-color: var(--primary-glow);
    color: var(--primary-glow);
    background: rgba(26, 198, 206, 0.05);
}

.btn-solid-glow {
    background: var(--primary-glow);
    color: var(--dark-bg);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.75rem;
    border-radius: 4px;
    border: 1px solid var(--primary-glow);
    box-shadow: 0 4px 20px rgba(26, 198, 206, 0.35);
    transition: all 0.3s ease;
}

.btn-solid-glow:hover,
.btn-solid-glow:focus {
    background: #16b0b7;
    border-color: #16b0b7;
    color: var(--dark-bg);
    box-shadow: 0 6px 28px rgba(26, 198, 206, 0.5);
}

.btn-solid-glow:disabled {
    opacity: 0.5;
    box-shadow: none;
}

/* Surfaces */
.panel {
    background: var(--light-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
}

.panel-tight {
    padding: 1.25rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(26, 198, 206, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Form controls on dark backgrounds */
.form-control-dark {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #ffffff;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    width: 100%;
}

.form-control-dark::placeholder {
    color: rgba(163, 194, 198, 0.5);
}

.form-control-dark:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary-glow);
    color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 198, 206, 0.15);
}

.form-control-dark::file-selector-button {
    background: rgba(26, 198, 206, 0.12);
    border: 1px solid var(--border-color);
    color: var(--primary-glow);
    border-radius: 3px;
    padding: 0.3rem 0.8rem;
    margin-right: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.field-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

/* Code / protocol trace */
pre.trace {
    background: rgba(2, 12, 15, 0.8);
    border: 1px solid var(--border-color);
    color: #d7f3f5;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.78rem;
    max-height: 340px;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.divider-or {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 1.25rem 0;
}

.divider-or::before,
.divider-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    font-size: 0.9rem;
}

/* The title is long, so its size steps with Bootstrap's container widths to hold a
   single line from the lg breakpoint up. Below that it wraps, and the nowrap span
   in the markup keeps "QR Code Reader" intact wherever the break lands. */
section.hero h1 {
    font-size: 1.75rem;
}

@media (min-width: 992px) {
    section.hero h1 {
        font-size: 2rem;
    }
}

@media (min-width: 1200px) {
    section.hero h1 {
        font-size: 2.4rem;
    }
}

@media (min-width: 1400px) {
    section.hero h1 {
        font-size: 2.8rem;
    }
}

/* Hero marketing image */
.qr-container {
    width: 100%;
    text-align: center;
}

.qr-code {
    width: 100%;
    max-width: 400px;
}

/* Sample SMART Health Link offered next to the scanner */
.sample-qr {
    background: #ffffff;
    border-radius: 10px;
    padding: 0.75rem;
    width: 100%;
    max-width: 190px;
}

.sample-qr img {
    display: block;
    width: 100%;
    height: auto;
}

/* Camera viewport */
#reader {
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    margin-bottom: 1rem;
}

#reader video {
    width: 100% !important;
    display: block;
}

/* Result rendering */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.summary-item .field-label {
    margin-bottom: 0.25rem;
}

.summary-item .value {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.resource-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 0.88rem;
}

.resource-list li:last-child {
    border-bottom: none;
}

.step-marker {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(26, 198, 206, 0.12);
    border: 1px solid var(--border-color);
    color: var(--primary-glow);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

details.trace-details summary {
    cursor: pointer;
    color: var(--primary-glow);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    list-style: none;
}

details.trace-details summary::-webkit-details-marker {
    display: none;
}

details.trace-details summary::before {
    content: "▸ ";
}

details.trace-details[open] summary::before {
    content: "▾ ";
}

/* Video Popup Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: #000000;
    width: 100%;
    max-width: 800px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.modal-overlay .btn-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.5rem;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: background 0.2s ease;
}

.modal-overlay .btn-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 991px) {
    .qr-container {
        padding: 0;
    }
}

@media (max-width: 767px) {

    html,
    body {
        scroll-behavior: auto !important;
        scroll-padding-top: 170px;
    }

    .content-area {
        margin-top: 25px !important;
    }
}
