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

:root {
    --primary: #0e54ec;
    --primary-dark: #1353cb;
    --primary-light: #e8f0ff;
    --success: #00c853;
    --error: #ff3b30;
    --text-dark: #1a1a1a;
    --text-gray: #6b6b6b;
    --text-light: #999;
    --border: #e5e5e5;
    --bg-white: #ffffff;
    --bg-gray: #f8f9fa;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,85,255,0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-white);
    min-height: 100vh;
    color: var(--text-dark);
}

.container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}


/* SECTION GAUCHE - BRANDING */
.brand-section {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, #6d25e1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.brand-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: shift 20s linear infinite;
}

@keyframes shift {
    from { transform: translate(0, 0); }
    to { transform: translate(40px, 40px); }
}

.brand-content {
    position: relative;
    z-index: 1;
    max-width: 450px;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.logo i {
    font-size: 2rem;
    color: white;
}

.logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.logo span span {
    font-weight: 300;
}

.brand-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.brand-description {
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.features-mini {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.9);
    font-size: 0.875rem;
}

.feature-mini i {
    font-size: 1rem;
    color: #00ff88;
}

/* Logo mobile - caché par défaut */
.mobile-logo {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.mobile-logo i {
    font-size: 1.75rem;
    color: var(--primary);
}

.mobile-logo span {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.mobile-logo span span {
    font-weight: 300;
    color: var(--primary);
}

/* SECTION DROITE - AUTHENTIFICATION */


/* Filigrane dans la zone de connexion */
.auth-section {
    position: relative;
    overflow: hidden;
}

.auth-section::before {
    content: '';
    position: absolute;

    width: 140px;
    height: 140px;

    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);

    background-image: url('medias/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom right;
    opacity: 0.14;
    pointer-events: none;
    z-index: 0;
}

/* Version mobile */
@media (max-width: 768px) {
    .auth-section::before {
        width: 80px;
        height: 80px;
        bottom: 10px;
        right: 10px;
        opacity: 0.1;
    }
}

/* Version très petit mobile */
@media (max-width: 480px) {
    .auth-section::before {
        width: 60px;
        height: 60px;
        opacity: 0.08;
    }
}

.auth-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    padding: 2rem;
}

.auth-card {
    max-width: 420px;
    width: 100%;
    background: var(--bg-white);
}

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

.auth-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.auth-header p {
    font-size: 0.875rem;
    color: var(--text-gray);
}

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-gray);
    transition: all 0.2s;
    position: relative;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

/* Formulaires */
.auth-form {
    display: none;
    animation: fadeIn 0.3s ease;
}

.auth-form.active {
    display: block;
}

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

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.input-group label i {
    font-size: 0.75rem;
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-white);
    -webkit-appearance: none;
    appearance: none;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,85,255,0.1);
}

.input-group input::placeholder {
    color: var(--text-light);
}

/* PIN Input avec bouton toggle */
.pin-input-container {
    position: relative;
}

.pin-input-container input {
    padding-right: 3rem;
}

.toggle-pin {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-gray);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-pin:hover {
    color: var(--primary);
}

/* Bouton principal */
.btn-auth {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.btn-auth:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

/* Info démo */
.demo-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--primary-light);
    border-radius: 10px;
    font-size: 0.75rem;
    color: var(--primary);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.demo-info i {
    font-size: 0.75rem;
}

/* Footer */
.auth-footer {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.auth-footer p {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-dark);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    max-width: 90%;
    white-space: normal;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--error);
}

/* ============================================ */
/* RESPONSIVE DESIGN - CORRECTIONS IMPORTANTES */
/* ============================================ */

/* Tablettes (768px - 1024px) */
@media (max-width: 1024px) {
    .brand-content h1 {
        font-size: 2rem;
    }
    
    .brand-description {
        font-size: 0.875rem;
    }
    
    .features-mini {
        gap: 0.5rem;
    }
    
    .feature-mini {
        font-size: 0.75rem;
    }
}

/* Mobiles et tablettes (moins de 768px) */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    /* Cacher la section branding sur mobile */
    .brand-section {
        display: none;
    }
    
    /* Afficher le logo mobile */
    .mobile-logo {
        display: flex;
    }
    
    /* Ajuster la section auth */
    .auth-section {
        flex: 1;
        padding: 1.5rem;
        align-items: center;
        min-height: 100vh;
    }
    
    .auth-card {
        max-width: 100%;
        padding: 0;
    }
    
    .auth-header {
        margin-bottom: 1.5rem;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .auth-header p {
        font-size: 0.8125rem;
    }
    
    /* Ajuster les inputs pour mobile */
    .input-group input {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Augmenter la zone de clic des boutons pour mobile */
    .tab-btn {
        padding: 0.875rem;
        font-size: 0.875rem;
    }
    
    .btn-auth {
        padding: 1rem;
        font-size: 0.9375rem;
    }
    
    /* Ajuster le toast pour mobile */
    .toast {
        bottom: 1rem;
        font-size: 0.8125rem;
        padding: 0.625rem 1.25rem;
    }
}

/* Petits mobiles (moins de 480px) */
@media (max-width: 480px) {
    .auth-section {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .auth-header h2 {
        font-size: 1.35rem;
    }
    
    .auth-header p {
        font-size: 0.75rem;
    }
    
    .mobile-logo {
        margin-bottom: 1.5rem;
    }
    
    .mobile-logo i {
        font-size: 1.5rem;
    }
    
    .mobile-logo span {
        font-size: 1.125rem;
    }
    
    .auth-tabs {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .tab-btn {
        padding: 0.625rem;
        font-size: 0.8125rem;
    }
    
    .input-group {
        margin-bottom: 1.25rem;
    }
    
    .input-group label {
        font-size: 0.75rem;
    }
    
    .input-group input {
        padding: 0.7rem 0.875rem;
        font-size: 0.875rem;
    }
    
    .btn-auth {
        padding: 0.875rem;
        font-size: 0.875rem;
        margin-top: 0.25rem;
    }
    
    .demo-info {
        font-size: 0.6875rem;
        padding: 0.625rem;
    }
    
    .auth-footer {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
    
    .auth-footer p {
        font-size: 0.6875rem;
    }
}

/* Très petits mobiles (moins de 380px) */
@media (max-width: 380px) {
    .auth-section {
        padding: 0.75rem;
        padding-top: 1.5rem;
    }
    
    .mobile-logo {
        margin-bottom: 1rem;
    }
    
    .auth-header {
        margin-bottom: 1rem;
    }
    
    .auth-header h2 {
        font-size: 1.25rem;
    }
    
    .tab-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    .demo-info {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Ajustements pour les écrans très hauts (iPhone 12/13/14 Pro Max) */
@media (min-height: 800px) and (max-width: 768px) {
    .auth-section {
        align-items: center;
        padding: 2rem;
    }
    
    .auth-card {
        max-width: 400px;
    }
}

/* Support pour la barre d'outils mobile (safe area) */
@supports (padding: max(0px)) {
    .auth-section {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}