/**
 * Phone Auth - Styles des formulaires
 * Version 4.1.0 - Thèmes, Mode Sombre avec Toggle, Animations avancées
 *
 * 🎨 PERSONNALISATION FACILE :
 * Modifiez les variables CSS ci-dessous pour changer rapidement l'apparence.
 *
 * THÈMES DISPONIBLES :
 * - phone-auth-theme-modern (défaut)
 * - phone-auth-theme-minimal
 * - phone-auth-theme-colorful
 */

/* ========================================
   VARIABLES CSS - MODE CLAIR (THÈME MODERN)
   ======================================== */
:root {
    /* Couleurs principales */
    --phone-auth-primary: #6366f1;
    --phone-auth-primary-hover: #4f46e5;
    --phone-auth-primary-light: #eef2ff;
    --phone-auth-primary-rgb: 99, 102, 241;
    --phone-auth-secondary: #8b5cf6;

    /* Couleurs de fond */
    --phone-auth-bg: #ffffff;
    --phone-auth-bg-page: #f1f5f9;
    --phone-auth-bg-overlay: rgba(15, 23, 42, 0.6);
    --phone-auth-bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Couleurs de texte */
    --phone-auth-text: #1e293b;
    --phone-auth-text-light: #64748b;
    --phone-auth-text-placeholder: #94a3b8;

    /* Couleurs des inputs */
    --phone-auth-input-bg: #f8fafc;
    --phone-auth-input-border: #e2e8f0;
    --phone-auth-input-focus: #6366f1;

    /* Couleurs des messages */
    --phone-auth-success: #10b981;
    --phone-auth-success-bg: #ecfdf5;
    --phone-auth-warning: #f59e0b;
    --phone-auth-warning-bg: #fffbeb;
    --phone-auth-error: #ef4444;
    --phone-auth-error-bg: #fef2f2;
    --phone-auth-info: #3b82f6;
    --phone-auth-info-bg: #eff6ff;

    /* WhatsApp */
    --phone-auth-whatsapp: #25d366;
    --phone-auth-whatsapp-hover: #128c7e;

    /* Force du mot de passe */
    --phone-auth-strength-weak: #ef4444;
    --phone-auth-strength-fair: #f59e0b;
    --phone-auth-strength-good: #10b981;
    --phone-auth-strength-strong: #059669;

    /* Dimensions */
    --phone-auth-radius: 16px;
    --phone-auth-radius-sm: 12px;
    --phone-auth-radius-xs: 8px;
    --phone-auth-max-width: 420px;

    /* Ombres */
    --phone-auth-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --phone-auth-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --phone-auth-shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Transitions & Animations */
    --phone-auth-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --phone-auth-transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --phone-auth-transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========================================
   VARIABLES CSS - MODE SOMBRE (via bouton toggle)
   ======================================== */
/* Mode sombre activé via classe .phone-auth-dark */
.phone-auth-dark,
[data-theme="dark"],
.dark .phone-auth-container,
.dark .phone-auth-modal-overlay {
    --phone-auth-primary: #818cf8;
    --phone-auth-primary-hover: #a5b4fc;
    --phone-auth-primary-light: rgba(129, 140, 248, 0.15);
    --phone-auth-secondary: #a78bfa;
    --phone-auth-bg: #1e293b;
    --phone-auth-bg-page: #0f172a;
    --phone-auth-bg-overlay: rgba(0, 0, 0, 0.8);
    --phone-auth-bg-gradient: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    --phone-auth-text: #f1f5f9;
    --phone-auth-text-light: #94a3b8;
    --phone-auth-text-placeholder: #64748b;
    --phone-auth-input-bg: #334155;
    --phone-auth-input-border: #475569;
    --phone-auth-success-bg: rgba(16, 185, 129, 0.15);
    --phone-auth-warning-bg: rgba(245, 158, 11, 0.15);
    --phone-auth-error-bg: rgba(239, 68, 68, 0.15);
    --phone-auth-info-bg: rgba(59, 130, 246, 0.15);
}

/* ========================================
   THÈME MINIMAL
   ======================================== */
.phone-auth-theme-minimal,
[data-phone-auth-theme="minimal"] {
    --phone-auth-primary: #18181b;
    --phone-auth-primary-hover: #3f3f46;
    --phone-auth-primary-light: #f4f4f5;
    --phone-auth-radius: 8px;
    --phone-auth-radius-sm: 6px;
    --phone-auth-shadow-xl: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.phone-auth-theme-minimal .phone-auth-card,
[data-phone-auth-theme="minimal"] .phone-auth-card {
    border: 1px solid var(--phone-auth-input-border);
    box-shadow: none;
}

.phone-auth-theme-minimal .phone-auth-icon,
[data-phone-auth-theme="minimal"] .phone-auth-icon {
    background: transparent;
    border: 2px solid var(--phone-auth-input-border);
}

.phone-auth-theme-minimal .phone-auth-submit,
[data-phone-auth-theme="minimal"] .phone-auth-submit {
    border-radius: 6px;
}

/* Mode sombre pour thème minimal */
@media (prefers-color-scheme: dark) {
    .phone-auth-theme-minimal:not(.phone-auth-light),
    [data-phone-auth-theme="minimal"]:not(.phone-auth-light) {
        --phone-auth-primary: #fafafa;
        --phone-auth-primary-hover: #e4e4e7;
    }
}

/* ========================================
   THÈME COLORFUL
   ======================================== */
.phone-auth-theme-colorful,
[data-phone-auth-theme="colorful"] {
    --phone-auth-primary: #ec4899;
    --phone-auth-primary-hover: #db2777;
    --phone-auth-primary-light: #fdf2f8;
    --phone-auth-secondary: #8b5cf6;
    --phone-auth-bg-gradient: linear-gradient(135deg, #f472b6 0%, #818cf8 50%, #38bdf8 100%);
    --phone-auth-radius: 24px;
    --phone-auth-radius-sm: 16px;
}

.phone-auth-theme-colorful .phone-auth-container,
[data-phone-auth-theme="colorful"] .phone-auth-container {
    background: var(--phone-auth-bg-gradient);
}

.phone-auth-theme-colorful .phone-auth-card,
[data-phone-auth-theme="colorful"] .phone-auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.phone-auth-theme-colorful .phone-auth-icon,
[data-phone-auth-theme="colorful"] .phone-auth-icon {
    background: var(--phone-auth-bg-gradient);
    animation: phoneAuthColorRotate 3s ease-in-out infinite;
}

.phone-auth-theme-colorful .phone-auth-icon svg,
[data-phone-auth-theme="colorful"] .phone-auth-icon svg {
    color: #ffffff;
}

.phone-auth-theme-colorful .phone-auth-submit,
[data-phone-auth-theme="colorful"] .phone-auth-submit {
    background: var(--phone-auth-bg-gradient);
    background-size: 200% 200%;
    animation: phoneAuthGradientShift 3s ease infinite;
}

@keyframes phoneAuthColorRotate {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

@keyframes phoneAuthGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Mode sombre pour thème colorful */
@media (prefers-color-scheme: dark) {
    .phone-auth-theme-colorful .phone-auth-card,
    [data-phone-auth-theme="colorful"] .phone-auth-card {
        background: rgba(30, 41, 59, 0.95);
    }
}

/* ========================================
   RESET ET BASE
   ======================================== */
.phone-auth-container *,
.phone-auth-modal-overlay *,
.phone-auth-card * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========================================
   CONTAINER / PAGE COMPLÈTE
   ======================================== */
.phone-auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--phone-auth-bg-page);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ========================================
   OVERLAY MODAL
   ======================================== */
.phone-auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--phone-auth-bg-overlay);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: var(--phone-auth-transition);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.phone-auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.phone-auth-modal-overlay.active .phone-auth-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ========================================
   CARTE DU FORMULAIRE
   ======================================== */
.phone-auth-card {
    width: 100%;
    max-width: var(--phone-auth-max-width);
    background: var(--phone-auth-bg);
    border-radius: var(--phone-auth-radius);
    box-shadow: var(--phone-auth-shadow-xl);
    padding: 40px;
    position: relative;
    transform: translateY(30px) scale(0.9);
    opacity: 0;
    animation: phoneAuthSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Bouton fermer modal */
.phone-auth-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--phone-auth-input-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--phone-auth-text-light);
    transition: var(--phone-auth-transition);
}

.phone-auth-close-btn:hover {
    background: var(--phone-auth-error-bg);
    color: var(--phone-auth-error);
    transform: rotate(90deg);
}

.phone-auth-close-btn svg {
    width: 20px;
    height: 20px;
}

@keyframes phoneAuthSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animation d'entrée échelonnée pour les champs */
.phone-auth-card .phone-auth-field {
    opacity: 0;
    animation: phoneAuthFadeInUp 0.4s ease forwards;
}

.phone-auth-card .phone-auth-field:nth-child(1) { animation-delay: 0.1s; }
.phone-auth-card .phone-auth-field:nth-child(2) { animation-delay: 0.15s; }
.phone-auth-card .phone-auth-field:nth-child(3) { animation-delay: 0.2s; }
.phone-auth-card .phone-auth-field:nth-child(4) { animation-delay: 0.25s; }
.phone-auth-card .phone-auth-field:nth-child(5) { animation-delay: 0.3s; }

.phone-auth-card .phone-auth-submit {
    opacity: 0;
    animation: phoneAuthFadeInUp 0.4s ease forwards;
    animation-delay: 0.35s;
}

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

/* ========================================
   EN-TÊTE
   ======================================== */
.phone-auth-header {
    text-align: center;
    margin-bottom: 32px;
    animation: phoneAuthFadeIn 0.5s ease forwards;
}

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

.phone-auth-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--phone-auth-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: phoneAuthPulse 2s ease-in-out infinite, phoneAuthFloat 3s ease-in-out infinite;
}

