:root {
    --ios-blue: #007aff;
    --ios-blue-active: #007aff;
    --bg-site: #ffffff;

    /* Light Mode values (Default Day mode) */
    --ios-gray-btn: rgba(0, 0, 0, 0.05);
    --ios-gray-btn-hover: rgba(0, 0, 0, 0.1);
    --modal-bg: rgba(255, 255, 255, 0.82);
    --modal-border: rgba(0, 0, 0, 0.08);
    --overlay-bg: rgba(0, 0, 0, 0.3);
    --text-main: #000000;
    --text-sub: rgba(0, 0, 0, 0.65);
    
    --slider-bg: rgba(255, 255, 255, 0.75);
    --slider-border: rgba(0, 0, 0, 0.08);
    --slider-text-color: rgba(0, 0, 0, 0.55);
    --slider-text-shimmer: linear-gradient(90deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.85) 30%, #007aff 50%, rgba(0, 0, 0, 0.85) 70%, rgba(0, 0, 0, 0.4) 100%);
    --slider-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* Dark Mode overrides (Night mode) - supports system preferences */
@media (prefers-color-scheme: dark) {
    :root {
        --ios-gray-btn: rgba(255, 255, 255, 0.12);
        --ios-gray-btn-hover: rgba(255, 255, 255, 0.2);
        --modal-bg: rgba(28, 28, 30, 0.85);
        --modal-border: rgba(255, 255, 255, 0.12);
        --overlay-bg: rgba(0, 0, 0, 0.5);
        --text-main: #ffffff;
        --text-sub: rgba(255, 255, 255, 0.65);

        --slider-bg: rgba(28, 28, 30, 0.85);
        --slider-border: rgba(255, 255, 255, 0.12);
        --slider-text-color: rgba(255, 255, 255, 0.55);
        --slider-text-shimmer: linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.85) 30%, #007aff 50%, rgba(255, 255, 255, 0.85) 70%, rgba(255, 255, 255, 0.4) 100%);
        --slider-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    }
}

/* Explicit class-based dark mode override (set via JS script) */
body.dark-theme {
    --ios-gray-btn: rgba(255, 255, 255, 0.12);
    --ios-gray-btn-hover: rgba(255, 255, 255, 0.2);
    --modal-bg: rgba(28, 28, 30, 0.85);
    --modal-border: rgba(255, 255, 255, 0.12);
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --text-main: #ffffff;
    --text-sub: rgba(255, 255, 255, 0.65);

    --slider-bg: rgba(28, 28, 30, 0.85);
    --slider-border: rgba(255, 255, 255, 0.12);
    --slider-text-color: rgba(255, 255, 255, 0.55);
    --slider-text-shimmer: linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.85) 30%, #007aff 50%, rgba(255, 255, 255, 0.85) 70%, rgba(255, 255, 255, 0.4) 100%);
    --slider-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

body.light-theme {
    --ios-gray-btn: rgba(0, 0, 0, 0.05);
    --ios-gray-btn-hover: rgba(0, 0, 0, 0.1);
    --modal-bg: rgba(255, 255, 255, 0.82);
    --modal-border: rgba(0, 0, 0, 0.08);
    --overlay-bg: rgba(0, 0, 0, 0.3);
    --text-main: #000000;
    --text-sub: rgba(0, 0, 0, 0.65);
    
    --slider-bg: rgba(255, 255, 255, 0.75);
    --slider-border: rgba(0, 0, 0, 0.08);
    --slider-text-color: rgba(0, 0, 0, 0.55);
    --slider-text-shimmer: linear-gradient(90deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.85) 30%, #007aff 50%, rgba(0, 0, 0, 0.85) 70%, rgba(0, 0, 0, 0.4) 100%);
    --slider-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-site);
    color: #1d1d1f;
    width: 100%;
    min-height: 150dvh;
    overflow-x: hidden;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
}

/* Premium white-themed background landing page layout */
.site-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: calc(88px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
    z-index: 1;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 122, 255, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 122, 255, 0.03) 0%, transparent 40%),
        linear-gradient(rgba(240, 240, 245, 0.6) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 240, 245, 0.6) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}

