/* Modern Sophisticated Design for 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é */
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); }
}

/* 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 - style moderne */
header {
    text-align: center;
    margin-bottom: 2rem;
}

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

/* Wrapper principal */
#wrapper {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Effet glassmorphism */
#wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--border-radius-lg);
    z-index: -1;
}

/* Formulaire de connexion */
#login {
    position: relative;
}

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

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

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

.logo-icon:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.logo-icon::before {
    content: '🐟';
    font-size: 1.5rem;
    filter: brightness(0) invert(1);
}

.brand-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    letter-spacing: -0.025em;
}

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

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

table td, table th {
    padding: 0.75rem 0;
    vertical-align: middle;
}

/* Labels modernes */
.uname, th {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Champs de saisie modernes */
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;
}

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);
}

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

/* Placeholder moderne */
input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

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

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 brillance 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.2), transparent);
    transition: left 0.5s;
}

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

/* Section de branding */
.keeplogin {
    text-align: center;
    margin: 1.5rem 0;
}

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

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

/* Messages d'erreur modernes */
.message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

.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;
    display: block;
    position: relative;
}

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

/* Lien de création de compte */
h1 a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    background: rgba(30, 58, 138, 0.1);
    border: 1px solid rgba(30, 58, 138, 0.2);
    transition: var(--transition);
    position: absolute;
    top: 1rem;
    right: 1rem;
}

h1 a:hover {
    background: rgba(30, 58, 138, 0.15);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    #wrapper {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .brand-title {
        font-size: 1.5rem;
    }
    
    #login h1 {
        font-size: 1.75rem;
    }
    
    h1 a {
        position: static;
        margin-bottom: 1rem;
        align-self: flex-end;
    }
    
    .container {
        display: flex;
        flex-direction: column;
    }
}

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

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

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

/* 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;
}

/* Amélioration du contraste pour l'accessibilité */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
}

/* Support du mode sombre */
@media (prefers-color-scheme: dark) {
    :root {
        --surface-color: #1e293b;
        --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 {
        animation: none;
    }
}

