:root {
    /* Palette Detour App (Light Mode - Match global.css) */
    --background: hsl(160, 67%, 99%);
    --foreground: hsl(240, 10%, 3.9%);
    --primary: hsl(152, 49%, 61%);
    --primary-foreground: hsl(0, 0%, 100%);
    --muted-foreground: hsl(215, 8%, 44%);
    --brand-light: hsl(154, 62%, 92%);
    --brand-background: hsl(160, 67%, 99%);
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 9999px; /* Rounded-full */
}

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

/* Remove mobile tap highlight / dark flash on interactive elements */
button, input, textarea, a, label, .checkbox-container, .input-container, .checkmark, .cta-button {
    /* stylelint-disable-next-line property-no-unknown */
    -webkit-tap-highlight-color: transparent; /* iOS and old WebKit */
    -webkit-touch-callout: none; /* prevent long-press callout */
    touch-action: manipulation; /* improve responsiveness on touch devices */
}

body {
    background-color: var(--brand-background);
    background-image: linear-gradient(to bottom, var(--brand-light), var(--brand-background));
    color: var(--foreground);
    font-family: var(--font-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2rem;
}

.content-wrapper {
    width: 100%;
    max-width: 480px; /* Mobile first stack width */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
}

/* --- HERO SECTION --- */
.hero-section {
    width: 100%;
}

header {
    margin-bottom: 2rem;
}

h1 {
    font-size: 3.75rem; /* text-6xl aproximation */
    font-weight: 800; /* font-extrabold */
    color: var(--primary);
    letter-spacing: -0.05em;
    line-height: 1;
}

.tagline {
    font-size: 1.25rem; /* text-xl */
    color: var(--primary);
    opacity: 0.6;
    margin-top: 0.75rem;
}

.illustration-container {
    display: flex;
    justify-content: center;
    animation: float 6s ease-in-out infinite;
}

.hero-image {
    width: 256px;
    height: 256px;
    object-fit: contain;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* --- FORM SECTION --- */
.form-section {
    width: 100%;
}

.desktop-heading {
    display: block; /* Show on mobile too for clear context */
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary); /* Green primary as requested */
    letter-spacing: -0.02em;
}

.signup-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.checkbox-container {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center; /* Aligné au milieu pour une seule ligne de texte */
    gap: 0.85rem;
    text-align: left;
    padding: 0 0.5rem;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    cursor: pointer;
}

/* Custom checkmark design */
.checkbox-container .checkmark {
    min-width: 20px;
    height: 20px;
    background-color: #fff;
    border: 2px solid hsl(240, 5.9%, 90%);
    border-radius: 6px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-container:hover .checkmark {
    border-color: var(--primary);
    background-color: hsla(152, 49%, 61%, 0.05);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-container .checkmark::after {
    content: "";
    position: absolute;
    display: none;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.checkbox-container .label-text {
    font-size: 0.85rem;
    color: var(--muted-foreground);
    line-height: 1.4;
    transition: color 0.2s ease;
}

.input-container {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    background-color: #fff;
    border: 2px solid hsl(240, 5.9%, 90%);
    border-radius: var(--radius);
    padding: 0 1rem 0 1.5rem;
    transition: all 0.2s ease;
    height: 56px;
}

.input-container:focus-within {
    border-color: var(--primary);
}

.input-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    color: var(--muted-foreground);
    transition: color 0.2s ease;
}

.input-container:focus-within .input-icon {
    color: var(--primary);
}

input[type="email"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--foreground);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

input[type="email"]::placeholder {
    color: var(--muted-foreground);
}

.cta-button {
    width: 100%; /* Match email input width for alignment */
    background-color: var(--primary);
    color: var(--primary-foreground);
    height: 56px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-button:hover {
    opacity: 0.9;
}

.cta-button:active {
    transform: scale(0.98);
}

/* Disabled visual state to prevent signups */
.cta-button[disabled],
.cta-button[aria-disabled="true"] {
    opacity: 0.65;
    background-color: hsl(0 0% 92%);
    color: hsl(240 5% 50%);
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.cta-button[disabled]:hover,
.cta-button[aria-disabled="true"]:hover {
    opacity: 0.65; /* prevent hover change */
}

.form-note {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-top: 0.5rem;
}

footer {
    padding: 2rem;
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* --- DESKTOP LAYOUT (>= 1024px) --- */
@media (min-width: 1024px) {
    .content-wrapper {
        max-width: 1280px; /* Plus large pour éviter l'effet "serré" */
        display: grid;
        grid-template-columns: 1fr 1fr; /* 50/50 pour plus d'équilibre */
        gap: 6rem; /* Plus d'espace entre les colonnes */
        text-align: left;
    }

    .hero-section {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    header {
        margin-bottom: 3rem;
    }

    h1 {
        font-size: 5rem;
    }

    .illustration-container {
        justify-content: flex-start;
        padding-left: 4rem; /* Décalage vers la droite par rapport au titre */
    }

    .hero-image {
        width: 400px;
        height: 400px;
    }

    .form-section {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .form-container {
        background: rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(10px);
        padding: 4rem;
        border-radius: 2rem;
        border: 1px solid rgba(255, 255, 255, 0.5);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
        width: 100%;
        max-width: 600px; /* Passage de 560px à 600px */
        margin-left: auto;
    }

    .desktop-heading {
        font-size: 1.75rem;
        margin-bottom: 2.5rem;
    }

    .signup-form {
        align-items: flex-start;
    }

    .cta-button {
        width: 100%; /* Full width within its container on desktop */
    }
}

@media (max-height: 700px) and (max-width: 1023px) {
    h1 { font-size: 3rem; }
    .hero-image { width: 180px; height: 180px; }
}

/* --- PREVENT OVERSCROLL AT PAGE EDGES --- */
/* Prevent the page from scrolling past top or bottom (stops the white background/rubber-band effect) */
html, body {
    height: 100%;
    overscroll-behavior-y: none; /* modern browsers */
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    background-color: var(--brand-background); /* ensure no white flash on bounce */
}
