/* Modern Sophisticated Design for Create Account Page - ISOFISH Dakhla */

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables CSS pour la cohérence */
:root {
    --primary-color: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* Typographie moderne */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Arrière-plan animé sophistiqué */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundMove 20s ease-in-out infinite;
}

@keyframes backgroundMove {
    0%, 100% { transform: translateX(0) translateY(0); }
    33% { transform: translateX(-10px) translateY(-10px); }
    66% { transform: translateX(10px) translateY(10px); }
}

/* Particules flottantes */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.3), transparent);
    background-repeat: repeat;
    background-size: 150px 100px;
    z-index: -1;
    animation: particleFloat 15s linear infinite;
}

@keyframes particleFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-100px); }
}

/* Container principal */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Codrops top - masqué pour un design plus épuré */
.codrops-top {
    display: none;
}

/* Header avec bouton retour sophistiqué */
header {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 10;
}

header a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

header a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background: rgba(255, 255, 255, 1);
}

header a img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(214deg) brightness(97%) contrast(97%);
}

header a::before {
    content: '←';
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Container de démonstration */
#container_demo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 0;
}

/* Wrapper principal avec effet glassmorphism avancé */
#wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 500px;
    position: relative;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

/* Effet de brillance sur le wrapper */
#wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Formulaire de création de compte */
#login {
    position: relative;
    z-index: 2;
}

/* Logo et branding sophistiqué */
.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    width: 70px;
    height: 70px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.logo-icon:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

.logo-icon::before {
    content: '🐟';
    font-size: 1.75rem;
    filter: brightness(0) invert(1);
    animation: logoFloat 2s ease-in-out infinite;
}

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

.logo-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.logo-icon:hover::after {
    left: 100%;
}

.brand-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    letter-spacing: -0.025em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Titre principal */
#login h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.025em;
    position: relative;
}

#login h1::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* Tableau de formulaire modernisé */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 1rem;
}

table td {
    vertical-align: top;
    padding: 0;
}

table td:first-child {
    width: 40%;
    padding-right: 1rem;
}

/* Labels sophistiqués */
table td:first-child {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    height: 3rem;
    position: relative;
}

table td:first-child::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary-gradient);
    border-radius: 2px;
    opacity: 0;
    transition: var(--transition);
}

table tr:hover td:first-child::before {
    opacity: 1;
}

/* Champs de saisie ultra-sophistiqués */
input[type="text"], 
input[type="password"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--surface-color);
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
    position: relative;
}

input[type="text"]:focus, 
input[type="password"]:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
    background: rgba(59, 130, 246, 0.02);
}

input[type="text"]:hover, 
input[type="password"]:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

/* Animation de validation en temps réel */
input[type="text"]:valid, 
input[type="password"]:valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg width='16' height='16' fill='%2310b981' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
}

/* Placeholder sophistiqué */
input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
}

/* Bouton d'enregistrement ultra-sophistiqué */
input[type="submit"] {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: var(--shadow);
}

/* Effet de vague sur le bouton */
input[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

input[type="submit"]:hover::before {
    left: 100%;
}

/* Section de branding */
.brand-section {
    text-align: center;
    margin: 2rem 0 1rem;
    padding: 1.5rem;
    background: rgba(30, 58, 138, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(30, 58, 138, 0.1);
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    letter-spacing: -0.025em;
}

.brand-location {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-light);
    letter-spacing: -0.025em;
}

/* Messages d'erreur sophistiqués */
.message {
    margin-top: 1rem;
}

.message font[color="red"] {
    color: var(--error-color) !important;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    position: relative;
    animation: errorShake 0.5s ease-in-out;
}

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

.message font[color="red"]::before {
    content: '⚠️';
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    header {
        top: 1rem;
        left: 1rem;
    }
    
    #wrapper {
        padding: 2rem 1.5rem;
        margin: 1rem;
        max-width: none;
    }
    
    .brand-title {
        font-size: 1.5rem;
    }
    
    #login h1 {
        font-size: 1.5rem;
    }
    
    table td:first-child {
        width: 100%;
        padding-right: 0;
        margin-bottom: 0.5rem;
        height: auto;
    }
    
    table {
        border-spacing: 0 0.5rem;
    }
    
    table td {
        display: block;
    }
}

@media (max-width: 480px) {
    #wrapper {
        padding: 1.5rem 1rem;
    }
    
    .logo-icon {
        width: 60px;
        height: 60px;
    }
    
    .brand-title {
        font-size: 1.25rem;
    }
    
    #login h1 {
        font-size: 1.25rem;
    }
}

/* Animations d'entrée sophistiquées */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#wrapper {
    animation: fadeInUp 0.8s ease-out;
}

header {
    animation: slideInLeft 0.6s ease-out 0.2s both;
}

table tr {
    animation: fadeInUp 0.6s ease-out calc(0.1s * var(--index)) both;
}

table tr:nth-child(1) { --index: 1; }
table tr:nth-child(2) { --index: 2; }
table tr:nth-child(3) { --index: 3; }
table tr:nth-child(4) { --index: 4; }

/* Amélioration de l'accessibilité */
input:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

/* États de chargement */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Masquer les éléments non nécessaires */
.hiddenanchor {
    display: none;
}

.keeplogin {
    display: none;
}

/* Support du mode sombre */
@media (prefers-color-scheme: dark) {
    :root {
        --surface-color: rgba(30, 41, 59, 0.95);
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --border-color: #334155;
    }
    
    #wrapper {
        background: rgba(30, 41, 59, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Réduction des animations pour les utilisateurs sensibles */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body::before,
    body::after {
        animation: none;
    }
}

