/* ========================================
   LAYE — login.css
   Design original conservé + header/footer
   ======================================== */

/* ----------------------------------------
   Layout page
   ---------------------------------------- */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Le main prend l'espace restant et centre la card */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(72px + 2.5rem) 1rem 2.5rem;
    position: relative;
    z-index: 1;
}

/* Footer au-dessus du bg fixe */
.footer {
    position: relative;
    z-index: 1;
}

/* ----------------------------------------
   Header — transparent sur fond sombre
   ---------------------------------------- */
.header {
    /* On écrase le fond blanc du header partagé */
    background: transparent !important;
}

.header .header-blur {
    background: rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom-color: rgba(255, 255, 255, 0.07) !important;
    box-shadow: none !important;
}

/* Logo blanc */
.header .logo-img {
    filter: brightness(0) invert(1) !important;
}

/* Liens nav blancs */
.header .nav-link {
    color: rgba(255, 255, 255, 0.72) !important;
}
.header .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.header .nav-link-auth {
    color: rgba(255, 255, 255, 0.8) !important;
}
.header .nav-link-auth:hover {
    color: #fff !important;
}

/* Search trigger */
.header .search-trigger {
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.65) !important;
    border-color: transparent !important;
}
.header .search-trigger:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
}
.header .search-trigger kbd {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.45) !important;
}

/* Hamburger mobile */
.header .mobile-toggle span {
    background: #fff !important;
}

/* Bouton S'inscrire — rester orange */
.header .btn-primary {
    background: var(--primary) !important;
    color: #fff !important;
}

/* ---- Header après scroll : redevient blanc ---- */
.header.scrolled .header-blur {
    background: rgba(255, 255, 255, 0.97) !important;
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.07) !important;
}
.header.scrolled .logo-img {
    filter: none !important;
}
.header.scrolled .nav-link {
    color: var(--gray-600) !important;
}
.header.scrolled .nav-link:hover {
    color: var(--dark) !important;
    background: var(--gray-100) !important;
}
.header.scrolled .nav-link-auth {
    color: var(--gray-700) !important;
}
.header.scrolled .nav-link-auth:hover {
    color: var(--primary) !important;
}
.header.scrolled .search-trigger {
    background: var(--gray-100) !important;
    color: var(--gray-500) !important;
}
.header.scrolled .search-trigger:hover {
    background: var(--gray-200) !important;
    color: var(--gray-700) !important;
}
.header.scrolled .search-trigger kbd {
    background: #fff !important;
    border-color: var(--gray-200) !important;
    color: var(--gray-400) !important;
}
.header.scrolled .mobile-toggle span {
    background: var(--dark) !important;
}

/* ----------------------------------------
   Background plein écran (original)
   ---------------------------------------- */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.bg-image {
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1470229722913-7c0e2dbbafd3?w=1920&q=80') center / cover no-repeat;
    transform: scale(1.05);
    animation: bgZoom 25s ease-in-out infinite alternate;
}

@keyframes bgZoom {
    0%   { transform: scale(1.05); }
    100% { transform: scale(1.12); }
}

.bg-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(var(--primary-rgb), 0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 0, 0, 0.3) 0%, transparent 60%),
        linear-gradient(160deg,
            rgba(0, 0, 0, 0.7)                  0%,
            rgba(0, 0, 0, 0.55)                 50%,
            rgba(var(--primary-rgb), 0.35)      100%);
}

.bg-grain {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
}

.bg-particles { position: absolute; inset: 0; pointer-events: none; }

.particle {
    position: absolute;
    width: 4px; height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: float linear infinite;
}
.particle:nth-child(1) { left:10%; top:20%; animation-duration:18s; animation-delay:0s;  width:3px;height:3px; }
.particle:nth-child(2) { left:25%; top:60%; animation-duration:22s; animation-delay:-3s; width:5px;height:5px; }
.particle:nth-child(3) { left:50%; top:30%; animation-duration:16s; animation-delay:-7s; }
.particle:nth-child(4) { left:70%; top:70%; animation-duration:20s; animation-delay:-5s; width:6px;height:6px; }
.particle:nth-child(5) { left:85%; top:15%; animation-duration:24s; animation-delay:-2s; width:3px;height:3px; }
.particle:nth-child(6) { left:40%; top:85%; animation-duration:19s; animation-delay:-8s; }

@keyframes float {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(40px); opacity: 0; }
}

/* ----------------------------------------
   Auth wrapper (original)
   ---------------------------------------- */
.auth-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.auth-logo img {
    height: 48px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: transform 200ms ease;
}
.auth-logo a:hover img { transform: scale(1.05); }