@keyframes phoneAuthPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--phone-auth-primary-rgb), 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(var(--phone-auth-primary-rgb), 0); }
}

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

.phone-auth-icon svg {
    width: 40px;
    height: 40px;
    color: var(--phone-auth-primary);
}

.phone-auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--phone-auth-text);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.phone-auth-subtitle {
    font-size: 16px;
    color: var(--phone-auth-text-light);
    margin: 0;
}

/* ========================================
   FORMULAIRE
   ======================================== */
.phone-auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   CHAMPS DE FORMULAIRE
   ======================================== */
.phone-auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.phone-auth-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--phone-auth-text);
}

.phone-auth-field label svg {
    width: 18px;
    height: 18px;
    color: var(--phone-auth-text-light);
    transition: var(--phone-auth-transition);
}

.phone-auth-field:focus-within label svg {
    color: var(--phone-auth-primary);
    transform: scale(1.1);
}

.phone-auth-field input[type="text"],
.phone-auth-field input[type="tel"],
.phone-auth-field input[type="email"],
.phone-auth-field input[type="password"] {
    width: 100%;
    padding: 16px 18px;
    font-size: 16px;
    color: var(--phone-auth-text);
    background: var(--phone-auth-input-bg);
    border: 2px solid var(--phone-auth-input-border);
    border-radius: var(--phone-auth-radius-sm);
    outline: none;
    transition: var(--phone-auth-transition);
    box-sizing: border-box;
}

