/* ========================================
   LAYE — register.css
   Design original conservé + header/footer
   ======================================== */

/* ----------------------------------------
   Layout page
   ---------------------------------------- */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.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 {
    position: relative;
    z-index: 1;
}

/* ----------------------------------------
   Header — transparent sur fond sombre
   ---------------------------------------- */
.header {
    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;
}

.header .logo-img {
    filter: brightness(0) invert(1) !important;
}

.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;
}

.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;
}

.header .mobile-toggle span {
    background: #fff !important;
}

.header .btn-primary {
    background: var(--primary) !important;
    color: #fff !important;
}

/* ---- 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-1533174072545-7a4b6ad7a6c3?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.72) 0%,
            rgba(0, 0, 0, 0.55) 50%,
            rgba(var(--primary-rgb), 0.3) 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 {
    width: 90%;
    margin: 90px auto 2rem;
    max-width: 700px;
    /* position: relative; z-index: 10;
    width: 100%;
    max-width: 520px; */
    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);
}

/* ----------------------------------------
   Messages (original)
   ---------------------------------------- */
.error-message,
.success-message {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    animation: shake 0.4s ease;
}

.error-message {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.success-message {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--success);
    animation: none;
}

.error-message.visible,
.success-message.visible {
    display: flex;
    flex-direction: column;
    text-align: center;
}

@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: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-group label .required {
    color: var(--primary);
    margin-left: 2px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.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,
.input-wrapper select {
    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;
    appearance: none;
    -webkit-appearance: none;
}

.input-wrapper select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a1a1aa' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.input-wrapper input:focus,
.input-wrapper select: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,
.input-wrapper select.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);
}

/* Password strength (original) */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 0.5rem;
}

.strength-bar {
    flex: 1;
    height: 3px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    transition: all 200ms ease;
}

.strength-bar.weak {
    background: var(--error);
}

.strength-bar.medium {
    background: #f59e0b;
}

.strength-bar.strong {
    background: var(--success);
}

.strength-text {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

/* ----------------------------------------
   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: var(--gray-400);
}

.auth-footer p a {
    color: var(--gray-400);
    font-weight: 600;
    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: var(--primary-light);
    transition: color 150ms ease;
}

.back-home:hover {
    color: var(--primary-dark);
}

/* ----------------------------------------
   Responsive
   ---------------------------------------- */
@media (max-width: 680px) {
    .auth-main {
        padding-top: calc(72px + 1.25rem);
        padding-bottom: 1.5rem;
    }

    .auth-card {
        padding: 2rem 1.25rem;
        border-radius: var(--radius-xl);
    }

    .auth-card-header h1 {
        font-size: 1.375rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bg-image {
        animation: none;
    }

    .particle {
        animation: none;
        display: none;
    }

    .auth-wrapper {
        animation: none;
        opacity: 1;
    }
}


/* Trust */
.auth-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-100);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.trust-item i {
    color: var(--success);
    font-size: 0.6875rem;
}


/* Terms */
.terms-check {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin: 1.25rem 0 1.5rem;
    cursor: pointer;
}

.terms-check 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;
    margin-top: 2px;
    transition: all var(--transition-fast);
}

.terms-check input:checked+.custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.terms-check 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);
}

.terms-text {
    font-size: 0.8125rem;
    color: var(--gray-500);
    line-height: 1.5;
}

.terms-text a {
    color: var(--primary);
    font-weight: 500;
}

.terms-text a:hover {
    color: var(--primary-dark);
}