/* AgriBati — /acces
   Formulaire centré + collage immersif de captures (proportions natives). */

:root {
    --ba-night: #0f1a14;
    --ba-field: #1a2e22;
    --ba-moss: #3d5c45;
    --ba-leaf: #6f9a6a;
    --ba-mist: #e8f0e4;
    --ba-paper: #f7faf5;
    --ba-ink: #15241a;
    --ba-frame: #f4f1ea;
    --ba-caption: #1e2f24;
    --ba-font: "Outfit", "Segoe UI", sans-serif;
}

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

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--ba-night);
}

body {
    font-family: var(--ba-font);
    color: var(--ba-mist);
    -webkit-font-smoothing: antialiased;
}

/* ═══════════ Shell ═══════════ */
.beta-access {
    position: relative;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    background: var(--ba-field);
}

/* ═══════════ Atmosphere ═══════════ */
.beta-access__atmosphere {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.beta-access__wash {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 95% 75% at 50% 48%, #2a4534 0%, transparent 58%),
        linear-gradient(180deg, #15261c 0%, #1a2e22 42%, #0f1a14 100%);
}

.beta-access__grain {
    position: absolute;
    inset: 0;
    opacity: 0.045;
    background-image:
        linear-gradient(rgba(232, 240, 228, 0.7) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232, 240, 228, 0.7) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 80%);
}

.beta-access__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.beta-access__glow--a {
    width: 560px;
    height: 560px;
    top: -14%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(111, 154, 106, 0.2);
}

.beta-access__glow--b {
    width: 480px;
    height: 480px;
    bottom: -20%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(61, 92, 69, 0.3);
}

/* Halo sombre derrière le formulaire uniquement — laisse les captures respirer */
.beta-access__dim {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 34% 46% at 50% 52%, rgba(6, 12, 9, 0.72) 0%, rgba(6, 12, 9, 0.28) 42%, transparent 68%);
}

/* ═══════════ Collage immersif ═══════════ */
.beta-access__showcase {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.beta-access__shot {
    --rot: 0deg;
    --frame: #f6f2e8;
    --scale: 1;
    position: absolute;
    margin: 0;
    display: flex;
    flex-direction: column;
    width: var(--w);
    padding: clamp(10px, 1.1vw, 16px) clamp(10px, 1.1vw, 16px) 0;
    border-radius: 3px;
    background:
        linear-gradient(145deg, #fffdf8 0%, var(--frame) 48%, #efe8d8 100%);
    border: 1px solid rgba(255, 252, 245, 0.55);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.72) inset,
        0 -1px 0 rgba(80, 60, 30, 0.1) inset,
        0 2px 4px rgba(4, 10, 6, 0.18),
        0 18px 36px rgba(4, 10, 6, 0.42),
        0 40px 80px rgba(4, 10, 6, 0.48),
        0 0 0 1px rgba(20, 32, 24, 0.12);
    transform: rotate(var(--rot)) scale(var(--scale));
    transform-origin: center;
    opacity: 0;
    pointer-events: auto;
    will-change: transform;
}

/* Zone photo — ratio natif, aucune déformation */
.beta-access__polaroid {
    position: relative;
    width: 100%;
    aspect-ratio: var(--ar);
    overflow: hidden;
    background: #0d1410;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.22),
        inset 0 6px 14px rgba(0, 0, 0, 0.1);
}

.beta-access__polaroid--tall {
    aspect-ratio: 222 / 915;
}

.beta-access__polaroid img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    user-select: none;
    pointer-events: none;
}

.beta-access__shot figcaption {
    flex: 0 0 auto;
    height: clamp(44px, 5.5vw, 64px);
    display: flex;
    align-items: center;
    padding: 0 4px 4px;
    color: #1a2430;
    font-size: clamp(11px, 0.95vw, 14px);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    line-height: 1;
}

/* —— Positions : zone centrale libre (~420px) pour le formulaire —— */

/* Ops — haut-gauche, ancré hors du centre */
.beta-access__shot--ops {
    --w: min(48vw, 720px);
    --ar: 1525 / 617;
    --rot: -8deg;
    --scale: 1;
    top: 1%;
    left: -3%;
    z-index: 3;
}

/* Marché — haut-droite, symétrie dynamique */
.beta-access__shot--marche {
    --w: min(50vw, 760px);
    --ar: 1536 / 672;
    --rot: 7deg;
    --scale: 1;
    top: 0%;
    right: -4%;
    z-index: 3;
}

/* Menu — bandeau gauche, loin du formulaire */
.beta-access__shot--nav {
    --w: min(10vw, 132px);
    --rot: -4deg;
    --scale: 1;
    top: 38%;
    left: 1.5%;
    z-index: 4;
}

