/* =========================================================================
   LAMTEC Pharma - Ecrans d'authentification
   Layout split-screen premium avec animations.
   ========================================================================= */

.auth-layout {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
}

@media (min-width: 960px) {
    .auth-layout {
        grid-template-columns: 1.05fr 1fr;
    }
}

/* -------------------- BRAND SIDE (gauche) -------------------------------- */

.auth-brand {
    display: none;
    position: relative;
    background: linear-gradient(135deg,
        var(--color-primary-700) 0%,
        var(--color-primary-600) 45%,
        #0d9488 100%);
    color: var(--color-gray-0);
    padding: var(--space-16);
    overflow: hidden;
    isolation: isolate;
}

@media (min-width: 960px) {
    .auth-brand { display: flex; flex-direction: column; }
}

/* Formes animees en fond */
.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    z-index: -1;
}
.auth-brand::before {
    width: 500px;
    height: 500px;
    background: #34d399;
    top: -100px;
    right: -100px;
    animation: auth-float 20s ease-in-out infinite;
}
.auth-brand::after {
    width: 400px;
    height: 400px;
    background: #6ee7b7;
    bottom: -100px;
    left: -100px;
    animation: auth-float 25s ease-in-out infinite reverse;
}
@keyframes auth-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(30px, -30px) scale(1.05); }
}

.auth-brand__logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: var(--font-weight-bold);
    font-size: var(--text-xl);
    letter-spacing: -0.02em;
    color: inherit;
    text-decoration: none;
}
.auth-brand__logo-mark {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.auth-brand__logo-mark svg {
    color: var(--color-gray-0);
}

.auth-brand__content {
    margin-top: auto;
    max-width: 32rem;
}
.auth-brand__eyebrow {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: var(--space-4);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.auth-brand__title {
    font-size: clamp(2rem, 3.5vw, 3rem);
    line-height: 1.1;
    margin-bottom: var(--space-4);
    color: var(--color-gray-0);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
}
.auth-brand__lede {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-8);
}
.auth-brand__features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.auth-brand__feature {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: rgba(255, 255, 255, 0.92);
    font-size: var(--text-sm);
}
.auth-brand__feature svg {
    color: var(--color-primary-200);
    flex-shrink: 0;
}

.auth-brand__footer {
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.6);
}

/* -------------------- FORM SIDE (droite) -------------------------------- */

.auth-panel {
    display: flex;
    flex-direction: column;
    padding: var(--space-8) var(--space-6);
    position: relative;
    min-height: 100dvh;
}
@media (min-width: 640px) {
    .auth-panel { padding: var(--space-12) var(--space-10); }
}
@media (min-width: 960px) {
    .auth-panel { justify-content: center; }
}

.auth-panel__topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
}
.auth-panel__topbar-start {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}
.auth-panel__back {
    display: none;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
}
.auth-panel__back:hover { color: var(--text-primary); }
.auth-panel__logo-mobile {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    text-decoration: none;
}
.auth-panel__logo-mobile-mark {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-700));
    display: grid;
    place-items: center;
    color: var(--color-gray-0);
}
/* Une seule facon de "retourner au site" visible a la fois : le logo cliquable
   sur mobile (le panneau de marque est masque), le lien texte sur desktop
   (le logo du panneau de marque, a gauche, sert deja de retour). */
@media (min-width: 960px) {
    .auth-panel__logo-mobile { display: none; }
    .auth-panel__back { display: flex; }
}

.auth-form {
    width: 100%;
    max-width: 26rem;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form__header {
    margin-bottom: var(--space-8);
}
.auth-form__title {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-2);
}
.auth-form__subtitle {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}
.auth-form__footer {
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.auth-form__forgot {
    font-size: var(--text-xs);
    color: var(--color-primary-600);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
}
.auth-form__forgot:hover { text-decoration: underline; }

.auth-form__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: var(--space-2) 0 var(--space-6);
}

/* -------------------- TOGGLE THEME (top-right) -------------------------- */

.theme-toggle {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}
.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.theme-toggle svg { transition: transform var(--transition); }
.theme-toggle:hover svg { transform: rotate(15deg); }
.theme-toggle__moon { display: none; }
.theme-toggle__sun  { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: block; }
[data-theme="dark"] .theme-toggle__sun  { display: none; }

/* -------------------- ANIMATION D'ENTREE -------------------------------- */

.auth-form {
    animation: auth-slide-up 500ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes auth-slide-up {
    from { opacity: 0; transform: translateY(1rem); }
    to   { opacity: 1; transform: translateY(0); }
}
