/* ==========================================================================
   RigBook Landing Page
   Design System based on Mobile App
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* Color Palette */
    --color-bg: #0D0D0F;
    --color-surface: #1A1A1F;
    --color-surface-light: #252530;
    --color-surface-elevated: #2A2A35;

    /* Brand Colors */
    --color-accent: #F7B731;
    --color-accent-dim: #8B6914;
    --color-accent-glow: rgba(247, 183, 49, 0.15);

    /* Safety Colors */
    --color-safe: #26DE81;
    --color-caution: #FD9644;
    --color-danger: #FC5C65;
    --color-water: #4A90D9;

    /* Text Colors */
    --color-text: #FFFFFF;
    --color-text-secondary: #A0A0B0;
    --color-text-muted: #606070;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--color-accent-glow);
}

/* --------------------------------------------------------------------------
   Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.landing {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Ambient Background
   -------------------------------------------------------------------------- */
.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.ambient__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
}

.ambient__glow--gold {
    width: 600px;
    height: 600px;
    background: var(--color-accent);
    top: -200px;
    right: -100px;
    opacity: 0.08;
    animation: float 20s ease-in-out infinite;
}

.ambient__glow--green {
    width: 500px;
    height: 500px;
    background: var(--color-safe);
    bottom: -150px;
    left: -100px;
    opacity: 0.05;
    animation: float 25s ease-in-out infinite reverse;
}

.ambient__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav-bar {
    position: relative;
    z-index: 100;
    padding: var(--space-lg) 0;
}

.nav-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-bar__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--color-accent);
    transition: var(--transition-base);
}

.nav-bar__brand:hover {
    color: var(--color-text);
}

.nav-bar__logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.nav-bar__name {
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: 1px;
    color: var(--color-text);
}

.nav-bar__status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-surface-light);
    border-radius: var(--radius-full);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--color-safe);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-text {
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(38, 222, 129, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 4px rgba(38, 222, 129, 0); }
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    z-index: 1;
    padding: var(--space-3xl) 0 var(--space-4xl);
    text-align: center;
}

.hero__content {
    max-width: 680px;
    margin: 0 auto;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-surface-light);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-accent);
    margin-bottom: var(--space-lg);
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: var(--font-weight-extrabold);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 var(--space-lg);
    color: var(--color-text);
}

.hero__title--accent {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-caution) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__description {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 540px;
    margin: 0 auto var(--space-xl);
    line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Subscribe Form
   -------------------------------------------------------------------------- */
.subscribe {
    max-width: 480px;
    margin: 0 auto;
}

.subscribe__input-group {
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-surface-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xs);
    transition: var(--transition-base);
}

.subscribe__input-group:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px var(--color-accent-glow);
}

.subscribe__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    color: var(--color-text-muted);
}

.subscribe__input {
    flex: 1;
    background: none;
    border: none;
    padding: var(--space-md);
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
    outline: none;
}

.subscribe__input::placeholder {
    color: var(--color-text-muted);
}

.subscribe__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-width: 140px;
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dim) 100%);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-bg);
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.subscribe__button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.subscribe__button:active:not(:disabled) {
    transform: translateY(0);
}

.subscribe__button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.subscribe__button-loader {
    display: none;
}

.subscribe__button-arrow {
    transition: var(--transition-fast);
}

.subscribe__button:hover .subscribe__button-arrow {
    transform: translateX(4px);
}

.subscribe__button.loading .subscribe__button-text,
.subscribe__button.loading .subscribe__button-arrow {
    display: none;
}

.subscribe__button.loading .subscribe__button-loader {
    display: block;
}

.subscribe__button.loading .spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.subscribe__message {
    margin-top: var(--space-md);
    font-size: 0.9rem;
    min-height: 1.4em;
}

.subscribe__message--success {
    color: var(--color-safe);
}

.subscribe__message--error {
    color: var(--color-danger);
}

.subscribe__note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Features Section
   -------------------------------------------------------------------------- */
.features {
    position: relative;
    z-index: 1;
    padding: var(--space-2xl) 0;
}

