/* ============================================================
   Akim Store — Page de connexion
   Palette reprise du logo : vert #488E14 / orange #FF8C00
   ============================================================ */

:root {
    --green-950: #0B2105;
    --green-900: #123A0A;
    --green-800: #1C520E;
    --green-700: #2F7312;
    --green-600: #488E14;
    --green-500: #5FA920;
    --green-100: #E8F2DD;
    --green-50: #F3F8EC;

    --orange-600: #E07800;
    --orange-500: #FF8C00;
    --orange-100: #FFF1DE;

    --ink: #14210F;
    --ink-soft: #2D3B27;
    --muted: #5C6B57;
    --line: #E2E9DA;
    --bg: #F7F9F4;
    --white: #FFFFFF;

    --shadow-sm: 0 2px 8px rgba(20, 33, 15, .06);
    --shadow-md: 0 18px 50px rgba(20, 33, 15, .1);

    --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

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

button,
input {
    font: inherit;
}

h1, h2 {
    margin: 0;
    line-height: 1.12;
    letter-spacing: -.03em;
}

p {
    margin: 0;
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 16px;
    z-index: 200;
    padding: 10px 18px;
    border-radius: 0 0 10px 10px;
    background: var(--green-700);
    color: #fff;
    font-weight: 700;
    transition: top .2s var(--ease);
}

.skip-link:focus {
    top: 0;
}

:focus-visible {
    outline: 3px solid var(--orange-500);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ============================================================
   Structure
   ============================================================ */

.auth {
    display: grid;
    grid-template-columns: minmax(430px, 46%) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

/* ============================================================
   Panneau de marque
   ============================================================ */

.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 42px 48px 34px;
    background:
        radial-gradient(60% 55% at 92% 8%, rgba(255, 140, 0, .22), transparent 62%),
        radial-gradient(55% 55% at 0% 100%, rgba(95, 169, 32, .24), transparent 65%),
        linear-gradient(158deg, var(--green-900), var(--green-950));
    color: #fff;
    overflow: hidden;
}

.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 58px 58px;
    -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 40%, #000, transparent 82%);
    mask-image: radial-gradient(ellipse 75% 75% at 50% 40%, #000, transparent 82%);
    pointer-events: none;
}

.aside-decor {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .09);
    pointer-events: none;
}

.aside-decor-1 {
    width: 420px;
    height: 420px;
    right: -190px;
    top: -120px;
}

.aside-decor-2 {
    width: 300px;
    height: 300px;
    left: -150px;
    bottom: -120px;
    border-color: rgba(255, 140, 0, .16);
}

.aside-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-self: flex-start;
    padding: 10px 16px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
    transition: transform .25s var(--ease);
}

.aside-brand:hover {
    transform: translateY(-2px);
}

.aside-brand img {
    height: 34px;
    width: auto;
}

.aside-content {
    position: relative;
    z-index: 1;
    margin: auto 0;
    padding: 46px 0 34px;
    max-width: 530px;
}

.aside-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    color: rgba(255, 255, 255, .82);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--orange-500);
    box-shadow: 0 0 0 4px rgba(255, 140, 0, .16);
}

.aside-content h1 {
    margin-top: 24px;
    max-width: 500px;
    font-size: clamp(2.15rem, 3.4vw, 3.15rem);
    font-weight: 800;
    letter-spacing: -.04em;
}

.aside-content h1 span {
    color: #FFB35C;
}

.aside-content > p {
    margin-top: 20px;
    max-width: 430px;
    color: rgba(255, 255, 255, .64);
    font-size: .98rem;
    line-height: 1.75;
}

.aside-list {
    display: grid;
    gap: 18px;
    margin: 34px 0 0;
    padding: 0;
    list-style: none;
}

.aside-list li {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.ai {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .1);
    color: var(--orange-500);
    font-size: .82rem;
    flex-shrink: 0;
}

.aside-list strong {
    display: block;
    margin-bottom: 2px;
    color: rgba(255, 255, 255, .94);
    font-size: .9rem;
    font-weight: 700;
}