header.top-nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(52px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background-color: #000000;
    color: #ffffff;
    display: flex;
    align-items: center;
    padding-left: calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
    z-index: 100;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-branding {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #ffffff;
}

.header-logo-img {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: block;
    object-fit: cover;
}

/* Apple-style terms typography and layout */
.terms-container {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 0 4px calc(150px + env(safe-area-inset-bottom)) 4px;
    -webkit-overflow-scrolling: touch;
    text-align: left;
}

.terms-main-title {
    font-size: 26px;
    font-weight: 800;
    color: #000000;
    letter-spacing: -0.8px;
    line-height: 1.15;
    margin-bottom: 8px;
}

.terms-subtitle {
    font-size: 15px;
    color: #86868b;
    line-height: 1.4;
    margin-bottom: 16px;
}

.terms-bullets {
    list-style: none;
    margin-bottom: 24px;
    padding-left: 0;
}

.terms-bullets li {
    font-size: 15px;
    color: #86868b;
    line-height: 1.45;
    margin-bottom: 12px;
    position: relative;
    padding-left: 18px;
}

.terms-bullets li::before {
    content: "•";
    position: absolute;
    left: 4px;
    color: #86868b;
}

.email-link {
    font-size: 15px;
    color: #007aff;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 32px;
}

.email-link:hover {
    text-decoration: underline;
}

.envelope-icon {
    display: inline-block;
    vertical-align: middle;
}

.terms-page-indicator {
    font-size: 13px;
    font-weight: 600;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.terms-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
    letter-spacing: -0.3px;
    margin-bottom: 24px;
}

.terms-heading {
    font-size: 15px;
    font-weight: 700;
    color: #000000;
    margin-top: 28px;
    margin-bottom: 12px;
}

.terms-subheading {
    font-size: 14px;
    font-weight: 700;
    color: #000000;
    margin-top: 20px;
    margin-bottom: 8px;
}

.terms-paragraph {
    font-size: 14px;
    color: #1d1d1f;
    line-height: 1.5;
    margin-bottom: 16px;
}

.terms-meta-date {
    font-size: 13px;
    color: #86868b;
    margin-bottom: 12px;
}

.terms-action-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px 24px calc(16px + env(safe-area-inset-bottom)) 24px;
    background: linear-gradient(to top, rgba(255, 255, 255, 1) 75%, rgba(255, 255, 255, 0.8) 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.terms-btn {
    width: 100%;
    height: 50px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
}

.terms-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.terms-btn-primary {
    background-color: #007aff;
    color: #ffffff;
    font-weight: 700;
}

.terms-btn-secondary {
    background-color: #f2f2f7;
    color: #007aff;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Centered overlay with fade animation */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-bg);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
    animation: overlayFadeIn 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.overlay.hidden {
    display: none;
}

/* Frosted Glass iOS modal with scale/fade entry */
.glass-modal {
    width: 68vw;
    background: var(--modal-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--modal-border);
    border-radius: 7vw;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
    padding: 16vw 6.4vw;
    display: flex;
    flex-direction: column;
    animation: modalScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform-origin: center;
}

/* Typography spacing & weight */
.brand-title {
    font-size: 5.6vw;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-main);
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 3.2vw;
    text-align: left;
}

.body-text {
    font-size: 3.7vw;
    line-height: 1.45;
    color: var(--text-sub);
    margin-bottom: 6.4vw;
    text-align: left;
    font-weight: 400;
}

/* Apple Maps container inside frosted modal */
.california-map {
    width: 100%;
    height: 52vw;
    background-color: #0c1626; /* Deep ocean navy */
    border-radius: 4.8vw;
    margin-bottom: 6.4vw;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.california-map svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Concentric pulse on the map */
.map-pulse {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #ff3b30;
    border-radius: 50%;
    box-shadow: 0 0 6px #ff3b30;
}
.map-pulse.animate-move {
    transition: top 1.5s cubic-bezier(0.25, 1, 0.5, 1), left 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.map-pulse::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 1.5px solid #ff3b30;
    border-radius: 50%;
    animation: pulse-ring-new 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring-new {
    0% { transform: scale(0.3); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* Side-by-side pill buttons container */
.button-group {
    display: flex;
    gap: 3.2vw;
    width: 100%;
}

.btn {
    flex: 1;
    height: 13.3vw;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6.6vw;
    font-size: 4vw;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
    outline: none;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-secondary {
    background-color: var(--ios-gray-btn);
    color: var(--text-main);
    font-weight: 500;
}

.btn-secondary:hover {
    background-color: var(--ios-gray-btn-hover);
}

.btn-primary {
    background-color: var(--ios-blue);
    color: #ffffff;
    font-weight: 700;
}

.btn-primary:hover {
    background-color: var(--ios-blue-active);
}

/* Apple tap scale feedback */
.btn:active {
    transform: scale(0.96);
    opacity: 0.85;
}

/* Disabled state */
.btn[disabled] {
    opacity: 0.45 !important;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
}

/* Floating action button to restore modal if dismissed */
.restore-trigger {
    position: fixed;
    top: 24px;
    right: 24px;
    background-color: #1d1d1f;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    transform: translateY(-100px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s;
}

.restore-trigger.visible {
    transform: translateY(0);
    opacity: 1;
}

.glass-modal.hidden {
    display: none;
}

.modal-exit {
    animation: modalScaleOut 0.1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.zoom-in {
    animation: iosZoomIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.zoom-out {
    animation: iosZoomOut 0.25s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes iosZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes iosZoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.85);
    }
}

@keyframes modalScaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Apple-style Bottom Slider wrapper */
.slider-wrapper {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translate(-50%, 180%);
    width: 82vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    z-index: 1100;
    transition: transform 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
}

.slider-wrapper.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.apple-slider {
    width: 100%;
    height: 17vw;
    background-color: var(--slider-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--slider-border);
    border-radius: 8.5vw;
    padding: 1.1vw;
    position: relative;
    user-select: none;
    overflow: hidden;
    box-shadow: var(--slider-shadow);
}

.slider-track {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-text {
    font-size: 4.2vw;
    font-weight: 600;
    color: var(--slider-text-color);
    letter-spacing: -0.2px;
    text-transform: lowercase;
    pointer-events: none;
    background: var(--slider-text-shimmer);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer-text 2.2s infinite linear;
}

@keyframes shimmer-text {
    0% { background-position: -150px 0; }
    100% { background-position: 150px 0; }
}

.slider-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 14.8vw;
    height: 14.8vw;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
}

.slider-handle:active {
    cursor: grabbing;
}

.slider-handle svg {
    width: 5.8vw;
    height: 5.8vw;
}

/* Animation frames */
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Clamp sizing on larger viewports so they remain elegant and fixed */
@media (min-width: 440px) {
    .glass-modal {
        width: 100%;
        max-width: 330px;
        padding: 36px 24px;
        border-radius: 28px;
    }
    .brand-title {
        font-size: 21px;
        margin-bottom: 12px;
    }
    .body-text {
        font-size: 14px;
        margin-bottom: 24px;
    }
    .california-map {
        height: 180px;
        margin-bottom: 24px;
        border-radius: 18px;
    }
    .button-group {
        gap: 12px;
    }
    .btn {
        height: 50px;
        border-radius: 25px;
        font-size: 15px;
    }
}



/* Full-screen Request Stopped Popup */
.full-screen-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: var(--modal-bg);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: overlayFadeIn 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.full-screen-popup.hidden {
    display: none;
}

.stopped-content {
    background: transparent;
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: modalScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stopped-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.stopped-text {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-sub);
    margin-bottom: 32px;
}

.stopped-btn {
    width: 100%;
    max-width: 240px;
    height: 50px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 700;
    background-color: var(--ios-blue);
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.stopped-btn:active {
    transform: scale(0.96);
    opacity: 0.85;
}

/* Gentle shake animation for Report button */
@keyframes gentleShakeLoop {
    0%, 100%, 30% { transform: translateX(0); }
    5%, 15%, 25% { transform: translateX(-3px); }
    10%, 20% { transform: translateX(3px); }
}

.shake-button {
    animation: gentleShakeLoop 2s infinite ease-in-out;
}

