/* =====================================================
   AUTH PREMIUM CSS - TechTinkr V2
   Design "Waouh" - Split Screen avec animations
   ===================================================== */

/* =====================================================
   RESET & VARIABLES
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    /* Couleurs principales - Thème éclairci, violet subtil */
    --auth-bg-dark: #16151f;
    --auth-bg-gradient-start: #1e1c2a;
    --auth-bg-gradient-end: #13121a;
    --auth-bg-card: rgba(26, 25, 38, 0.92);
    --auth-accent: #6366f1;
    --auth-accent-light: #818cf8;
    --auth-accent-glow: rgba(99, 102, 241, 0.4);
    --auth-success: #22c55e;
    --auth-error: #ef4444;
    --auth-warning: #f59e0b;
    
    /* Texte */
    --auth-text-primary: #f5f5f7;
    --auth-text-secondary: rgba(245, 245, 247, 0.75);
    --auth-text-muted: rgba(245, 245, 247, 0.45);
    
    /* Bordures & surfaces */
    --auth-border: rgba(255, 255, 255, 0.1);
    --auth-border-hover: rgba(99, 102, 241, 0.45);
    --auth-surface: rgba(255, 255, 255, 0.05);
    --auth-surface-hover: rgba(255, 255, 255, 0.08);
    
    /* Transitions */
    --auth-transition-fast: 0.15s ease;
    --auth-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --auth-transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --auth-shadow-glow: 0 0 40px var(--auth-accent-glow);
    --auth-shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

/* =====================================================
   KEYFRAMES - ANIMATIONS
   ===================================================== */

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes border-glow {
    0%, 100% { border-color: rgba(99, 102, 241, 0.3); }
    50% { border-color: rgba(99, 102, 241, 0.6); }
}

@keyframes feature-cascade {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* =====================================================
   BODY & BACKGROUND
   ===================================================== */

.auth-premium-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--auth-bg-gradient-start) 0%, var(--auth-bg-dark) 50%, var(--auth-bg-gradient-end) 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--auth-text-primary);
    overflow-x: hidden;
}

/* Background animation container */
.auth-bg-animation {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

/* Orbes flottantes lumineuses */
.auth-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: float 20s infinite ease-in-out;
}

.auth-bg-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    top: -150px;
    left: -100px;
    animation-delay: 0s;
}

.auth-bg-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
    animation-duration: 25s;
}

.auth-bg-orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
    top: 50%;
    left: 30%;
    animation-delay: -14s;
    animation-duration: 30s;
}

/* Grille tech en arrière-plan */
.auth-bg-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

/* =====================================================
   SPLIT LAYOUT
   ===================================================== */

.auth-split-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Côté Branding (gauche sur desktop) */
.auth-branding-side {
    display: none;
    flex: 1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-branding-side::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--auth-border), transparent);
}

.auth-branding-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.auth-logo {
    display: inline-block;
    margin-bottom: 3rem;
    animation: slide-up 0.6s var(--auth-transition-slow) both;
}

.auth-logo img {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 0 20px var(--auth-accent-glow));
}

.auth-branding-text {
    animation: slide-up 0.6s var(--auth-transition-slow) 0.1s both;
}

.auth-branding-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem;
    color: var(--auth-text-primary);
}

.auth-brand-highlight {
    background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-tagline {
    font-size: 1.125rem;
    color: var(--auth-text-secondary);
    line-height: 1.6;
    margin: 0 0 3rem;
}

/* Features preview */
.auth-features-preview {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    transition: all var(--auth-transition);
    animation: feature-cascade 0.5s var(--auth-transition-slow) both;
}

.auth-feature-item:nth-child(1) { animation-delay: 0.3s; }
.auth-feature-item:nth-child(2) { animation-delay: 0.4s; }
.auth-feature-item:nth-child(3) { animation-delay: 0.5s; }

.auth-feature-item:hover {
    background: var(--auth-surface-hover);
    border-color: var(--auth-border-hover);
    transform: translateX(8px);
}

.auth-feature-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-light));
    border-radius: 10px;
}

.auth-feature-item span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--auth-text-primary);
}

/* Côté Formulaire (droit sur desktop, plein sur mobile) */
.auth-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    min-height: 100vh;
}

/* =====================================================
   CARTE AUTH
   ===================================================== */

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--auth-bg-card);
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    position: relative;
    animation: slide-up 0.6s var(--auth-transition-slow) both;
    box-shadow: var(--auth-shadow-card);
}