.aside-list span:not(.ai) {
    display: block;
    color: rgba(255, 255, 255, .5);
    font-size: .82rem;
    line-height: 1.55;
}

.aside-card {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 410px;
    margin-top: 34px;
    padding: 15px 16px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    background: rgba(255, 255, 255, .055);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ac-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 140, 0, .16);
    color: #FFB35C;
    font-size: .8rem;
    flex-shrink: 0;
}

.aside-card strong {
    display: block;
    font-size: .82rem;
    font-weight: 700;
}

.aside-card span:not(.ac-icon) {
    display: block;
    color: rgba(255, 255, 255, .5);
    font-size: .75rem;
    line-height: 1.5;
}

.aside-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: rgba(255, 255, 255, .36);
    font-size: .7rem;
}

/* ============================================================
   Côté formulaire
   ============================================================ */

.auth-main {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 30px 48px 24px;
    background:
        radial-gradient(50% 45% at 100% 0%, rgba(255, 140, 0, .07), transparent 65%),
        radial-gradient(45% 45% at 0% 100%, rgba(72, 142, 20, .07), transparent 65%),
        var(--bg);
    overflow: hidden;
}

.auth-main::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(72, 142, 20, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(72, 142, 20, .035) 1px, transparent 1px);
    background-size: 52px 52px;
    -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 45%, #000, transparent 80%);
    mask-image: radial-gradient(ellipse 65% 60% at 50% 45%, #000, transparent 80%);
    pointer-events: none;
}

.auth-topbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 600;
    transition: color .2s var(--ease), transform .2s var(--ease);
}

.back-link i {
    font-size: .72rem;
    transition: transform .2s var(--ease);
}

.back-link:hover {
    color: var(--green-700);
}

.back-link:hover i {
    transform: translateX(-2px);
}

.topbar-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #8E9A87;
    font-size: .74rem;
    font-weight: 600;
}

.topbar-note i {
    color: var(--green-600);
    font-size: .7rem;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
    margin: auto;
    padding: 42px 0 34px;
    animation: cardIn .6s var(--ease) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-brand {
    display: none;
    margin-bottom: 30px;
}

.mobile-brand img {
    height: 38px;
    width: auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 13px;
    border: 1px solid var(--green-100);
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    color: var(--green-800);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green-600);
    box-shadow: 0 0 0 4px rgba(72, 142, 20, .14);
}

.auth-card h2 {
    margin-top: 18px;
    font-size: clamp(1.7rem, 2.6vw, 2.12rem);
    font-weight: 800;
}

.auth-sub {
    margin-top: 10px;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.65;
}

/* ---------- Alertes ---------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 22px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: .84rem;
    line-height: 1.5;
    animation: alertIn .35s var(--ease) both;
}

@keyframes alertIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert > i {
    margin-top: 2px;
    font-size: .95rem;
    flex-shrink: 0;
}

.alert strong {
    display: block;
    margin-bottom: 1px;
    font-weight: 800;
}

.alert span {
    display: block;
    opacity: .9;
}

.alert-error {
    background: #FFF3F0;
    border-color: #F3D3CC;
    color: #9C2F1F;
}

.alert-success {
    background: var(--green-50);
    border-color: var(--green-100);
    color: var(--green-800);
}

/* ---------- Formulaire ---------- */

.auth-form {
    display: grid;
    gap: 19px;
    margin-top: 26px;
    min-width: 0;
}

.field {
    min-width: 0;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink);
    font-size: .82rem;
    font-weight: 700;
}

.label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.forgot-link {
    color: var(--green-700);
    font-size: .76rem;
    font-weight: 700;
    transition: color .2s var(--ease);
}

.forgot-link:hover {
    color: var(--orange-600);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.control {
    position: relative;
    display: flex;
    align-items: center;
    height: 52px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.control:focus-within {
    border-color: var(--green-600);
    box-shadow: 0 0 0 4px rgba(72, 142, 20, .12);
}

.control.is-invalid {
    border-color: #E0A79D;
    background: #FFFCFB;
}

.control.is-invalid:focus-within {
    border-color: #C9563F;
    box-shadow: 0 0 0 4px rgba(201, 86, 63, .11);
}

.control-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    color: #94A08D;
    font-size: .88rem;
    flex-shrink: 0;
    pointer-events: none;
}

.control:focus-within .control-icon {
    color: var(--green-600);
}

.control input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 9px 0 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: .93rem;
}

