/* ============================================
   PAGE INSCRIPTION - TESTCIVIQUE
   Styles pour la page d'inscription compacte
   ============================================ */

:root {
    --cyan: #00D4FF;
    --cyan-glow: rgba(0, 212, 255, 0.3);
    --text-dark: #111827;
    --text-grey: #6B7280;
    --bg-body: #F9FAFB;
    --border: #E5E7EB;
    --shadow: 0 20px 50px -10px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top center, #F0FDFF 0%, #FFFFFF 60%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: var(--text-dark);
    /* Important pour mobile : évite le rebond élastique */
    overscroll-behavior: none;
}

/* --- CARTE COMPACTE --- */
.compact-card {
    background: white;
    width: 100%;
    max-width: 450px;
    padding: 30px 24px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    animation: popIn 0.5s ease-out;
}

/* --- BOUTON FERMER (REMARQUABLE) --- */
.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: #F3F4F6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 1.1rem;
    transition: 0.3s;
    z-index: 20;
}

.close-btn:hover {
    background: var(--cyan);
    color: white;
    transform: rotate(90deg);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 5px;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 8px;
}

.logo-text {
    display: flex;
    align-items: baseline;
    gap: 4px;
    line-height: 1;
}

.logo-text .mon {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.logo-text .testcivique {
    font-family: 'Anton';
    font-size: 1.6rem;
    color: var(--text-dark);
    display: flex;
    gap: 2px;
}

.logo-text .highlight {
    color: var(--cyan);
    position: relative;
}

.logo-text .highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), transparent);
    border-radius: 2px;
}

h1 {
    font-family: 'Inter';
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-grey);
}

/* Social Icons */
.social-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: 0.2s;
}

.social-btn:hover {
    background: #F9FAFB;
    border-color: var(--text-dark);
}

.social-btn img {
    width: 18px;
    height: 18px;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 0 20px 20px 20px;
    position: relative;
}

.divider::after {
    content: 'OU';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 0 10px;
    font-size: 0.7rem;
    color: var(--text-grey);
    font-weight: 700;
}

/* --- GRILLE FORMULAIRE --- */
.grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.full-span {
    grid-column: span 2;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-box {
    position: relative;
}

.clean-input {
    width: 100%;
    padding: 12px 14px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: 'Inter';
    font-size: 0.95rem;
    color: var(--text-dark);
    background: #FAFAFA;
    transition: 0.2s;
    outline: none;
}

/* Ajuster le padding pour les champs avec bouton toggle */
.input-box:has(.toggle-password) .clean-input {
    padding-right: 36px;
}

.clean-input:focus {
    background: white;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.clean-input::placeholder {
    color: #9CA3AF;
    font-size: 0.9rem;
}

/* État d'erreur pour les inputs */
.clean-input.error {
    border-color: #EF4444;
    background: #FEF2F2;
}

.clean-input.error:focus {
    border-color: #EF4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Messages d'erreur par champ */
.field-error {
    display: none;
    font-size: 0.8rem;
    color: #DC2626;
    padding-left: 4px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Message d'erreur général */
.general-error {
    background: #FEF2F2;
    border-left: 3px solid #EF4444;
    color: #991B1B;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
}

/* Bannière de succès */
.success-banner {
    display: none;
    align-items: flex-start;
    gap: 12px;
    background: #ECFDF5;
    border-left: 3px solid #10B981;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.success-banner svg {
    width: 24px;
    height: 24px;
    stroke: #10B981;
    flex-shrink: 0;
    margin-top: 2px;
}

.success-banner strong {
    color: #065F46;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 4px;
}

.success-banner p {
    color: #047857;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

/* --- OEIL MOT DE PASSE --- */
.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #9CA3AF;
    display: flex;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

/* Actions */
.actions {
    margin-top: 20px;
}

.check-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-grey);
    margin-bottom: 16px;
    line-height: 1.4;
}

.check-line input {
    accent-color: var(--cyan);
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.check-line a {
    color: var(--text-dark);
    text-decoration: underline;
    font-weight: 600;
}

.btn-submit {
    width: 100%;
    height: 48px;
    background: var(--text-dark);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-submit:hover {
    background: var(--cyan);
    color: var(--text-dark);
    transform: translateY(-2px);
}

.login-link {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 16px;
    color: var(--text-grey);
}

.login-link a {
    color: var(--cyan);
    font-weight: 700;
    text-decoration: none;
}

@keyframes popIn {
    0%{
        opacity:0;
        transform:scale(0.95);
    }
    100%{
        opacity:1;
        transform:scale(1);
    }
}

/* OPTIMISATION MOBILE CRITIQUE */
@media(max-width: 400px) {
    .compact-card {
        padding: 24px 16px;
    }

    /* On garde Nom/Prénom côte à côte même sur petit écran ! */
    .clean-input {
        font-size: 0.9rem;
        padding: 10px;
    }

    .input-box:has(.toggle-password) .clean-input {
        padding-right: 36px;
    }
}