.beta-access__shot--nav .beta-access__polaroid img {
    object-fit: contain;
}

.beta-access__shot--nav figcaption {
    height: clamp(40px, 5vw, 52px);
    font-size: clamp(10px, 0.85vw, 12px);
    letter-spacing: 0.12em;
    justify-content: center;
}

/* Bâtiments — bas-gauche bien visible, remonte dans le cadre */
.beta-access__shot--batiments {
    --w: min(46vw, 700px);
    --ar: 1485 / 370;
    --rot: 5deg;
    --scale: 1;
    bottom: 3%;
    left: -2%;
    z-index: 2;
}

/* Parcelles — bas-droite, chevauche légèrement bâtiments */
.beta-access__shot--parcelles {
    --w: min(48vw, 740px);
    --ar: 1555 / 402;
    --rot: -6deg;
    --scale: 1;
    bottom: 2%;
    right: -3%;
    z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
    .beta-access__shot {
        transition: transform 280ms ease, box-shadow 280ms ease;
    }

    .beta-access__shot:hover {
        z-index: 9;
        animation-play-state: paused;
        transform: rotate(var(--rot)) scale(calc(var(--scale) * 1.045)) translateY(-8px);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.8) inset,
            0 8px 16px rgba(4, 10, 6, 0.28),
            0 28px 56px rgba(4, 10, 6, 0.5),
            0 56px 100px rgba(4, 10, 6, 0.55),
            0 0 0 1px rgba(255, 255, 255, 0.12);
    }
}

/* ═══════════ Stage (formulaire centré) ═══════════ */
.beta-access__stage {
    position: relative;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: clamp(16px, 3vh, 32px) 20px;
    pointer-events: none;
}

.beta-access__stage > * {
    pointer-events: auto;
}

/* Titre hero — centre/gauche, très lisible au-dessus du bloc */
.beta-access__brand {
    position: relative;
    z-index: 7;
    width: min(520px, 100%);
    margin: 0 0 16px;
    margin-right: clamp(24px, 8vw, 96px);
    color: var(--ba-mist);
    font-size: clamp(34px, 5.2vw, 56px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1;
    text-align: left;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.35),
        0 10px 36px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(15, 26, 20, 0.8);
    opacity: 0;
    animation: ba-in 650ms cubic-bezier(0.22, 1, 0.36, 1) 40ms forwards;
}

.beta-access__panel {
    position: relative;
    z-index: 8;
    width: min(420px, 100%);
    opacity: 0;
    animation: ba-in 700ms cubic-bezier(0.22, 1, 0.36, 1) 120ms forwards;
}

.beta-access__panel::before {
    content: "";
    position: absolute;
    inset: -36px -48px;
    z-index: -1;
    border-radius: 32px;
    background: radial-gradient(ellipse at 50% 45%, rgba(8, 14, 10, 0.68) 0%, transparent 72%);
    pointer-events: none;
}

.beta-access__card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(111, 154, 106, 0.35);
    background: var(--ba-paper);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 32px 80px rgba(4, 10, 6, 0.55);
}