.control input::placeholder {
    color: #A9B3A2;
}

/* Neutralise le style natif d'Edge */
.control input::-ms-reveal,
.control input::-ms-clear {
    display: none;
}

.toggle-password {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: #94A08D;
    cursor: pointer;
    transition: color .2s var(--ease);
}

.toggle-password:hover {
    color: var(--green-700);
}

.caps-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    color: var(--orange-600);
    font-size: .74rem;
    font-weight: 600;
}

.caps-hint[hidden] {
    display: none;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
    color: var(--muted);
    font-size: .83rem;
    cursor: pointer;
    user-select: none;
}

.remember input {
    appearance: none;
    -webkit-appearance: none;
    display: grid;
    place-content: center;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1.5px solid #C6D4B9;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: background .2s var(--ease), border-color .2s var(--ease);
}

.remember input::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px) scale(0);
    transition: transform .15s var(--ease);
}

.remember input:checked {
    background: var(--green-700);
    border-color: var(--green-700);
}

.remember input:checked::after {
    transform: rotate(-45deg) translateY(-1px) scale(1);
}

.remember input:focus-visible {
    outline: 3px solid var(--orange-500);
    outline-offset: 2px;
}

/* ---------- Bouton principal ---------- */

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    margin-top: 3px;
    padding: 0 22px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--green-700), var(--green-600));
    color: #fff;
    font-size: .96rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(72, 142, 20, .24);
    transition: transform .22s var(--ease), box-shadow .22s var(--ease),
                filter .22s var(--ease);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(72, 142, 20, .3);
    filter: brightness(1.03);
}

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

.btn-arrow {
    font-size: .82rem;
    transition: transform .22s var(--ease);
}

.btn-submit:hover .btn-arrow {
    transform: translateX(3px);
}

.btn-spinner {
    display: none;
    font-size: .95rem;
    animation: spin .8s linear infinite;
}

.btn-submit.is-loading {
    pointer-events: none;
    opacity: .82;
}

.btn-submit.is-loading .btn-arrow {
    display: none;
}

.btn-submit.is-loading .btn-spinner {
    display: inline-block;
}

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

/* ---------- Notes ---------- */

.auth-help {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.55;
}

.auth-help i {
    margin-top: 2px;
    color: var(--green-600);
    flex-shrink: 0;
}

.auth-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 16px;
    color: #8B9684;
    font-size: .72rem;
    text-align: center;
}

.auth-security i {
    color: var(--green-600);
    font-size: .68rem;
}

.auth-foot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    color: #96A18F;
    font-size: .72rem;
}

.auth-foot a {
    color: var(--green-700);
    font-weight: 700;
}

.auth-foot a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1180px) {
    .auth-aside {
        padding: 38px 38px 30px;
    }

    .auth-main {
        padding: 28px 38px 22px;
    }

    .aside-content h1 {
        font-size: clamp(2rem, 3.2vw, 2.7rem);
    }
}

@media (max-width: 900px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        display: none;
    }

    .auth-main {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 24px 26px 20px;
    }

    .auth-card {
        margin: auto;
        padding: 34px 0 28px;
    }

    .mobile-brand {
        display: flex;
        width: fit-content;
        margin-bottom: 28px;
    }

    .topbar-note {
        display: none;
    }
}

@media (max-width: 520px) {
    .auth-main {
        padding: 20px 20px 16px;
    }

    .auth-card {
        max-width: 100%;
        padding: 26px 0 22px;
    }

    .mobile-brand {
        margin-bottom: 24px;
    }

    .mobile-brand img {
        height: 34px;
    }

    .auth-card h2 {
        font-size: 1.62rem;
    }

    .control {
        height: 50px;
    }

    .btn-submit {
        height: 50px;
    }

    .auth-foot {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* ============================================================
   Accessibilité — mouvement réduit
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .auth-card {
        opacity: 1;
        transform: none;
    }
}