/* Bordure lumineuse animée */
.auth-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 25px;
    padding: 1px;
    background: linear-gradient(135deg, var(--auth-accent), transparent 40%, transparent 60%, var(--auth-accent-light));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
    animation: border-glow 3s infinite;
}

/* Logo mobile (visible uniquement sur mobile) */
.auth-mobile-logo {
    display: block;
    text-align: center;
    margin-bottom: 2rem;
}

.auth-mobile-logo img {
    height: 50px;
    filter: drop-shadow(0 0 15px var(--auth-accent-glow));
}

/* =====================================================
   HEADER AUTH
   ===================================================== */

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fade-in 0.5s 0.2s both;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--auth-text-primary);
    letter-spacing: -0.02em;
}

.auth-header p {
    font-size: 1rem;
    color: var(--auth-text-secondary);
    margin: 0;
}

.auth-header .auth-inspire {
    font-size: 0.9rem;
    color: var(--auth-accent-light);
    font-style: italic;
    margin-top: 0.75rem;
    opacity: 0.8;
}

/* =====================================================
   MESSAGES (SUCCESS / ERROR)
   ===================================================== */

.auth-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    animation: slide-up 0.4s var(--auth-transition) both;
}

.auth-message svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.auth-message-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.auth-message-error svg {
    color: var(--auth-error);
}

.auth-message-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.auth-message-success svg {
    color: var(--auth-success);
}

/* Animation shake pour erreur */
.auth-card.has-error {
    animation: shake 0.5s ease;
}

/* =====================================================
   BOUTONS OAUTH
   ===================================================== */

.auth-oauth-section {
    margin-bottom: 1.5rem;
    animation: fade-in 0.5s 0.3s both;
}

.auth-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    color: var(--auth-text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--auth-transition);
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
}

.auth-oauth-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity var(--auth-transition);
}

.auth-oauth-btn:hover {
    background: var(--auth-surface-hover);
    border-color: var(--auth-border-hover);
    transform: translateY(-2px);
    box-shadow: var(--auth-shadow-glow);
}

.auth-oauth-btn:hover::before {
    opacity: 1;
}

.auth-oauth-btn:active {
    transform: translateY(0);
}

.auth-oauth-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Google specific */
.auth-oauth-btn.google:hover {
    border-color: rgba(66, 133, 244, 0.5);
    box-shadow: 0 0 30px rgba(66, 133, 244, 0.2);
}

/* Apple specific */
.auth-oauth-btn.apple:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

/* =====================================================
   DIVIDER
   ===================================================== */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    animation: fade-in 0.5s 0.4s both;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--auth-border), transparent);
}

.auth-divider span {
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* =====================================================
   FORMULAIRE
   ===================================================== */

.auth-form {
    animation: fade-in 0.5s 0.5s both;
}

.auth-field {
    margin-bottom: 1.25rem;
}

.auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text-secondary);
    margin-bottom: 0.5rem;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    color: var(--auth-text-primary);
    font-size: 1rem;
    transition: all var(--auth-transition);
    outline: none;
}

.auth-input::placeholder {
    color: var(--auth-text-muted);
}

.auth-input:focus {
    background: var(--auth-surface-hover);
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Input avec icône */
.auth-input.has-icon {
    padding-right: 3rem;
}

.auth-input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    transition: color var(--auth-transition);
}

.auth-input-icon:hover {
    color: var(--auth-text-secondary);
}

/* Input validation states */
.auth-input.is-valid {
    border-color: var(--auth-success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.auth-input.is-invalid {
    border-color: var(--auth-error);
    animation: shake 0.5s ease;
}

.auth-error-text {
    font-size: 0.8rem;
    color: var(--auth-error);
    margin-top: 0.5rem;
}

/* Validation icon animated */
.auth-validation-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: all var(--auth-transition);
}

.auth-input.is-valid ~ .auth-validation-icon {
    opacity: 1;
    color: var(--auth-success);
}

/* =====================================================
   CHECKBOX & LINKS
   ===================================================== */

.auth-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.auth-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--auth-accent);
    cursor: pointer;
}

.auth-checkbox span {
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
}

.auth-link {
    font-size: 0.875rem;
    color: var(--auth-accent-light);
    text-decoration: none;
    transition: color var(--auth-transition);
}

.auth-link:hover {
    color: var(--auth-accent);
    text-decoration: underline;
}

/* =====================================================
   BOUTON SUBMIT
   ===================================================== */

