/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

  html {
      scroll-behavior: smooth;
  }

  body,
  html {
      margin: 0;
      padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    overflow-x: hidden;
}

/* Login Container - Split Screen Layout */
.login-container {
    display: flex;
    min-height: 100vh;
      width: 100%;
}

/* Image Section */
.login-image-section {
    flex: 0 0 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #ffffff;
    position: relative;
}

/* Wrapper image + overlay */
.img-scene-wrapper {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: sceneBreath 6s ease-in-out infinite;
}

@keyframes sceneBreath {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.02); }
}

.scene-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* SVG overlay en position absolue par-dessus l'image */
.scene-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

/* ── Données écran : cellules qui s'allument ── */
.data-cell {
    animation: cellFlash 4s ease-in-out infinite;
}
.dc1 { animation-delay: 0s; }
.dc2 { animation-delay: 0.6s; }
.dc3 { animation-delay: 1.2s; }
.dc4 { animation-delay: 0.3s; }
.dc5 { animation-delay: 0.9s; }
.dc6 { animation-delay: 1.5s; }

@keyframes cellFlash {
    0%, 100% { opacity: 0; }
    20%, 60% { opacity: 0.55; }
    80% { opacity: 0.2; }
}

/* ── Ligne de scan qui défile verticalement ── */
.scan-line {
    animation: scanDown 3s ease-in-out infinite;
}
@keyframes scanDown {
    0%   { transform: translateY(0);    opacity: 0.5; }
    50%  { transform: translateY(380px); opacity: 0.8; }
    100% { transform: translateY(0);    opacity: 0.5; }
}

/* ── Curseur clignotant ── */
.cursor-blink {
    animation: cursorBlink 1s step-end infinite;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 0.8; }
    50%       { opacity: 0; }
}

/* ── Halo parlant sur femme gauche ── */
.speaker-glow {
    animation: speakerPulse 3s ease-in-out infinite;
}
@keyframes speakerPulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    40%, 60% { opacity: 0.08; transform: scale(1.05); }
}

/* ── Corps homme centre oscille légèrement ── */
.body-center {
    animation: bodySway 3.5s ease-in-out infinite;
}
@keyframes bodySway {
    0%, 100% { transform: rotate(0deg); }
    30% { transform: rotate(0.8deg); }
    70% { transform: rotate(-0.8deg); }
}

/* ── Têtes oscillent (regardent l'écran) ── */
.head-left {
    animation: headNod 4s ease-in-out infinite;
    transform-origin: 425px 390px;
}
.head-center {
    animation: headNod 5s ease-in-out infinite;
    animation-delay: 1s;
    transform-origin: 690px 375px;
}
.head-right {
    animation: headNod 4.5s ease-in-out infinite;
    animation-delay: 0.5s;
    transform-origin: 1040px 360px;
}
@keyframes headNod {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(2deg); }
    75% { transform: rotate(-1.5deg); }
}

/* ── Laptop se soulève légèrement ── */
.laptop-group {
    animation: laptopLift 3s ease-in-out infinite;
}
@keyframes laptopLift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.laptop-glow {
    animation: laptopGlow 2s ease-in-out infinite;
}
@keyframes laptopGlow {
    0%, 100% { opacity: 0; transform: translateX(0); }
    50% { opacity: 0.7; transform: translateX(60px); }
}

/* ── Bulles de dialogue ── */
.bubble-left {
    animation: bubbleFloat 4s ease-in-out infinite;
    transform-origin: 280px 267px;
}
.bubble-right {
    animation: bubbleFloat 4s ease-in-out infinite;
    animation-delay: 2s;
    transform-origin: 1115px 262px;
}
@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(-8px); opacity: 0.9; }
}

/* ── Particules flottantes ── */
.float-dot {
    animation: dotFloat 5s ease-in-out infinite;
}
.fd1 { animation-duration: 4s; animation-delay: 0s; }
.fd2 { animation-duration: 5s; animation-delay: 1s; }
.fd3 { animation-duration: 6s; animation-delay: 2s; }
.fd4 { animation-duration: 4.5s; animation-delay: 0.5s; }
.fd5 { animation-duration: 5.5s; animation-delay: 1.5s; }

@keyframes dotFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.6; }
    50% { transform: translateY(-18px) scale(1.2); opacity: 0.9; }
}

/* Personnage compteur */
.char-counter {
    animation: charBob1 2.8s ease-in-out infinite;
    transform-origin: 106px 380px;
}
@keyframes charBob1 {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Personnage noteur */
.char-noter {
    animation: charBob2 3.2s ease-in-out infinite;
    transform-origin: 310px 380px;
}
@keyframes charBob2 {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Bras pointeur du compteur */
.counter-arm {
    animation: counterArmSwing 2s ease-in-out infinite;
    transform-origin: 124px 286px;
}
@keyframes counterArmSwing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Bras + téléphone du noteur */
.noter-arm {
    animation: noterArmSwing 2.5s ease-in-out infinite;
    transform-origin: 296px 268px;
}
@keyframes noterArmSwing {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-6deg); }
}