.phone-auth-field input::placeholder {
    color: var(--phone-auth-text-placeholder);
}

.phone-auth-field input:focus {
    border-color: var(--phone-auth-input-focus);
    background: var(--phone-auth-bg);
    box-shadow: 0 0 0 4px var(--phone-auth-primary-light);
    transform: translateY(-2px);
}

/* Animation de shake pour erreur */
.phone-auth-field.error input {
    border-color: var(--phone-auth-error);
    animation: phoneAuthShake 0.5s ease;
}

@keyframes phoneAuthShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* Animation de succès */
.phone-auth-field.success input {
    border-color: var(--phone-auth-success);
}

/* ========================================
   INDICATEUR FORCE MOT DE PASSE
   ======================================== */
.phone-auth-password-strength {
    margin-top: 10px;
}

.phone-auth-strength-bar {
    height: 6px;
    background: var(--phone-auth-input-border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.phone-auth-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: var(--phone-auth-transition-bounce);
}

.phone-auth-strength-fill.weak {
    width: 25%;
    background: var(--phone-auth-strength-weak);
}

.phone-auth-strength-fill.fair {
    width: 50%;
    background: var(--phone-auth-strength-fair);
}

.phone-auth-strength-fill.good {
    width: 75%;
    background: var(--phone-auth-strength-good);
}

.phone-auth-strength-fill.strong {
    width: 100%;
    background: var(--phone-auth-strength-strong);
}

.phone-auth-strength-text {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.phone-auth-strength-text.weak { color: var(--phone-auth-strength-weak); }
.phone-auth-strength-text.fair { color: var(--phone-auth-strength-fair); }
.phone-auth-strength-text.good { color: var(--phone-auth-strength-good); }
.phone-auth-strength-text.strong { color: var(--phone-auth-strength-strong); }

.phone-auth-strength-text svg {
    width: 14px;
    height: 14px;
}

/* ========================================
   MOT DE PASSE AVEC TOGGLE
   ======================================== */
.phone-auth-password-wrapper {
    position: relative;
    display: flex;
}

.phone-auth-password-wrapper input {
    flex: 1;
    padding-right: 50px;
}

.phone-auth-toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--phone-auth-text-light);
    transition: var(--phone-auth-transition);
    border-radius: 6px;
}