.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--auth-accent), #8b5cf6);
    background-size: 200% 200%;
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--auth-transition);
    position: relative;
    overflow: hidden;
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
    animation: gradient-shift 3s infinite;
}

.auth-submit-btn:hover::before {
    transform: translateX(100%);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

/* Loading state */
.auth-submit-btn.is-loading {
    pointer-events: none;
    opacity: 0.8;
}

.auth-submit-btn.is-loading .btn-text {
    opacity: 0;
}

.auth-submit-btn .btn-loader {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
}

.auth-submit-btn.is-loading .btn-loader {
    opacity: 1;
}

/* =====================================================
   FOOTER CARD
   ===================================================== */

.auth-card-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--auth-border);
    animation: fade-in 0.5s 0.6s both;
}

.auth-card-footer p {
    font-size: 0.9rem;
    color: var(--auth-text-secondary);
    margin: 0;
}

.auth-card-footer a {
    color: var(--auth-accent-light);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--auth-transition);
}

.auth-card-footer a:hover {
    color: var(--auth-accent);
    text-decoration: underline;
}

/* =====================================================
   PAGE FOOTER
   ===================================================== */

.auth-footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    animation: fade-in 0.5s 0.7s both;
}

.auth-footer p {
    font-size: 0.8rem;
    color: var(--auth-text-muted);
    margin: 0 0 0.5rem;
}

.auth-footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.auth-footer-links a {
    font-size: 0.8rem;
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: color var(--auth-transition);
}

.auth-footer-links a:hover {
    color: var(--auth-text-secondary);
}

/* =====================================================
   RESPONSIVE - TABLET & DESKTOP
   ===================================================== */

@media (min-width: 768px) {
    .auth-card {
        padding: 3rem;
    }
    
    .auth-mobile-logo {
        display: none;
    }
}

@media (min-width: 1024px) {
    .auth-branding-side {
        display: flex;
    }
    
    .auth-form-side {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .auth-branding-side {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 1280px) {
    .auth-branding-text h2 {
        font-size: 3rem;
    }
    
    .auth-tagline {
        font-size: 1.25rem;
    }
    
    .auth-card {
        max-width: 450px;
    }
}

/* =====================================================
   ADDITIONAL FORM ELEMENTS
   ===================================================== */

/* Row for side-by-side fields */
.auth-field-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-field-half {
    flex: 1;
    min-width: 140px;
}

/* Helper text */
.auth-helper-text {
    display: block;
    font-size: 0.8rem;
    color: var(--auth-text-muted);
    margin-top: 0.5rem;
}

/* Trust message */
.auth-trust-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.75rem;
    background: var(--auth-surface);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--auth-text-muted);
}

.auth-trust-message svg {
    color: var(--auth-success);
}

/* =====================================================
   PREFERS REDUCED MOTION
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .auth-bg-orb {
        animation: none;
    }
}
   FOOTER CARD
   ===================================================== */

.auth-card-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--auth-border);
    animation: fade-in 0.5s 0.6s both;
}

.auth-card-footer p {
    font-size: 0.9rem;
    color: var(--auth-text-secondary);
    margin: 0;
}

.auth-card-footer a {
    color: var(--auth-accent-light);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--auth-transition);
}

.auth-card-footer a:hover {
    color: var(--auth-accent);
    text-decoration: underline;
}

/* =====================================================
   PAGE FOOTER
   ===================================================== */

.auth-footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    animation: fade-in 0.5s 0.7s both;
}

.auth-footer p {
    font-size: 0.8rem;
    color: var(--auth-text-muted);
    margin: 0 0 0.5rem;
}

.auth-footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.auth-footer-links a {
    font-size: 0.8rem;
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: color var(--auth-transition);
}

.auth-footer-links a:hover {
    color: var(--auth-text-secondary);
}

/* =====================================================
   RESPONSIVE - TABLET & DESKTOP
   ===================================================== */

@media (min-width: 768px) {
    .auth-card {
        padding: 3rem;
    }
    
    .auth-mobile-logo {
        display: none;
    }
}

@media (min-width: 1024px) {
    .auth-branding-side {
        display: flex;
    }
    
    .auth-form-side {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .auth-branding-side {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 1280px) {
    .auth-branding-text h2 {
        font-size: 3rem;
    }
    
    .auth-tagline {
        font-size: 1.25rem;
    }
    
    .auth-card {
        max-width: 450px;
    }
}

/* =====================================================
   PREFERS REDUCED MOTION
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .auth-bg-orb {
        animation: none;
    }