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

:root {
    color-scheme: dark;
    --bg:           #0d0d0d;
    --surface:      rgba(255, 255, 255, 0.04);
    --surface-high: rgba(255, 255, 255, 0.07);
    --border:       rgba(74, 222, 128, 0.18);
    --border-focus: rgba(74, 222, 128, 0.6);
    --primary:      #4ade80;
    --primary-dim:  #22c55e;
    --text:         #f5f5f5;
    --text-muted:   #a8a8a8;
    --text-dim:     rgba(255, 255, 255, 0.42);
    --muted:        #86efac;
    --dim:          rgba(240, 253, 244, 0.5);
    --error:        #f87171;
    --radius:       12px;
    --radius-sm:    8px;
}

html {
    scroll-behavior: smooth;
}

/* ── Site header (brand + badge, centered above grid) ── */
.site-header {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
}

.site-header .badge {
    align-self: center;
}

.brand-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.brand-left,
.brand-right {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.brand-left  { text-align: right; }
.brand-right { text-align: left; }

.brand-emoji {
    font-size: 2.2rem;
    line-height: 1;
    padding: 0 0.3em;
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ── Success page body overrides ── */

.success-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem 3rem;
}

/* ══════════════════════════════════════════════
   Index page
══════════════════════════════════════════════ */

/* ── Layout ── */
.page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
    gap: 3rem;
    align-items: start;
}

/* ── Hero ── */
.hero {
    padding-top: 0.1rem;
}

.feature-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.feature-icon svg {
    width: 15px;
    height: 15px;
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
    margin-bottom: 0;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

.hero-headline {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 1rem;
}

.hero-headline span {
    background: linear-gradient(135deg, var(--primary) 0%, #86efac 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 420px;
}

.features {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.feature-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.feature-text span {
    font-size: 0.82rem;
    color: var(--text-dim);
}

/* ── Form card ── */
.form-section {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.form-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.25rem;
}

.form-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1.75rem;
}

/* ── Fields ── */
.field {
    margin-bottom: 1.1rem;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    color: var(--text);
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.22);
}

/* ── Revit versions ── */
.versions-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.versions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.version-chip input[type="checkbox"] {
    display: none;
}

.version-chip label {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.15s;
    margin: 0;
    user-select: none;
}

.version-chip input:checked+label {
    background: rgba(74, 222, 128, 0.15);
    border-color: var(--primary-dim);
    color: var(--primary);
}

.version-chip label:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.65);
}

.versions-error {
    font-size: 0.76rem;
    color: var(--error);
    margin-top: 0.35rem;
    display: none;
}

/* ── Checkboxes ── */
.check-field {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.check-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 0.15rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.check-field label {
    font-size: 0.79rem;
    color: var(--text-dim);
    margin: 0;
    line-height: 1.5;
    cursor: pointer;
}

/* ── Submit ── */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-dim) 0%, var(--primary) 100%);
    color: #052e16;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover:not(:disabled) { opacity: 0.9; }
.submit-btn:active:not(:disabled) { transform: scale(0.99); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(5, 46, 22, 0.3);
    border-top-color: #052e16;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

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

/* ── Alerts ── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    margin-bottom: 1rem;
    display: none;
}

.alert-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #fca5a5;
}

/* ── Divider ── */
.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 1.25rem 0;
}

/* ── Footer note ── */
.form-footer {
    text-align: center;
    font-size: 0.74rem;
    color: var(--text-dim);
    margin-top: 1rem;
    line-height: 1.5;
}

/* ── Honeypot ── */
.hp-field {
    display: none !important;
}

/* ── Hide reCAPTCHA floating badge (attribution kept in form footer) ── */
.grecaptcha-badge {
    visibility: hidden !important;
}

/* ── reCAPTCHA notice ── */
.recaptcha-notice {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    line-height: 1.5;
}

.recaptcha-notice a {
    color: var(--text-dim);
    text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 720px) {
    .site-header {
        padding: 1.5rem 1.25rem 1rem;
    }

    .page {
        grid-template-columns: 1fr;
        padding: 0 1.25rem 2rem;
        gap: 2rem;
    }

    .hero {
        text-align: center;
        padding-top: 0;
    }

    .hero-sub {
        margin-left: auto;
        margin-right: auto;
    }

    .features {
        max-width: 380px;
        margin: 0 auto;
        text-align: left;
    }

    .form-section { justify-content: stretch; }
    .form-card { max-width: 100%; }
}

/* ══════════════════════════════════════════════
   Success page
══════════════════════════════════════════════ */

.card {
    max-width: 480px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    text-align: center;
    backdrop-filter: blur(24px);
}

.check-circle {
    width: 72px;
    height: 72px;
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.75rem;
}

.check-circle svg {
    width: 36px;
    height: 36px;
    color: var(--primary);
}

.card h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.sub {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.info-box {
    background: rgba(74, 222, 128, 0.06);
    border: 1px solid rgba(74, 222, 128, 0.15);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    text-align: left;
    margin-bottom: 1.25rem;
}

.info-box p {
    font-size: 0.84rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.info-box p + p { margin-top: 0.5rem; }
.info-box strong { color: var(--text); }

/* ── Spam alert ── */
.spam-alert {
    background: rgba(251, 191, 36, 0.07);
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 10px;
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 2rem;
    text-align: left;
}

.spam-alert svg {
    width: 18px;
    height: 18px;
    color: #fbbf24;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.spam-alert p {
    font-size: 0.84rem;
    color: rgba(251, 191, 36, 0.85);
    line-height: 1.6;
}

.spam-alert strong { color: #fbbf24; }

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.back-btn:hover { opacity: 0.75; }