.phone-auth-toggle-password:hover {
    color: var(--phone-auth-primary);
    background: var(--phone-auth-primary-light);
}

.phone-auth-toggle-password svg {
    width: 22px;
    height: 22px;
}

/* ========================================
   BOUTON SUBMIT
   ======================================== */
.phone-auth-submit {
    width: 100%;
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: var(--phone-auth-primary);
    border: none;
    border-radius: var(--phone-auth-radius-sm);
    cursor: pointer;
    transition: var(--phone-auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.phone-auth-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.phone-auth-submit:hover::before {
    left: 100%;
}

.phone-auth-submit:hover {
    background: var(--phone-auth-primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(var(--phone-auth-primary-rgb), 0.4);
}

.phone-auth-submit:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(var(--phone-auth-primary-rgb), 0.3);
}

.phone-auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.phone-auth-submit:disabled::before {
    display: none;
}

/* Loader animé */
.phone-auth-submit-loader .spinner {
    width: 24px;
    height: 24px;
    animation: phoneAuthSpin 0.8s linear infinite;
}

.phone-auth-submit-loader .spinner circle {
    stroke-dasharray: 60;
    stroke-dashoffset: 45;
}

@keyframes phoneAuthSpin {
    100% { transform: rotate(360deg); }
}

/* ========================================
   BOUTON TRIGGER MODAL
   ======================================== */
.phone-auth-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.phone-auth-trigger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: var(--phone-auth-primary);
    border: none;
    border-radius: var(--phone-auth-radius-sm);
    cursor: pointer;
    transition: var(--phone-auth-transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.phone-auth-trigger-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    transform: scale(0);
    transition: transform 0.5s;
}

.phone-auth-trigger-btn:active::after {
    transform: scale(2);
    transition: 0s;
}

.phone-auth-trigger-btn:hover {
    background: var(--phone-auth-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--phone-auth-primary-rgb), 0.35);
    color: #ffffff;
    text-decoration: none;
}

.phone-auth-trigger-btn.outline {
    background: transparent;
    color: var(--phone-auth-primary);
    border: 2px solid var(--phone-auth-primary);
}

.phone-auth-trigger-btn.outline:hover {
    background: var(--phone-auth-primary);
    color: #ffffff;
}

/* Info utilisateur connecté */
.phone-auth-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.phone-auth-user-info span {
    font-weight: 600;
    color: var(--phone-auth-text);
}

/* ========================================
   WHATSAPP BUTTON
   ======================================== */
.phone-auth-forgot {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--phone-auth-input-border);
}