.phone {
    animation: phoneTilt 2.5s ease-in-out infinite;
    transform-origin: 243px 265px;
}
@keyframes phoneTilt {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-6deg); }
}

/* Bulle stock OK */
.count-bubble {
    animation: bubblePop 3s ease-in-out infinite;
}
@keyframes bubblePop {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

/* Bulle note (personnage 2) */
.note-bubble {
    animation: bubblePop 3s ease-in-out infinite;
    animation-delay: 1.5s;
}

/* Flottement global de la scène */
@keyframes sceneFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Caption sous le SVG */
.stock-caption {
    text-align: center;
}

.stock-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.3rem;
    letter-spacing: -0.5px;
}

.stock-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.stock-stats {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-chip {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.2s;
}

.stat-chip:hover {
    transform: translateY(-2px);
}

/* Form Section */
.login-form-section {
    flex: 0 0 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    background-image: url('../images/4716.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.login-form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color, #208620) 0%, rgba(0, 0, 0, 0.7) 50%, var(--secondary-color, #f47f0d) 100%);
    z-index: 0;
}

/* --- Galaxy Animation --- */
.galaxy-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.galaxy-orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.8;
    animation: smallDotFloat linear infinite;
}

.orb1 { width: 8px; height: 8px; background: rgba(255, 255, 255, 0.9); top: 15%; left: 15%; animation-duration: 8s; }
.orb2 { width: 12px; height: 12px; background: var(--secondary-color, #f47f0d); bottom: 25%; right: 10%; animation-duration: 12s; animation-direction: reverse; }
.orb3 { width: 6px; height: 6px; background: var(--primary-color, #208620); top: 60%; left: 10%; animation-duration: 10s; }
.orb4 { width: 9px; height: 9px; background: rgba(255, 255, 255, 0.7); top: 80%; left: 60%; animation-duration: 15s; }
.orb5 { width: 14px; height: 14px; background: var(--secondary-color, #f47f0d); top: 10%; right: 25%; animation-duration: 9s; animation-direction: reverse; }
.orb6 { width: 7px; height: 7px; background: var(--primary-color, #208620); bottom: 10%; left: 30%; animation-duration: 14s; }

@keyframes smallDotFloat {
    0%, 100% { transform: translateY(0) translateX(0) scale(1); opacity: 0.6; }
    33% { transform: translateY(-30px) translateX(15px) scale(1.2); opacity: 0.9; }
    66% { transform: translateY(20px) translateX(-20px) scale(0.8); opacity: 0.5; }
}

.form-wrapper {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
    animation: fadeIn 0.6s ease-out;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-logo {
    max-width: 150px;
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.form-subtitle {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #fee;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
    margin-bottom: 1.25rem;
    color: #dc3545;
    font-size: 0.85rem;
    animation: shake 0.5s ease-in-out;
}

.error-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Form Inputs */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    position: relative;
}

.input-label {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
    z-index: 1;
}

.input-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.form-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
    color: #1a1a1a;
}

.form-input:focus {
    outline: none !important;
    border: 1px solid var(--secondary-color, #f47f0d) !important;
    background: white;
    transform: none;
    box-shadow: none !important;
}

.form-input::placeholder {
    color: #adb5bd;
}

/* Submit Button */
.submit-button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color, #208620);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin-top: 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.submit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.button-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* Form Footer */
.form-footer {
    margin-top: 1rem;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.copyright {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
      opacity: 1;
        transform: translateY(0);
    }
  }

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

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}



/* Responsive Design */
@media (max-width: 968px) {
    .login-container {
        flex-direction: column;
    }

    .login-image-section {
        display: none;
    }

    .login-form-section {
        padding-top: 0;
        min-height: 100vh;
        display: flex;
        align-items: flex-start;
        padding-top: 20px;
    }

    .form-wrapper {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 8px;
        margin-top: 0;
    }

    .form-title {
        font-size: 1.75rem;
    }

    .form-logo {
        max-width: 150px;
    }
}

@media (max-width: 768px) {
    .login-image-section {
        display: none !important;
    }

    .login-form-section {
        padding: 0.5rem;
        padding-top: 10px;
        min-height: 100vh;
        display: flex;
        align-items: flex-start;
        justify-content: center;
    }

    .form-wrapper {
        padding: 1.5rem;
        margin: 0.5rem;
        margin-top: 0;
        border-radius: 8px;
        width: 100%;
        max-width: 100%;
    }

    .form-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-form-section {
        padding: 0.5rem;
        padding-top: 5px;
    }

    .form-wrapper {
        padding: 1.25rem;
        margin: 0.25rem;
        margin-top: 0;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

    .form-title {
        font-size: 1.4rem;
    }
    
    .form-logo {
        max-width: 120px;
    }
}

/* Loading State */
.submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-button:disabled:hover {
    transform: none;
}

/* Focus Visible for Accessibility */
.form-input:focus-visible {
    outline: none !important;
    border: 1px solid var(--secondary-color, #f47f0d) !important;
}

.submit-button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}
