/* =========================
       DESIGN TOKENS - VERT
    ========================= */
:root {
    --primary: #10b981;
    --primary2: #059669;
    --primary-gradient: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary2) 100%
    );
    --bg: #ffffff;
    --surface: rgba(255, 255, 255, 0.85);
    --surface-2: rgba(255, 255, 255, 0.6);
    --text: #0f172a;
    --muted: #475569;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow-sm: 0 8px 24px rgba(2, 6, 23, 0.08);
    --shadow-md: 0 18px 48px rgba(2, 6, 23, 0.14);
    --shadow-lg: 0 24px 72px rgba(2, 6, 23, 0.2);
    --ring: 0 0 0 4px rgba(16, 185, 129, 0.22);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --transition: 240ms cubic-bezier(0.16, 0.84, 0.44, 1);
    --transition-slow: 420ms cubic-bezier(0.16, 0.84, 0.44, 1);
}

.dark-theme {
    --primary: #34d399;
    --primary2: #047857;
    --primary-gradient: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary2) 100%
    );
    --bg: #0b1220;
    --surface: rgba(15, 23, 42, 0.85);
    --surface-2: rgba(15, 23, 42, 0.6);
    --text: #e5e7eb;
    --muted: #cbd5e1;
    --border: #334155;
    --shadow-sm: 0 12px 36px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 24px 72px rgba(0, 0, 0, 0.48);
    --shadow-lg: 0 36px 108px rgba(0, 0, 0, 0.56);
    --ring: 0 0 0 4px rgba(52, 211, 153, 0.22);
}

/* =========================
       RESET + BASE
    ========================= */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Arial,
        sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    position: relative;
}

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

button,
input {
    font-family: inherit;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* =========================
       ANIMATIONS
    ========================= */
@keyframes floaty {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(1deg);
    }
    75% {
        transform: translateY(5px) rotate(-1deg);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulseGlow {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(16, 185, 129, 0.4);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation pour le carrousel 6 images */
@keyframes carouselFade {
    0%,
    12% {
        opacity: 1;
        transform: scale(1.08);
    }
    16%,
    100% {
        opacity: 0;
        transform: scale(1.12);
    }
}

.anim-fadeUp {
    animation: fadeUp 0.8s var(--transition) both;
}
.anim-fadeIn {
    animation: fadeIn 0.6s var(--transition) both;
}
.anim-scaleIn {
    animation: scaleIn 0.7s var(--transition) both;
}
.anim-slideInRight {
    animation: slideInRight 0.6s var(--transition) both;
}

/* =========================
       ALERTES
    ========================= */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s ease;
    border: 1px solid transparent;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.alert i {
    font-size: 20px;
}

.alert-content {
    flex: 1;
    font-weight: 500;
}

.alert-close {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.alert-close:hover {
    opacity: 1;
}

/* =========================
       BACKGROUND BLOBS
    ========================= */
.blob {
    position: fixed;
    inset: auto;
    width: 400px;
    height: 400px;
    border-radius: 999px;
    filter: blur(80px);
    opacity: 0.22;
    z-index: -1;
    pointer-events: none;
    animation: floaty 15s ease-in-out infinite;
}

.blob.blob-1 {
    top: -160px;
    right: -160px;
    background: var(--primary);
    animation-delay: -2s;
}

.blob.blob-2 {
    bottom: -180px;
    left: -180px;
    background: #4f46e5;
    animation-direction: reverse;
    animation-duration: 18s;
}

/* =========================
       TOP CONTROLS
    ========================= */
.top-controls {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 50;
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.lang-toggle::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition);
}

.lang-toggle:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--border), var(--primary) 40%);
    color: white;
}

.lang-toggle:hover::before {
    opacity: 1;
}

.lang-toggle:hover span {
    color: white;
}

.lang-toggle .icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid color-mix(in srgb, var(--border), transparent 35%);
    transition: all var(--transition);
}

.lang-toggle:hover .icon {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.lang-toggle span {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.8px;
    color: var(--muted);
    transition: color var(--transition);
}

.switch {
    width: 68px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    padding: 4px;
    cursor: pointer;
    transition:
        transform var(--transition),
        box-shadow var(--transition);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.switch::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition);
}

.switch:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--border), var(--primary) 40%);
}

.switch:hover::before {
    opacity: 0.2;
}

.knob {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--primary-gradient);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    display: grid;
    place-items: center;
    color: #fff;
    transition: transform var(--transition-slow);
    z-index: 1;
    position: relative;
}

.switch[data-checked="true"] .knob {
    transform: translateX(32px);
}

/* =========================
       LAYOUT
    ========================= */
.screen {
    min-height: 100vh;
    display: flex;
}

/* Left - Carrousel d'images */
.left {
    display: none;
    width: 50%;
    position: relative;
    overflow: hidden;
    background: #0b1630;
}

@media (min-width: 1024px) {
    .left {
        display: block;
    }
}

.carousel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: carouselFade 30s infinite;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08);
    filter: saturate(1.1) contrast(1.05);
    transition: transform 8s ease;
}

.left:hover .carousel-slide img {
    transform: scale(1.12);
}

/* 6 slides : 0s, 5s, 10s, 15s, 20s, 25s */
.carousel-slide:nth-child(1) {
    animation-delay: 0s;
}
.carousel-slide:nth-child(2) {
    animation-delay: 5s;
}
.carousel-slide:nth-child(3) {
    animation-delay: 10s;
}
.carousel-slide:nth-child(4) {
    animation-delay: 15s;
}
.carousel-slide:nth-child(5) {
    animation-delay: 20s;
}
.carousel-slide:nth-child(6) {
    animation-delay: 25s;
}