.beta-access__header {
    background: linear-gradient(180deg, #e4efe0 0%, #d5e4d0 100%);
    padding: 22px 24px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(61, 92, 69, 0.12);
}

.beta-access__logo {
    width: min(100%, 200px);
    height: auto;
    display: block;
    margin: 0 auto 10px;
}

.beta-access__subtitle {
    color: #3d5c45;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.beta-access__alert-info {
    border-radius: 8px;
    background: #edf6ea;
    border: 1px solid #b7d4b0;
    color: #2f5236;
}

.beta-access__lock-icon {
    color: #4f7a52;
}

.beta-access__alert-error {
    border-radius: 8px;
    background: #fdeceb;
    border: 1px solid #ef9a9a;
    color: #b71c1c;
}

.beta-access__label {
    font-weight: 600;
    color: #2f5236;
    font-size: 15px;
}

.beta-access__input {
    border-radius: 8px;
    border: 2px solid #c5d9c0;
    padding: 14px 16px;
    font-size: 17px;
    color: var(--ba-ink);
    background: #fff;
}

.beta-access__input::placeholder {
    color: #7a9478;
    opacity: 1;
}

.beta-access__input:focus {
    border-color: #6f9a6a;
    box-shadow: 0 0 0 0.2rem rgba(111, 154, 106, 0.22);
}

.beta-access__submit {
    position: relative;
    z-index: 3;
    background: linear-gradient(135deg, #5f8f5c 0%, #3d5c45 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px;
    font-weight: 700;
    font-size: 17px;
    box-shadow: 0 8px 22px rgba(61, 92, 69, 0.38);
    transition: transform 0.25s, box-shadow 0.25s;
    -webkit-tap-highlight-color: rgba(111, 154, 106, 0.35);
    touch-action: manipulation;
    cursor: pointer;
    pointer-events: auto;
}

.beta-access__submit i {
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .beta-access__submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(61, 92, 69, 0.48);
        color: white;
    }
}

.beta-access__shield-icon {
    color: #4f7a52;
}

.beta-access__footer {
    color: rgba(232, 240, 228, 0.72);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.beta-access .card-body.p-5 {
    padding: 1.6rem !important;
}

/* ═══════════ Animations ═══════════ */
@keyframes ba-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes ba-shot-in {
    from { opacity: 0; transform: rotate(var(--rot)) scale(calc(var(--scale) * 0.94)) translateY(22px); }
    to   { opacity: 1; transform: rotate(var(--rot)) scale(var(--scale)) translateY(0); }
}

@keyframes ba-float {
    0%, 100% { transform: rotate(var(--rot)) scale(var(--scale)) translateY(0); }
    50%      { transform: rotate(var(--rot)) scale(var(--scale)) translateY(-6px); }
}

.beta-access__shot--ops {
    animation:
        ba-shot-in 900ms cubic-bezier(0.22, 1, 0.36, 1) 60ms forwards,
        ba-float 9s ease-in-out 1.2s infinite;
}

.beta-access__shot--marche {
    animation:
        ba-shot-in 900ms cubic-bezier(0.22, 1, 0.36, 1) 120ms forwards,
        ba-float 9.6s ease-in-out 1.35s infinite;
}

.beta-access__shot--nav {
    animation:
        ba-shot-in 900ms cubic-bezier(0.22, 1, 0.36, 1) 180ms forwards,
        ba-float 10s ease-in-out 1.45s infinite;
}

.beta-access__shot--batiments {
    animation:
        ba-shot-in 900ms cubic-bezier(0.22, 1, 0.36, 1) 240ms forwards,
        ba-float 8.8s ease-in-out 1.5s infinite;
}

.beta-access__shot--parcelles {
    animation:
        ba-shot-in 900ms cubic-bezier(0.22, 1, 0.36, 1) 280ms forwards,
        ba-float 9.2s ease-in-out 1.55s infinite;
}

@media (prefers-reduced-motion: reduce) {
    .beta-access__brand,
    .beta-access__panel {
        opacity: 1;
        animation: none !important;
        transform: none;
    }

    .beta-access__shot,
    .beta-access__shot--ops,
    .beta-access__shot--marche,
    .beta-access__shot--nav,
    .beta-access__shot--batiments,
    .beta-access__shot--parcelles {
        opacity: 1;
        animation: none !important;
        transform: rotate(var(--rot, 0deg)) scale(var(--scale, 1));
    }

    .beta-access__shot,
    .beta-access__submit {
        transition: none !important;
    }
}

/* ═══════════ Large desktop ═══════════ */
@media (min-width: 1400px) {
    .beta-access__shot--ops { --w: 780px; left: -2%; top: 2%; }
    .beta-access__shot--marche { --w: 820px; right: -3%; top: 1%; }
    .beta-access__shot--nav { --w: 148px; left: 2.5%; top: 36%; }
    .beta-access__shot--batiments { --w: 760px; left: -1%; bottom: 4%; }
    .beta-access__shot--parcelles { --w: 800px; right: -2%; bottom: 3%; }
    .beta-access__panel { width: 440px; }
    .beta-access__brand { font-size: 58px; width: 540px; }
}

@media (min-width: 1700px) {
    .beta-access__shot--ops { --w: 860px; left: 1%; }
    .beta-access__shot--marche { --w: 900px; right: 0%; }
    .beta-access__shot--nav { --w: 160px; left: 4%; }
    .beta-access__shot--batiments { --w: 840px; left: 1%; }
    .beta-access__shot--parcelles { --w: 880px; right: 0%; }
}

/* ═══════════ Hauteur courte ═══════════ */
@media (max-height: 820px) {
    .beta-access__brand { font-size: clamp(28px, 4vw, 40px); margin-bottom: 10px; }
    .beta-access__header { padding: 14px 18px 10px; }
    .beta-access__logo { width: min(100%, 160px); margin-bottom: 6px; }
    .beta-access .card-body.p-5 { padding: 1.15rem !important; }

    .beta-access__shot--ops,
    .beta-access__shot--marche { --w: min(42vw, 560px); }
    .beta-access__shot--batiments,
    .beta-access__shot--parcelles { --w: min(40vw, 540px); }
    .beta-access__shot--nav { --w: min(9vw, 120px); top: 40%; }
    .beta-access__shot { padding: 10px 10px 0; }
    .beta-access__shot figcaption { height: 44px; font-size: 11px; }
}

@media (max-height: 700px) {
    .beta-access__brand { display: none; }
    .beta-access__footer { display: none; }
    .beta-access__shot figcaption {
        height: 32px;
        font-size: 0;
        color: transparent;
    }

    .beta-access__shot--ops,
    .beta-access__shot--marche { --w: min(44vw, 520px); }
    .beta-access__shot--batiments,
    .beta-access__shot--parcelles { --w: min(42vw, 500px); }
}

/* ═══════════ Tablet ═══════════ */
@media (max-width: 1100px) {
    .beta-access__shot--ops { --w: min(46vw, 480px); left: -4%; top: 1%; }
    .beta-access__shot--marche { --w: min(48vw, 500px); right: -5%; top: 0%; }
    .beta-access__shot--nav { --w: min(10vw, 120px); left: 0.5%; top: 40%; }
    .beta-access__shot--batiments { --w: min(44vw, 460px); left: -3%; bottom: 2%; }
    .beta-access__shot--parcelles { --w: min(46vw, 480px); right: -4%; bottom: 1%; }
    .beta-access__brand {
        margin-right: clamp(12px, 4vw, 48px);
        font-size: clamp(30px, 4.5vw, 44px);
    }
}

@media (max-width: 900px) {
    .beta-access__shot--nav { display: none; }

    .beta-access__shot--ops {
        --w: min(52vw, 380px);
        top: 1%;
        left: -6%;
        --rot: -7deg;
    }

    .beta-access__shot--marche {
        --w: min(52vw, 380px);
        top: 0%;
        right: -6%;
        --rot: 6deg;
    }

    .beta-access__shot--batiments {
        --w: min(50vw, 360px);
        bottom: 2%;
        left: -5%;
        --rot: 5deg;
    }

    .beta-access__shot--parcelles {
        --w: min(50vw, 360px);
        bottom: 1%;
        right: -5%;
        --rot: -5deg;
    }

    .beta-access__brand {
        text-align: center;
        margin-right: 0;
        width: min(420px, 100%);
    }
}

/* ═══════════ Mobile ═══════════ */
@media (max-width: 768px) {
    html,
    body {
        overflow: hidden;
    }

    .beta-access {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        height: 100dvh;
    }

    .beta-access__stage {
        justify-content: flex-start;
        padding-top: max(16vh, 88px);
        padding-bottom: max(14vh, 72px);
    }

    .beta-access__brand {
        font-size: 28px;
        text-align: center;
        margin-right: 0;
        width: min(400px, 100%);
    }

    .beta-access__panel { width: min(400px, 100%); }
    .beta-access__card { overflow: visible; }

    .beta-access__form {
        position: relative;
        z-index: 3;
        pointer-events: auto;
    }

    .beta-access__submit {
        min-height: 48px;
        z-index: 5;
    }

    .beta-access__submit:active {
        transform: scale(0.98);
        box-shadow: 0 3px 12px rgba(61, 92, 69, 0.35);
        color: white;
    }

    .beta-access__shot--ops {
        --w: 58vw;
        top: 1%;
        left: -8%;
        --rot: -8deg;
        --scale: 1;
    }

    .beta-access__shot--marche {
        --w: 58vw;
        top: 0%;
        right: -8%;
        --rot: 7deg;
        --scale: 1;
    }

    .beta-access__shot--batiments {
        --w: 56vw;
        bottom: 1%;
        left: -6%;
        --rot: 5deg;
        --scale: 1;
    }

    .beta-access__shot--parcelles {
        --w: 56vw;
        bottom: 0%;
        right: -6%;
        --rot: -6deg;
        --scale: 1;
    }

    .beta-access__shot {
        padding: 8px 8px 0;
    }

    .beta-access__shot figcaption {
        height: 36px;
        font-size: 10px;
        padding: 0 2px 2px;
        letter-spacing: 0.12em;
    }
}

@media (max-width: 768px) and (max-height: 720px) {
    .beta-access__brand { margin-bottom: 8px; font-size: 24px; }
    .beta-access__header { padding: 12px 14px 8px; }
    .beta-access__logo { width: min(100%, 140px); }
    .beta-access__stage { padding-top: 12vh; }
    .beta-access__shot figcaption {
        height: 28px;
        font-size: 0;
        color: transparent;
    }
}