.phone-auth-forgot p {
    font-size: 14px;
    color: var(--phone-auth-text-light);
    margin: 0 0 12px 0;
}

.phone-auth-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--phone-auth-whatsapp);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--phone-auth-radius-sm);
    transition: var(--phone-auth-transition);
}

.phone-auth-whatsapp-btn:hover {
    background: var(--phone-auth-whatsapp-hover);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.35);
    text-decoration: none;
}

.phone-auth-whatsapp-btn svg {
    width: 22px;
    height: 22px;
}

/* ========================================
   FOOTER
   ======================================== */
.phone-auth-footer {
    text-align: center;
    margin-top: 28px;
    animation: phoneAuthFadeIn 0.5s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.phone-auth-footer p {
    font-size: 14px;
    color: var(--phone-auth-text-light);
    margin: 0;
}

.phone-auth-link {
    color: var(--phone-auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--phone-auth-transition);
    cursor: pointer;
    position: relative;
}

.phone-auth-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--phone-auth-primary);
    transition: width 0.3s ease;
}

.phone-auth-link:hover::after {
    width: 100%;
}

.phone-auth-link:hover {
    color: var(--phone-auth-primary-hover);
}

/* ========================================
   SYSTÈME DE TOAST
   ======================================== */
.phone-auth-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.phone-auth-toast {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 22px;
    background: var(--phone-auth-bg);
    border-radius: var(--phone-auth-radius-sm);
    box-shadow: var(--phone-auth-shadow-lg);
    min-width: 320px;
    max-width: 420px;
    pointer-events: auto;
    transform: translateX(120%);
    transition: var(--phone-auth-transition-slow);
    border-left: 4px solid var(--phone-auth-info);
    position: relative;
    overflow: hidden;
}

.phone-auth-toast.show {
    transform: translateX(0);
}

.phone-auth-toast.hiding {
    transform: translateX(120%) scale(0.9);
    opacity: 0;
}

.phone-auth-toast.success { border-left-color: var(--phone-auth-success); }
.phone-auth-toast.error { border-left-color: var(--phone-auth-error); }
.phone-auth-toast.warning { border-left-color: var(--phone-auth-warning); }
.phone-auth-toast.info { border-left-color: var(--phone-auth-info); }

.phone-auth-toast-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    animation: phoneAuthBounceIn 0.5s ease;
}

@keyframes phoneAuthBounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.phone-auth-toast.success .phone-auth-toast-icon { color: var(--phone-auth-success); }
.phone-auth-toast.error .phone-auth-toast-icon { color: var(--phone-auth-error); }
.phone-auth-toast.warning .phone-auth-toast-icon { color: var(--phone-auth-warning); }
.phone-auth-toast.info .phone-auth-toast-icon { color: var(--phone-auth-info); }

.phone-auth-toast-content {
    flex: 1;
}

.phone-auth-toast-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--phone-auth-text);
    margin-bottom: 4px;
}

.phone-auth-toast-message {
    font-size: 14px;
    color: var(--phone-auth-text-light);
    line-height: 1.5;
}

.phone-auth-toast-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--phone-auth-text-light);
    transition: var(--phone-auth-transition);
    flex-shrink: 0;
    border-radius: 4px;
}

