/*
 * WindowQuote — Clean & Clear theme
 * Modern, professional landing/tool styling for window cleaners.
 * Mobile-first, token-driven, zero external dependencies.
 * NOTE: all class names / element ids referenced by js/main.js and
 * js/early-access.js are preserved (no functional changes).
 */

:root {
    /* Color palette */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --primary-border: #bfdbfe;
    --accent: #06b6d4;
    --accent-soft: #ecfeff;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #526072;
    --border: #e2e8f0;

    /* Typography */
    --font-main: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --fs-h1: clamp(2.25rem, 5.5vw, 3.25rem);
    --fs-h2: clamp(1.5rem, 3.5vw, 2rem);
    --fs-h3: 1.125rem;
    --fs-body: 1rem;
    --fs-small: 0.875rem;
    --fs-tiny: 0.8125rem;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 6px 16px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.09);

    /* Motion */
    --transition: all 0.18s ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
}

::selection {
    background: var(--primary-soft);
    color: var(--primary-hover);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

main {
    padding: 0;
}

section {
    padding: clamp(2.75rem, 6vw, 4.75rem) 0;
}

/* Header — frosted glass, sticky */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
}

.logo::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.375rem 0.125rem;
    transition: var(--transition);
}

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

/* Section titles with gradient accent bar */
section > .container > h2 {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: var(--fs-h2);
    margin-bottom: 1.5rem;
}

section > .container > h2::before {
    content: "";
    width: 5px;
    height: 1.5rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

/* Hero */
.hero {
    position: relative;
    text-align: center;
    padding: clamp(3.25rem, 8vw, 5.5rem) 0;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(720px 300px at 50% -20%, var(--primary-soft), transparent 70%),
        radial-gradient(560px 260px at 88% 12%, var(--accent-soft), transparent 70%),
        linear-gradient(180deg, #ffffff, var(--bg));
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    margin-bottom: 1.25rem;
    font-size: var(--fs-tiny);
    font-weight: 600;
    color: var(--primary-hover);
    background: var(--surface);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sm);
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.hero h1 {
    font-size: var(--fs-h1);
    margin-bottom: 1rem;
}

.hero .text-accent {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto var(--space-xl);
}

.cta-group {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(180deg, #3b75f0, var(--primary));
    color: var(--white, #ffffff);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.4), 0 6px 14px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.4), 0 10px 20px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

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

/* Keyboard focus: keep a clear ring on every interactive control. */
a:focus-visible,
button:focus-visible,
select:focus-visible,
.radio-option input:focus-visible,
.btn:focus-visible,
.btn-minus:focus-visible,
.btn-plus:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Cards */
.card {
    background: var(--surface);
    padding: clamp(1.25rem, 3vw, 2rem);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: var(--space-md);
}

/* Form controls */
.input-group {
    margin-bottom: 1.125rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

input[type="number"],
input[type="email"],
select {
    width: 100%;
    padding: 0.8125rem 0.9375rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="number"]:focus,
input[type="email"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23526072' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.5rem;
}

/* Calculator grid */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* Counter steppers */
.counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.counter input {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    padding: 0.625rem;
    -moz-appearance: textfield;
    appearance: textfield;
}

.counter input::-webkit-outer-spin-button,
.counter input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-minus,
.btn-plus {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-minus:hover,
.btn-plus:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-minus:active,
.btn-plus:active {
    transform: scale(0.96);
}

.helper-text {
    font-size: var(--fs-small);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Checkbox */
.input-group input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary);
    vertical-align: middle;
    margin-right: 0.375rem;
}

/* Result panel */
.result-area {
    position: relative;
    margin-top: 1.5rem;
    background: linear-gradient(180deg, #ffffff, var(--primary-soft));
    border-color: var(--primary-border);
    padding: 1.5rem;
    overflow: hidden;
}

.result-area::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.result-area h3 {
    font-size: var(--fs-h3);
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

#quote_display {
    font-size: clamp(2rem, 6vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--primary);
    margin: 0.25rem 0 0.5rem;
}

#breakdown_area {
    font-size: var(--fs-small);
    color: var(--text-muted);
    white-space: pre-line;
    line-height: 1.75;
}

#min-charge-notice {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 0.375rem 0.875rem;
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--primary-hover);
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-pill);
}

.result-area .btn-primary {
    width: 100%;
    margin-top: 1.5rem;
}

/* Profit results (injected by js/main.js) */
.profit-results-grid {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.profit-results-grid .input-group {
    margin-bottom: 0.75rem;
}

.profit-results-grid .input-group > label {
    font-size: var(--fs-tiny);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.profit-results-grid .input-group > div {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.profit-results-grid #p_val.profit-pos {
    color: var(--success);
}

.profit-results-grid #p_val.profit-neg {
    color: var(--danger);
}

/* Pro card */
#pro .card {
    position: relative;
    text-align: center;
    max-width: 560px;
    margin: 0 auto var(--space-md);
    background: linear-gradient(180deg, #ffffff, var(--primary-soft));
    border-color: var(--primary-border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

#pro .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.pro-price {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--primary);
    margin: var(--space-sm) 0 var(--space-xs);
}

.pro-positioning {
    margin: 0 0 var(--space-lg);
    font-weight: 600;
    color: var(--text-muted);
}

.benefit-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-lg);
    text-align: left;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.benefit-list li {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0;
}

.benefit-list li::before {
    content: "✓";
    flex: 0 0 auto;
    width: 1.375rem;
    height: 1.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--success);
    background: var(--success-soft);
    border-radius: var(--radius-pill);
}

#pro .btn-primary {
    width: 100%;
}

/* Early access form */
#early-access .card {
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#early-access .btn {
    width: 100%;
    margin-top: 0.75rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.8125rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.radio-option:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.radio-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.radio-option input {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--primary);
}

.field-error {
    color: var(--danger);
    font-size: var(--fs-small);
    margin-top: var(--space-xs);
}

input[aria-invalid="true"] {
    border-color: var(--danger);
}

#early-access-success {
    padding: 1.5rem;
    text-align: center;
    background: var(--success-soft);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-lg);
}

#early-access-success p:first-child {
    font-size: 1.125rem;
    color: var(--success);
}

/* FAQ */
#faq .card {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* Anchor offset for sticky header */
#calculator, #profit, #pro, #early-access, #faq {
    scroll-margin-top: 76px;
}

/* Footer */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: clamp(2rem, 5vw, 3rem) 0;
    text-align: center;
}

footer .container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

footer a {
    font-size: var(--fs-small);
    color: var(--text-muted);
}

footer a:hover {
    color: var(--primary);
}

/* Mobile adjustments (375px) */
@media (max-width: 375px) {
    :root {
        --fs-h1: 2rem;
        --fs-h2: 1.375rem;
    }
    .cta-group {
        flex-direction: column;
    }
    .btn {
        width: 100%;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    nav {
        gap: 0.75rem;
    }
    nav a {
        font-size: 0.875rem;
    }
    .counter {
        width: 100%;
    }
    .counter input {
        flex: 1 1 auto;
        min-width: 0;
    }
    .btn-minus,
    .btn-plus {
        flex: 0 0 48px;
    }
    header .container {
        padding: 0 1rem;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
