* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #9e16ec;
    --primary-dark: #7a0ecc;
    --primary-light: #f3e8ff;
    --success: #00c853;
    --error: #ea1e5f;
    --text-dark: #1a1a2e;
    --text-gray: #6b6b7a;
    --text-light: #a0a0b0;
    --bg-white: #ffffff;
    --bg-gray: #f8f9fc;
    --shadow-lg: 0 20px 40px rgba(158,22,236,0.12);
}

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

button{
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

span{
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

/* ========== SECTION GAUCHE - DESKTOP ONLY ========== */
.brand-section {
    flex: 1.2;
    background: linear-gradient(145deg, #0a0a2a 0%, #0f0f3a 50%, #1a1a4a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

#starsCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.brand-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle at 30% 40%, rgba(158,22,236,0.15) 0%, rgba(80,40,150,0.05) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.brand-content {
    position: relative;
    z-index: 2;
    width: 100%;
    animation: fadeInUp 0.8s ease-out;
}

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

.logo-premium {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 15px;
    margin-bottom: 4rem;
    border-radius: 1rem;
    background-color: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.logo-premium-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

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

.logo-name {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

.logo-name span {
    font-weight: 300;
    background: linear-gradient(135deg, #ffffff 0%, #c9aaff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-tagline {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    text-align: center;
    letter-spacing: 1px;
}

.premium-title {
    margin-bottom: 1rem;
}

.title-line {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    line-height: 1.2;
}

.title-highlight {
    display: block;
    font-size: 2.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #c9aaff 50%, #9e16ec 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}

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

.features-premium {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.feature-premium {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem;
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.08);
}

.feature-icon {
    width: 38px;
    height: 38px;
    background: rgba(158,22,236,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon i {
    font-size: 1.1rem;
    color: #c9aaff;
}

.feature-info h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.feature-info p {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.5);
}

/* ========== SECTION DROITE - UI MOBILE APP ========== */
.auth-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    position: relative;
    overflow-y: auto;
}

/* Header PWA Premium */
.pwa-header {
    background: #22053d;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.75rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.pwa-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 500px;
    margin: 0 auto;
}

.pwa-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pwa-header-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 12px;
}

.pwa-header-title {
    display: flex;
    flex-direction: column;
}

.pwa-header-appname {
    font-size: 1.1rem;
    font-weight: 700;
    color: #eff4f6;
    letter-spacing: -0.3px;
}

.pwa-header-appname span {
    font-weight: 400;
    margin-left: 1px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.pwa-header-status {
    font-size: 0.65rem;
    color: #c8c8c8;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pwa-header-status i {
    font-size: 0.5rem;
    color: var(--success);
}

.pwa-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pwa-header-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-gray);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.pwa-header-icon:active {
    transform: scale(0.95);
    background: var(--primary-light);
}

.pwa-header-icon i {
    font-size: 1rem;
    color: var(--text-gray);
}

/* Contenu du formulaire */
.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.auth-card {
    max-width: 420px;
    width: 100%;
}

/* Filigrane */
.auth-content::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-image: url('medias/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

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

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

.auth-form {
    display: block;
    position: relative;
    z-index: 1;
}

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

.input-group label {

    padding-left: 20px;
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.input-group label i {
    margin-right: 0.4rem;
    color: var(--primary);
    font-size: 0.75rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 30px;
    border: 1.5px solid #d6acee;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Poppins', monospace;
    transition: all 0.2s ease;
    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(158,22,236,0.1);
}

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

.input-group.error input {
    border-color: var(--error);
}

.input-group.valid input {
    border-color: var(--success);
}

.pin-input-container {
    position: relative;
}

.pin-input-container input {
    padding-right: 3rem;
    font-family: 'Poppins', monospace;
}

.toggle-pin {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-gray);
    padding: 0.5rem;
    border-radius: 30px;
    transition: all 0.2s;
}

.toggle-pin:active {
    transform: translateY(-50%) scale(0.95);
}

.input-feedback {
    font-size: 0.7rem;
    margin-top: 0.4rem;
    margin-left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.input-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

.input-feedback.error {
    color: var(--error);
}

.input-feedback.success {
    color: var(--success);
}

.btn-container{

    width: 100%;
    display: flex;
    justify-content: center;

}

.btn-container .btn-auth {
    width: 90%;
    max-width: 250px;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.btn-auth:active {
    transform: scale(0.97);
}

.btn-auth:disabled {
    opacity: 0.7;
    transform: none;
}

.btn-auth .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

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

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    position: relative;
    z-index: 1;
}

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

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

.toast {
    position: fixed;
    max-width: 400px;
    bottom: 2rem;
    right: 1rem;
    background: var(--text-dark);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

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

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

.shake-animation {
    animation: shake 0.3s ease-in-out 0s 2;
}

/* ========== RESPONSIVE ========== */
/* Desktop : cacher le header PWA */
@media (min-width: 769px) {
    .pwa-header {
        display: none;
    }
}

/* Mobile : afficher le header PWA et cacher la section gauche */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .toast {
        left: 1rem;
        right: 1rem;
    }
    
    .brand-section {
        display: none;
    }
    
    .pwa-header {
        display: block;
    }
    
    .auth-content {
        padding: 1.5rem;
        min-height: calc(100vh - 73px);
    }
    
    .auth-header h2 {
        font-size: 1.6rem;
    }
    
    .auth-header p {
        font-size: 0.85rem;
    }
    
    .input-group input {
        padding: 1rem 1rem;
        font-size: 16px;
        border-radius: 18px;
    }
    
    .btn-auth {
        padding: 1rem;
        border-radius: 28px;
        margin-top: 0.8rem;
    }
}

@media (max-width: 480px) {
    .auth-content {
        padding: 1.2rem;
    }
    
    .auth-header h2 {
        font-size: 1.4rem;
    }
    
    .auth-header p {
        font-size: 0.8rem;
    }
    
    .input-group {
        margin-bottom: 1.2rem;
    }
    
    .input-group label {
        font-size: 0.75rem;
    }
    
    .input-group input {
        padding: 0.9rem 1rem;
    }
    
    .btn-auth {
        padding: 0.9rem;
        font-size: 0.95rem;
    }
    
    .auth-footer {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
    
    .pwa-header {
        padding: 0.6rem 1rem;
    }
    
    .pwa-header-logo {
        width: 34px;
        height: 34px;
    }
    
    .pwa-header-appname {
        font-size: 1rem;
    }
}
  