.phone-auth-toast-close:hover {
    color: var(--phone-auth-text);
    background: var(--phone-auth-input-bg);
}

.phone-auth-toast-close svg {
    width: 18px;
    height: 18px;
}

/* Progress bar pour auto-dismiss */
.phone-auth-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    border-radius: 0 0 0 var(--phone-auth-radius-sm);
    animation: phoneAuthToastProgress 5s linear forwards;
}

@keyframes phoneAuthToastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ========================================
   PAGE PROFIL UTILISATEUR
   ======================================== */
.phone-auth-profile-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
}

.phone-auth-profile-card {
    background: var(--phone-auth-bg);
    border-radius: var(--phone-auth-radius);
    box-shadow: var(--phone-auth-shadow-lg);
    overflow: hidden;
}

.phone-auth-profile-header {
    background: var(--phone-auth-bg-gradient);
    padding: 40px 30px;
    text-align: center;
    color: #ffffff;
}

.phone-auth-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    object-fit: cover;
    margin-bottom: 15px;
    transition: var(--phone-auth-transition);
}

.phone-auth-profile-avatar:hover {
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.6);
}

.phone-auth-profile-name {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.phone-auth-profile-phone {
    font-size: 14px;
    opacity: 0.9;
}

.phone-auth-profile-body {
    padding: 30px;
}

.phone-auth-profile-section {
    margin-bottom: 25px;
}

.phone-auth-profile-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--phone-auth-text);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.phone-auth-profile-section h3 svg {
    width: 20px;
    height: 20px;
    color: var(--phone-auth-primary);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 480px) {
    .phone-auth-container {
        padding: 16px;
        min-height: auto;
    }

    .phone-auth-card {
        padding: 28px 20px;
        border-radius: var(--phone-auth-radius-sm);
    }

    .phone-auth-title {
        font-size: 24px;
    }

    .phone-auth-icon {
        width: 70px;
        height: 70px;
    }

    .phone-auth-icon svg {
        width: 35px;
        height: 35px;
    }

    .phone-auth-toast-container {
        left: 16px;
        right: 16px;
        top: 16px;
    }

    .phone-auth-toast {
        min-width: auto;
        width: 100%;
    }

    .phone-auth-buttons {
        flex-direction: column;
    }

    .phone-auth-trigger-btn {
        width: 100%;
    }
}

/* ========================================
   BOUTON TOGGLE MODE SOMBRE/CLAIR
   ======================================== */
.phone-auth-theme-toggle {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--phone-auth-input-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--phone-auth-text-light);
    transition: var(--phone-auth-transition);
    z-index: 10;
    box-shadow: var(--phone-auth-shadow);
}

.phone-auth-theme-toggle:hover {
    background: var(--phone-auth-primary-light);
    color: var(--phone-auth-primary);
    transform: rotate(15deg) scale(1.1);
}

.phone-auth-theme-toggle svg {
    width: 22px;
    height: 22px;
    transition: var(--phone-auth-transition);
}

.phone-auth-theme-toggle .icon-sun,
.phone-auth-theme-toggle .icon-moon {
    position: absolute;
}

/* Animation de rotation pour le changement d'icône */
.phone-auth-theme-toggle:active {
    transform: rotate(180deg) scale(0.9);
}

/* Position dans le profil */
.phone-auth-profile-card .phone-auth-theme-toggle {
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.phone-auth-profile-card .phone-auth-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

/* ========================================
   UTILITAIRES
   ======================================== */
.phone-auth-hidden {
    display: none !important;
}

.phone-auth-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animation de chargement skeleton */
.phone-auth-skeleton {
    background: linear-gradient(90deg, var(--phone-auth-input-bg) 25%, var(--phone-auth-input-border) 50%, var(--phone-auth-input-bg) 75%);
    background-size: 200% 100%;
    animation: phoneAuthSkeleton 1.5s ease-in-out infinite;
}

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

/* Animation de confetti pour succès */
.phone-auth-confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999998;
}
