
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html, body {
    width: 100%;
    overflow-x: hidden; /* empêche tout débordement horizontal, y compris via html */
}

body {
    min-height: 100vh;
    background-color: #f0f7ff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: "";
    position: fixed; /* fixed au lieu de absolute : ne participe plus au flux/scroll */
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('../uploads/images/fond1.png');
    background-size: cover;
    background-position: center;
    opacity: 0.85;
    z-index: -2;
}

body::after {
    content: "";
    position: fixed; /* fixed empêche ce calque de créer un débordement scrollable */
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    overflow: hidden;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.04) 0%, rgba(255, 255, 255, 0) 70%);
    animation: waveMotion 25s infinite linear;
    z-index: -1;
    pointer-events: none;
}

@keyframes waveMotion {
    0% { transform: rotate(0deg) scale(1.5) translate(0, 0); }
    50% { transform: rotate(180deg) scale(1.5) translate(-1%, 1%); }
    100% { transform: rotate(360deg) scale(1.5) translate(0, 0); }
}

/* --- Dropdown de Langue --- */
.lang-dropdown {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
}

.lang-trigger {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(14, 165, 233, 0.15);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-trigger:hover, .lang-trigger.active {
    background: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.08);
}

.lang-trigger.active .arrow {
    transform: rotate(180deg);
}

.lang-icon { font-size: 12px; }

.arrow {
    font-size: 8px;
    color: #94a3b8;
    transition: transform 0.3s;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(14, 165, 233, 0.12);
    border-radius: 10px;
    padding: 4px;
    min-width: 80px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.lang-menu a {
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    padding: 5px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.lang-menu a:hover {
    background: rgba(14, 165, 233, 0.08);
    color: #0284c7;
}

.lang-menu a.active {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
    font-weight: 600;
}

.flag { font-size: 12px; }

/* --- Container Formulaire --- */
.register-container {
    background: rgba(240, 249, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    width: 100%;
    max-width: 410px;
    padding: 22px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.05);
    margin: 0 auto;
}

.brand-header {
    text-align: center;
    margin-bottom: 18px;
}

.logo {
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #0284c7;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    letter-spacing: 2px;
}

.logo-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.logo-text span {
    display: inline-block;
    position: relative;
    color: #0284c7;
    text-shadow:
        0.5px 0.5px 0px #38bdf8,
        1.5px 1.5px 2px rgba(245, 158, 11, 0.4);
}

.subtitle {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 3px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 9px 11px; /* légèrement plus haut pour un meilleur tap-target mobile */
    border: 1px solid rgba(2, 132, 199, 0.15);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    font-size: 14px; /* évite le zoom auto iOS (< 16px zoome, mais on reste lisible ; passe à 16px si besoin) */
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%2364748b'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 28px;
}

.form-group input:focus, .form-group select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
    background-color: #ffffff;
}

.readonly-group input {
    background: rgba(241, 245, 249, 0.8);
    color: #94a3b8;
    cursor: not-allowed;
    border-color: rgba(226, 232, 240, 0.8);
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0;
}

.form-checkbox input {
    margin-top: 2px;
    cursor: pointer;
    accent-color: #0284c7;
    flex-shrink: 0;
}

.form-checkbox label {
    font-size: 10.5px;
    color: #475569;
    line-height: 1.4;
    cursor: pointer;
}

.input-error {
    border-color: #ef4444 !important;
    background-color: #fff1f2 !important;
}

.error-message {
    color: #ef4444;
    font-size: 10px;
    margin-top: 2px;
    display: block;
}

.btn-submit {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
    transition: background 0.3s ease, opacity 0.3s ease;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #0369a1, #075985);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.gold-spinner {
    display: none;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-link {
    text-align: center;
    margin-top: 12px;
    font-size: 11.5px;
}

.login-link a {
    color: #0284c7;
    text-decoration: none;
    font-weight: 600;
}

/* --- Notification --- */
.notification {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translate(-50%, -20px);
    width: calc(100% - 32px);
    max-width: 380px;
    padding: 13px 18px;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    z-index: 1000;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    text-align: center;
}

.notification.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.notification.success { background-color: #10b981; }
.notification.error { background-color: #ef4444; }

/* --- Responsive --- */
@media (max-width: 480px) {
    body { padding: 12px; }
    .register-container { padding: 20px 16px; border-radius: 16px; }
    .logo { font-size: 14px; gap: 8px; }
}

@media (max-width: 360px) {
    .form-group input, .form-group select { font-size: 13px; padding: 8px 10px; }
    .btn-submit { font-size: 12.5px; }
}