.feature-card {
    padding: var(--space-xl);
    background: var(--color-surface);
    border: 1px solid var(--color-surface-light);
    border-radius: var(--radius-xl);
    text-align: center;
    transition: var(--transition-base);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-surface-elevated);
    box-shadow: var(--shadow-lg);
}

.feature-card__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-surface-light);
}

.feature-card__icon svg {
    width: 28px;
    height: 28px;
}

.feature-card__icon--safe {
    color: var(--color-safe);
    border-color: rgba(38, 222, 129, 0.2);
}

.feature-card__icon--caution {
    color: var(--color-caution);
    border-color: rgba(253, 150, 68, 0.2);
}

.feature-card__icon--water {
    color: var(--color-water);
    border-color: rgba(74, 144, 217, 0.2);
}

.feature-card__title {
    font-size: 1.1rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin: 0 0 var(--space-sm);
}

.feature-card__description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Preview Section (Gauge Mockup)
   -------------------------------------------------------------------------- */
.preview {
    position: relative;
    z-index: 1;
    padding: var(--space-3xl) 0;
}

.preview__device {
    max-width: 320px;
    margin: 0 auto;
    padding: var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-surface-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.preview__screen {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.preview__gauge {
    text-align: center;
}

.gauge-svg {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.gauge-arc {
    stroke-dasharray: 126;
    stroke-dashoffset: 0;
    animation: gauge-fill 2s ease-out forwards;
}

@keyframes gauge-fill {
    from { stroke-dashoffset: 126; }
    to { stroke-dashoffset: 63; }
}

.preview__stats {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-top: var(--space-lg);
}

.stat {
    text-align: center;
}

.stat__label {
    display: block;
    font-size: 0.65rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    letter-spacing: 1.5px;
    margin-bottom: var(--space-xs);
}

.stat__value {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
}

.stat__value--safe {
    color: var(--color-safe);
}

.stat__value--caution {
    color: var(--color-caution);
}

.stat__value--danger {
    color: var(--color-danger);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    position: relative;
    z-index: 1;
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--color-surface-light);
}

.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer__copyright {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
}

.footer__links {
    display: flex;
    gap: var(--space-lg);
}

.footer__link {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer__link:hover {
    color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .hero {
        padding: var(--space-2xl) 0 var(--space-3xl);
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__description {
        font-size: 1rem;
    }

    .subscribe__input-group {
        flex-direction: column;
        padding: var(--space-sm);
    }

    .subscribe__icon {
        display: none;
    }

    .subscribe__input {
        width: 100%;
        text-align: center;
    }

    .subscribe__button {
        width: 100%;
        margin-top: var(--space-sm);
    }

    .nav-bar__status {
        display: none;
    }

    .footer__inner {
        flex-direction: column;
        text-align: center;
    }

    .preview__device {
        max-width: 280px;
    }
}

@media (max-width: 576px) {
    .features .col-md-4 {
        padding-left: var(--space-md);
        padding-right: var(--space-md);
    }

    .feature-card {
        padding: var(--space-lg);
    }
}

/* ----------------------------------------------------------
   Modals & Consent Styling (RigBook Theme)
   ---------------------------------------------------------- */
.modal-content {
    background-color: var(--color-surface);
    border: 1px solid var(--color-surface-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    color: var(--color-text);
}

.modal-header {
    border-bottom: 1px solid var(--color-surface-light);
    padding: var(--space-lg);
}

.modal-footer {
    border-top: 1px solid var(--color-surface-light);
}

.modal-body {
    padding: var(--space-lg);
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body strong {
    color: var(--color-accent);
}

/* Custom styling for Klaro! to match your design tokens */
#klaro .klaro .cookie-modal .cm-modal {
    background-color: var(--color-surface) !important;
    border-radius: var(--radius-xl) !important;
    color: var(--color-text) !important;
}

#klaro .klaro .cookie-notice {
    background-color: var(--color-surface-elevated) !important;
    border: 1px solid var(--color-accent-glow) !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius-lg) !important;
}

#klaro .klaro .cm-btn.cm-btn-success {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dim) 100%) !important;
    color: var(--color-bg) !important;
    font-weight: var(--font-weight-bold) !important;
}
