/**
 * Page de connexion - Tribunal d'Instance Hors Classe de Dakar
 * Design institutionnel professionnel
 */

:root {
    --primary-color: #1e3a8a;
    --primary-dark: #0f172a;
    --accent-gold: #d97706;
    --secondary-color: #059669;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Background pattern for institutional look */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(45deg, rgba(217, 119, 6, 0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(217, 119, 6, 0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(217, 119, 6, 0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(217, 119, 6, 0.03) 75%);
    background-size: 60px 60px;
    background-position: 0 0, 0 30px, 30px -30px, -30px 0px;
    opacity: 0.3;
}

/* Republic of Senegal colors accent */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #059669 0%, #059669 33%, #d97706 33%, #d97706 66%, #dc2626 66%, #dc2626 100%);
    z-index: 1000;
}

.container {
    position: relative;
    z-index: 10;
}

/* Card principal */
.card {
    border: none;
    border-radius: 1.25rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Bordure dorée institutionnelle */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(to right, var(--accent-gold), #f59e0b, var(--accent-gold));
    box-shadow: 0 2px 10px rgba(217, 119, 6, 0.5);
}

.card-body {
    padding: 3rem 2.5rem;
    position: relative;
}

/* Header avec emblème */
.text-center.mb-4 {
    position: relative;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem !important;
}

.text-center.mb-4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--accent-gold), transparent);
}

/* Logo du tribunal */
.text-center.mb-4 img {
    filter: drop-shadow(0 4px 12px rgba(30, 58, 138, 0.4));
    animation: float 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

.text-center.mb-4 img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 8px 16px rgba(30, 58, 138, 0.5));
}

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

/* Icône du bâtiment (fallback si image non disponible) */
.bi-building {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 8px rgba(30, 58, 138, 0.3));
    animation: float 3s ease-in-out infinite;
}

/* Titre principal */
.card-body h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--primary-dark);
    margin-top: 1.5rem;
    letter-spacing: 0.5px;
}

/* Sous-titre */
.card-body .text-muted {
    color: #64748b !important;
    font-weight: 500;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Labels des formulaires */
.form-label {
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label i {
    color: var(--accent-gold);
    font-size: 1.1rem;
}

/* Champs de formulaire */
.form-control {
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow:
        0 0 0 4px rgba(30, 58, 138, 0.1),
        0 4px 12px rgba(30, 58, 138, 0.15);
    background-color: white;
    outline: none;
}

.form-control:hover:not(:focus) {
    border-color: #cbd5e1;
    background-color: white;
}

/* Bouton de connexion */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 0.75rem;
    padding: 1rem;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 12px rgba(30, 58, 138, 0.3),
        0 0 0 0 rgba(30, 58, 138, 0.5);
    position: relative;
    overflow: hidden;
}

.btn-primary::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 ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-3px);
    box-shadow:
        0 8px 20px rgba(30, 58, 138, 0.4),
        0 0 0 4px rgba(30, 58, 138, 0.1);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn-primary i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
    vertical-align: middle;
}

/* Message d'alerte */
.alert {
    border: none;
    border-left: 4px solid #dc2626;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    background-color: rgba(220, 38, 38, 0.1);
    color: #991b1b;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
    animation: shake 0.5s ease-in-out;
}

.alert i {
    margin-right: 0.75rem;
    font-size: 1.25rem;
    vertical-align: middle;
}

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

/* Pied de page */
.text-center.mt-4 {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

.text-center.mt-4 small {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    backdrop-filter: blur(10px);
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.card {
    animation: fadeInUp 0.8s ease-out;
}

/* Animation du titre */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.card-body h3 {
    animation: fadeIn 1s ease-out 0.3s both;
}

.card-body .text-muted {
    animation: fadeIn 1s ease-out 0.5s both;
}

/* Responsive */
@media (max-width: 576px) {
    .card-body {
        padding: 2rem 1.5rem;
    }

    .card-body h3 {
        font-size: 1.5rem;
    }

    .bi-building {
        font-size: 3rem !important;
    }
}

/* Focus visible pour accessibilité */
.form-control:focus-visible,
.btn-primary:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
}

/* Amélioration du contraste pour l'accessibilité */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 3px;
    }

    .btn-primary {
        border: 2px solid white;
    }
}

/* Support du mode sombre (si demandé plus tard) */
@media (prefers-color-scheme: dark) {
    .card {
        background: rgba(30, 41, 59, 0.95);
        color: #f1f5f9;
    }

    .card-body h3 {
        color: white;
    }

    .form-control {
        background-color: rgba(15, 23, 42, 0.5);
        color: white;
        border-color: #475569;
    }

    .form-label {
        color: #e2e8f0;
    }
}