/* ----------------------------------------
   Card glassmorphism (original)
   ---------------------------------------- */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-2xl);
    padding: 2.5rem 2rem;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.auth-card-header { text-align: center; margin-bottom: 1rem; }

.auth-card-icon {
    width: 56px; height: 56px;
    margin: 0 auto 1rem;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-xl);
    color: var(--white);
    font-size: 1.25rem;
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3);
}

.auth-card-header h1 {
    font-size: 1.5rem; font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.375rem; color: var(--dark);
}
.auth-card-header p { font-size: 0.9375rem; color: var(--gray-500); }

/* ----------------------------------------
   Error message (original)
   ---------------------------------------- */
.error-message {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--error);
    margin-bottom: 1.5rem;
    animation: shake 0.4s ease;
}
.error-message.visible { display: flex; }

@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-6px); }
    40%     { transform: translateX(6px); }
    60%     { transform: translateX(-4px); }
    80%     { transform: translateX(4px); }
}

/* ----------------------------------------
   Form (original)
   ---------------------------------------- */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block; font-size: 0.875rem;
    font-weight: 500; color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.input-wrapper { position: relative; }

.input-wrapper i.input-icon {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); font-size: 0.9375rem;
    pointer-events: none; transition: color 150ms ease;
}
.input-wrapper:focus-within i.input-icon { color: var(--primary); }

.input-wrapper input {
    width: 100%;
    padding: 0.8125rem 1rem 0.8125rem 2.75rem;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem; font-family: var(--font);
    color: var(--dark); transition: all 150ms ease;
}
.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}
.input-wrapper input::placeholder { color: var(--gray-400); }
.input-wrapper input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.password-toggle {
    position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none;
    color: var(--gray-400); cursor: pointer;
    border-radius: var(--radius-md); transition: all 150ms ease;
}
.password-toggle:hover { color: var(--gray-600); background: var(--gray-100); }

.form-options {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.checkbox-label {
    display: flex; align-items: center;
    gap: 0.5rem; cursor: pointer;
    font-size: 0.875rem; color: var(--gray-600);
}
.checkbox-label input { display: none; }

.custom-checkbox {
    width: 18px; height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 150ms ease;
}
.checkbox-label input:checked + .custom-checkbox {
    background: var(--primary); border-color: var(--primary);
}
.checkbox-label input:checked + .custom-checkbox::after {
    content: '';
    width: 5px; height: 9px;
    border: 2px solid var(--white);
    border-top: none; border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.forgot-link { font-size: 0.875rem; font-weight: 500; color: var(--primary); transition: color 150ms ease; }
.forgot-link:hover { color: var(--primary-dark); }

/* ----------------------------------------
   Submit button (original)
   ---------------------------------------- */
.btn-submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    font-size: 1rem; font-weight: 600; font-family: var(--font);
    border: none; border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    transition: all 150ms ease;
    position: relative; overflow: hidden;
}
.btn-submit::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.15));
    opacity: 0; transition: opacity 150ms ease;
}
.btn-submit:hover::before { opacity: 1; }
.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.35); }
.btn-submit:active { transform: translateY(0); }

.btn-submit .spinner {
    display: none; width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%; animation: spin 0.6s linear infinite;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------
   Footer sous la card (original)
   ---------------------------------------- */
.auth-footer { text-align: center; margin-top: 1.5rem; }

.auth-footer p { font-size: 0.9375rem; color: rgba(255, 255, 255, 0.7); }
.auth-footer p a {
    font-weight: 600; color: var(--white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 1px; transition: all 150ms ease;
}
.auth-footer p a:hover { color: var(--primary-light); border-bottom-color: var(--primary-light); }

.back-home {
    display: flex; align-items: center; justify-content: center;
    gap: 0.5rem; margin-top: 1.25rem;
    font-size: 0.875rem; color: rgba(255, 255, 255, 0.45);
    transition: color 150ms ease;
}
.back-home:hover { color: rgba(255, 255, 255, 0.8); }

/* ----------------------------------------
   Responsive
   ---------------------------------------- */
@media (max-width: 480px) {
    .auth-main { padding-top: calc(72px + 1.25rem); padding-bottom: 1.5rem; }
    .auth-card { padding: 2rem 1.5rem; border-radius: var(--radius-xl); }
    .auth-card-header h1 { font-size: 1.375rem; }
    .form-options { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
    .bg-image { animation: none; }
    .particle { animation: none; display: none; }
    .auth-wrapper { animation: none; opacity: 1; }
}
