﻿:root {
    --bg: #0f1115;
    --ink: #e8edf2;
    --muted: #98a2ad;
    --brand: #2fe88a;
    --line: #2a3140;
    --danger: #ff4757;
    --danger-soft: rgba(255,71,87,.25);
}

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

html, body {
    height: 100%;
    margin: 0;
}

body {
    color: var(--ink);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    display: block;
    width: 100%;
}

.hero {
    position: relative;
    width: 100vw;
    height: 100dvh;
    background: #0d1016;
    overflow: hidden;
}

/* Hero images: Adaptive fit - contain or cover based on coverage */
.hero-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transition: opacity 900ms ease;
    z-index: 0;
}

    .hero-layer.on {
        opacity: 1;
    }

    /* Stretch to fill when coverage is >= 80% */
    .hero-layer.stretch {
        object-fit: cover;
    }

/* Desktop/Tablet: Add border, preserve entire image */
@media (min-width: 768px) {
    html {
        transform: none !important;
    }

    .hero {
        padding: 2.5vh 2.5vw;
        background: var(--bg);
    }

    .hero-layer {
        top: 2.5vh;
        left: 2.5vw;
        width: 95vw;
        height: 95vh;
        object-fit: contain;
        border: 3px solid var(--line);
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    }

        .hero-layer.stretch {
            object-fit: cover;
        }
}

/* Large desktop */
@media (min-width: 1440px) {
    .hero {
        padding: 5vh 5vw;
    }

    .hero-layer {
        top: 5vh;
        left: 5vw;
        width: 90vw;
        height: 90vh;
    }
}

.overlay-form {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: clamp(280px, 90vw, 420px);
    max-width: 95%;
    background: rgba(18,22,30,0.73);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.7);
    padding: clamp(16px, 4vw, 24px);
    backdrop-filter: saturate(120%) blur(10px);
    -webkit-backdrop-filter: saturate(120%) blur(10px);
    z-index: 10;
    transition: all 0.3s ease;
}

/* Form content wrapper for fade out */
.form-content {
    transition: opacity 0.3s ease;
}

.overlay-form.loading .form-content {
    opacity: 0;
    pointer-events: none;
}

/* Loading state */
.loading-state {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay-form.loading .loading-state {
    opacity: 1;
    pointer-events: all;
}

/* Swirling loader animation */
.loader {
    width: 80px;
    height: 80px;
    position: relative;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--brand);
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    transition: border-top-color 0.3s ease;
}

    .loader-ring:nth-child(2) {
        width: 90%;
        height: 90%;
        top: 5%;
        left: 5%;
        border-top-color: rgba(47, 232, 138, 0.6);
        animation-delay: -0.4s;
        animation-duration: 1.5s;
    }

    .loader-ring:nth-child(3) {
        width: 80%;
        height: 80%;
        top: 10%;
        left: 10%;
        border-top-color: rgba(47, 232, 138, 0.3);
        animation-delay: -0.8s;
        animation-duration: 1.8s;
    }