.left::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            1000px 500px at 10% 15%,
            rgba(16, 185, 129, 0.4),
            transparent 60%
        ),
        radial-gradient(
            700px 500px at 80% 70%,
            rgba(5, 150, 105, 0.35),
            transparent 60%
        ),
        linear-gradient(135deg, rgba(2, 6, 23, 0.8), rgba(2, 6, 23, 0.6));
    z-index: 1;
}

.left-content {
    position: relative;
    z-index: 2;
    padding: 72px;
    color: #fff;
    height: 100%;
    display: flex;
    align-items: center;
}

.left-wrap {
    max-width: 600px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    margin-bottom: 24px;
    font-weight: 700;
    letter-spacing: 0.6px;
    animation: pulseGlow 3s ease-in-out infinite;
    transition: transform var(--transition);
}

.badge:hover {
    transform: translateY(-3px);
}

.badge i {
    opacity: 1;
    font-size: 18px;
}

.hero-title {
    margin: 0 0 16px 0;
    font-size: clamp(36px, 3.2vw, 58px);
    line-height: 1.05;
    letter-spacing: -1.2px;
    font-weight: 900;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    margin: 0 0 32px 0;
    font-size: 19px;
    line-height: 1.6;
    color: rgba(219, 234, 254, 0.95);
    max-width: 90%;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.feature {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    transition:
        transform var(--transition),
        background var(--transition),
        box-shadow var(--transition);
}

.feature:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.feature .f-ico {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    flex: 0 0 auto;
    font-size: 18px;
    transition: transform var(--transition);
}

.feature:hover .f-ico {
    transform: scale(1.1) rotate(5deg);
}

.feature .f-txt {
    font-size: 15px;
    line-height: 1.4;
    color: rgba(226, 232, 240, 0.98);
    font-weight: 700;
}

/* Right */
.right {
    width: 100%;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    position: relative;
}

@media (min-width: 1024px) {
    .right {
        width: 50%;
        padding: 60px;
    }
}

/* =========================
       CARD / FORM
    ========================= */
.card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border), transparent 15%);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(24px);
    overflow: hidden;
    position: relative;
    animation: scaleIn 0.8s var(--transition) both;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--primary-gradient);
    background-size: 200% auto;
    animation: shimmer 3.5s linear infinite;
}

.card-body {
    padding: 32px;
}

@media (min-width: 768px) {
    .card-body {
        padding: 40px;
    }
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 10px 0 24px 0;
}

.brand-mark {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: grid;
    place-items: center;
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.3);
    border: 3px solid white;
    overflow: hidden;
    position: relative;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -1px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(16, 185, 129, 0.1);
}

.brand-sub {
    font-size: 13px;
    color: var(--muted);
    letter-spacing: 1.6px;
    font-weight: 800;
    margin-top: 2px;
}

.header {
    text-align: center;
    margin: 0 0 24px 0;
}

.header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.6px;
}

.header p {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
    font-size: 15px;
}

.form {
    display: grid;
    gap: 18px;
    margin-top: 20px;
}

.field label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--muted);
    font-weight: 800;
    margin: 0 0 10px 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control {
    position: relative;
}

.control i.leading {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: color-mix(in srgb, var(--muted), transparent 15%);
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.control input {
    width: 100%;
    padding: 16px 52px 16px 48px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
    outline: none;
    font-weight: 600;
    transition: all var(--transition);
    position: relative;
    z-index: 0;
}

.dark-theme .control input {
    background: rgba(15, 23, 42, 0.35);
}

.control input::placeholder {
    color: color-mix(in srgb, var(--muted), transparent 30%);
    font-weight: 500;
}

.control input:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.18);
}

.dark-theme .control input:focus {
    background: rgba(15, 23, 42, 0.5);
}

.toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--border), transparent 25%);
    background: var(--surface-2);
    color: var(--muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all var(--transition);
    z-index: 1;
}

.toggle-pass:hover {
    color: var(--primary);
    transform: translateY(-50%) scale(1.08);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
    transition: color var(--transition);
}

.remember:hover {
    color: var(--text);
}

.remember input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: 6px;
    transition: transform var(--transition);
}

.remember input:checked {
    transform: scale(1.1);
}

.link {
    font-size: 14px;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
    padding-bottom: 2px;
}

.link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width var(--transition);
}

.link:hover {
    color: var(--primary2);
    transform: translateY(-2px);
}

.link:hover::after {
    width: 100%;
}

.btn {
    width: 100%;
    margin-top: 12px;
    border: none;
    border-radius: 16px;
    padding: 16px 20px;
    color: #fff;
    font-weight: 900;
    letter-spacing: 0.4px;
    background: var(--primary-gradient);
    cursor: pointer;
    box-shadow: 0 24px 48px rgba(16, 185, 129, 0.3);
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    font-size: 16px;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 110%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transition: left 0.7s ease;
}

.btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 32px 64px rgba(16, 185, 129, 0.4);
    filter: brightness(1.1);
}

.btn:hover::before {
    left: 120%;
}

.btn:active {
    transform: translateY(-1px);
}

.btn[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.policies {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding-top: 20px;
    margin-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

.policies a {
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
    padding: 4px 0;
}

.policies a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width var(--transition);
}

.policies a:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.policies a:hover::after {
    width: 100%;
}

.footer-copyright {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0 20px;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.footer-copyright:hover {
    opacity: 1;
}

.spin {
    animation: spin 1s linear infinite;
}

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