/* Error state - red spinner */
.overlay-form.error .loader-ring {
    border-top-color: var(--danger);
}

    .overlay-form.error .loader-ring:nth-child(2) {
        border-top-color: rgba(255, 71, 87, 0.6);
    }

    .overlay-form.error .loader-ring:nth-child(3) {
        border-top-color: rgba(255, 71, 87, 0.3);
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 24px;
    font-size: clamp(14px, 3.5vw, 16px);
    color: var(--muted);
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.copy {
    text-align: center;
    margin-bottom: 0;
}

    .copy h1 {
        margin: 0 0 9px 0;
        font-size: clamp(24px, 6vw, 36px);
        line-height: 1;
        text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }

    .copy .tagline {
        margin: 0 auto -16px auto;
        font-size: clamp(13px, 3.2vw, 15px);
        color: var(--muted);
        line-height: 1;
        text-shadow: 0 1px 4px rgba(0,0,0,0.4);
        opacity: 1;
        max-height: 50px;
        overflow: hidden;
        transition: opacity 0.5s ease;
    }

        .copy .tagline.fade-out {
            opacity: 0;
        }

.overlay-form.expanded .copy .tagline {
    max-height: 0;
    opacity: 0;
    margin: 0;
}

.copy p {
    margin: 4px auto 0;
    max-width: 56ch;
    font-size: clamp(14px, 3.5vw, 16px);
    color: var(--muted);
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

    .copy p.fade-out {
        opacity: 0;
    }

.overlay-form.expanded .copy p {
    max-height: 200px;
    opacity: 1;
    margin: 4px auto 0;
}

.field {
    margin: 0;
}

/* Error message box */
.error-message {
    margin-bottom: 8px;
    padding: 10px 12px;
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid var(--danger);
    border-radius: 8px;
    color: var(--danger);
    font-size: clamp(13px, 3vw, 14px);
    font-weight: 600;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

    .error-message.visible {
        max-height: 100px;
        opacity: 1;
        margin-bottom: 8px;
    }

/* Phone wrapper with +1 prefix */
.phone-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 11px 13px;
    border-radius: 10px;
    border: 2px solid #e6e9ef;
    overflow: hidden;
    min-height: 44px;
}

    /* Canvas background layer - browsers cannot override canvas pixel data */
    .phone-wrapper canvas {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 0;
    }

.phone-prefix {
    position: relative;
    z-index: 1;
    color: #0d1016;
    font-size: clamp(15px, 3.5vw, 16px);
    font-weight: 600;
    margin-right: 4px;
    user-select: none;
}

.phone-wrapper input {
    position: relative;
    z-index: 1;
    flex: 1;
    border: none;
    outline: none;
    background: transparent !important;
    background-color: transparent !important;
    color: #0d1016 !important;
    font-size: clamp(15px, 3.5vw, 16px);
    padding: 0;
    -webkit-text-fill-color: #0d1016 !important;
}

.btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #072014;
    font-weight: 700;
    font-size: clamp(15px, 3.5vw, 16px);
    cursor: pointer;
    margin-top: 18px;
    min-height: 44px;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(47, 232, 138, 0.3);
    }

    .btn:active {
        transform: translateY(0);
    }

.consent {
    margin-top: 14px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #444;
    background: rgba(0,0,0,.2);
    display: flex;
    gap: 8px;
    align-items: flex-start;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 10px;
    margin-top: 0;
}

.overlay-form.expanded .consent {
    max-height: 200px;
    opacity: 1;
    padding: 10px;
    margin-top: 14px;
}

.consent.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-soft);
}

/* Checkbox styling */
.consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    accent-color: var(--brand);
    transition: outline 0.2s ease, box-shadow 0.2s ease;
    margin-top: 2px;
}

/* Red outline and glow for invalid checkbox */
.consent.invalid input[type="checkbox"] {
    outline: 2px solid var(--danger);
    box-shadow: 0 0 0 4px var(--danger-soft);
}

.consent label {
    font-size: clamp(13px, 3vw, 14px);
    line-height: 1.4;
}

/* Terms link same color as button, no underline, never changes color */
.consent a,
.consent a:visited,
.consent a:hover,
.consent a:active,
.consent a:focus {
    color: var(--brand) !important;
    text-decoration: none !important;
    outline: none;
    font-weight: 700;
    cursor: pointer;
}

.foot {
    margin-top: 24px;
    text-align: center;
    opacity: 1;
    max-height: 100px;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.overlay-form.expanded .foot {
    max-height: 100px;
    opacity: 1;
    margin-top: 24px;
}

.foot a {
    color: #9fb0bf;
    margin: 0 8px;
    font-size: clamp(12px, 3vw, 13px);
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    padding: 8px 4px;
}

    .foot a:hover {
        text-decoration: underline;
    }

/* Terms overlay */
.terms-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

    .terms-overlay.visible {
        display: flex;
    }

.terms-content {
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: clamp(20px, 5vw, 40px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.terms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

    .terms-header h2 {
        margin: 0;
        font-size: clamp(22px, 5vw, 28px);
        color: var(--ink);
    }

.close-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--ink);
    font-size: 20px;
    font-weight: 700;
    padding: 0;
}

    .close-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: var(--brand);
        transform: scale(1.05);
    }

.terms-body {
    color: var(--muted);
    line-height: 1.7;
    font-size: clamp(14px, 3.5vw, 16px);
}

    .terms-body h3 {
        color: var(--ink);
        margin-top: 24px;
        margin-bottom: 12px;
        font-size: clamp(18px, 4vw, 20px);
    }

    .terms-body p {
        margin: 12px 0;
    }

    /* Style all links in overlay bodies with brand green color */
    .terms-body a,
    .terms-body a:visited {
        color: var(--brand);
        text-decoration: none;
        font-weight: 600;
    }

    .terms-body a:hover,
    .terms-body a:focus {
        color: var(--brand);
        text-decoration: underline;
    }

    .terms-body ul {
        margin: 12px 0;
        padding-left: 24px;
    }

    .terms-body li {
        margin: 8px 0;
    }

/* Responsive breakpoints for optimal sizing */
@media (max-width: 375px) {
    .overlay-form {
        width: 92%;
        padding: 14px;
    }
}

@media (min-width: 768px) {
    .overlay-form {
        width: clamp(380px, 50vw, 460px);
        padding: 24px;
        background: rgba(18,22,30,0.78);
    }
}

@media (min-width: 1024px) {
    .overlay-form {
        width: 420px;
    }
}

/* Force desktop layout on tablets even in landscape - NO rotation effects */
@media (min-width: 768px) and (orientation: landscape) {
    html, body {
        transform: none !important;
        width: 100vw !important;
        height: 100vh !important;
    }
}

/* Landscape mobile phones only */
@media (max-width: 767px) and (max-height: 600px) and (orientation: landscape) {
    .overlay-form {
        max-height: 90vh;
        overflow-y: auto;
        padding: 12px;
    }

    .copy h1 {
        font-size: 22px;
    }

    .copy p {
        font-size: 13px;
    }
}

/* Hero Arrow Button */
.hero-arrow {
    position: fixed;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(47, 232, 138, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #072014;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

    .hero-arrow:hover {
        background: rgba(47, 232, 138, 1);
        transform: translateX(-50%) translateY(-4px);
        box-shadow: 0 8px 20px rgba(47, 232, 138, 0.4);
    }

    .hero-arrow svg {
        width: 24px;
        height: 24px;
    }

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-8px);
    }
}

/* Desktop/Tablet positioning */
@media (min-width: 768px) {
    .hero-arrow {
        bottom: calc(2.5vh + 5px);
    }
}

@media (min-width: 1440px) {
    .hero-arrow {
        bottom: calc(5vh + 5px);
    }
}

/* Expanded Content Section */
.expanded-content {
    position: relative;
    background: var(--bg);
    min-height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

    .expanded-content.visible {
        opacity: 1;
        visibility: visible;
    }

.content-container {
    padding: clamp(40px, 8vw, 80px) clamp(20px, 5vw, 40px);
    max-width: 1200px;
    margin: 0 auto;
}

    .content-container h2 {
        color: var(--ink);
        font-size: clamp(28px, 6vw, 42px);
        margin-bottom: clamp(30px, 6vw, 50px);
        text-align: center;
    }

    .content-container > h3 {
        color: var(--ink);
        font-size: clamp(24px, 5vw, 32px);
        margin: clamp(40px, 6vw, 60px) 0 clamp(20px, 4vw, 30px) 0;
        text-align: center;
    }

.content-intro {
    margin-bottom: clamp(30px, 6vw, 50px);
}

    .content-intro p {
        color: var(--muted);
        font-size: clamp(15px, 3.5vw, 17px);
        line-height: 1.7;
        margin-bottom: 20px;
    }

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(20px, 4vw, 30px);
    margin-bottom: clamp(40px, 6vw, 60px);
}

.content-card {
    background: rgba(42, 49, 64, 0.4);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: clamp(20px, 4vw, 30px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .content-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(47, 232, 138, 0.15);
        border-color: var(--brand);
    }

    .content-card h3 {
        color: var(--brand);
        font-size: clamp(18px, 4vw, 22px);
        margin: 0 0 12px 0;
    }

    .content-card p {
        color: var(--muted);
        font-size: clamp(14px, 3.5vw, 16px);
        line-height: 1.6;
        margin: 0 0 12px 0;
    }

        .content-card p:last-child {
            margin-bottom: 0;
        }

.content-section {
    margin: clamp(40px, 6vw, 60px) 0;
}

    .content-section h3 {
        color: var(--ink);
        font-size: clamp(22px, 5vw, 28px);
        margin-bottom: clamp(20px, 4vw, 30px);
    }

    .content-section p {
        color: var(--muted);
        font-size: clamp(15px, 3.5vw, 16px);
        line-height: 1.7;
        margin-bottom: 20px;
    }

        .content-section p strong {
            color: var(--brand);
            font-weight: 600;
        }

.content-features {
    background: rgba(47, 232, 138, 0.05);
    border: 1px solid rgba(47, 232, 138, 0.2);
    border-radius: 12px;
    padding: clamp(24px, 5vw, 40px);
}

    .content-features h3 {
        color: var(--ink);
        font-size: clamp(20px, 4vw, 26px);
        margin: 0 0 20px 0;
        text-align: center;
    }

    .content-features ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
    }

    .content-features li {
        color: var(--muted);
        font-size: clamp(14px, 3.5vw, 16px);
        padding: 8px 0;
    }
/* Make hero images scrollable when content expands */
.hero-layer.scrollable {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: -1 !important;
}

/* Desktop/Tablet scrollable adjustments */
@media (min-width: 768px) {
    .hero-layer.scrollable {
        top: 2.5vh !important;
        left: 2.5vw !important;
        z-index: -1 !important;
    }
}

@media (min-width: 1440px) {
    .hero-layer.scrollable {
        top: 5vh !important;
        left: 5vw !important;
        z-index: -1 !important;
    }
}
