/* =============================================================================
   TXL Auth — styles d'authentification
   Dépendance : txl-design-system/tokens.css
   ============================================================================= */

@layer components {
/* ---------------------------------------------------------------------------
   Hero Section avec gradient animé
   --------------------------------------------------------------------------- */
.auth-hero {
    position: relative;
    background: linear-gradient(
        135deg,
        #1877F2 0%,
        #FF00FF 25%,
        #00D4FF 50%,
        #FF00AA 75%,
        #1877F2 100%
    );
    min-height: 280px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-size: 400% 400%;
    animation: txl-auth-gradient-flow 8s ease infinite;
    margin-top: -70px;
    padding-top: 100px;
    padding-bottom: 3rem;
}

.auth-hero::before {
    content: '';
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    animation: txl-rotate-glow 20s linear infinite;
    pointer-events: none;
}

@keyframes txl-auth-gradient-flow {
    0%   { background-position: 0% 50%;   filter: hue-rotate(0deg); }
    33%  { background-position: 100% 50%; filter: hue-rotate(30deg); }
    66%  { background-position: 0% 100%;  filter: hue-rotate(-30deg); }
    100% { background-position: 0% 50%;   filter: hue-rotate(0deg); }
}

@keyframes txl-rotate-glow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.auth-hero-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
}

.auth-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.auth-hero p {
    font-size: 1.1rem;
    opacity: 0.95;
}

@media (max-width: 768px) {
    .auth-hero h1 { font-size: 1.8rem; }
}

/* ---------------------------------------------------------------------------
   Conteneur principal
   --------------------------------------------------------------------------- */
.auth-container {
    max-width: 1200px;
    margin: -80px auto 3rem;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
}

.auth-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .auth-options { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Cartes glassmorphism
   --------------------------------------------------------------------------- */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(24, 119, 242, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: txl-fade-in-up 0.6s ease-out both;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(24, 119, 242, 0.25);
}

.auth-options > div:nth-child(2) .auth-card,
.auth-options > div:nth-child(2) {
    animation-delay: 0.1s;
}

@keyframes txl-fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card { animation: none; }
    .auth-hero  { animation: none; }
    .auth-hero::before { animation: none; }
}

.auth-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--txl-text-primary, #111);
}

.auth-card h3 i {
    font-size: 1.8rem;
    color: var(--txl-color-primary, #1877F2);
}

@media (max-width: 576px) {
    .auth-card { padding: 1.5rem; }
}

/* Dark mode */
[data-theme="dark"] .auth-card,
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: rgba(30, 30, 40, 0.95);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        border-color: rgba(255,255,255,0.1);
    }
}

/* ---------------------------------------------------------------------------
   Formulaires
   --------------------------------------------------------------------------- */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--txl-text-primary, #111);
    font-size: 0.9rem;
}

.form-control {
    border-radius: 12px;
    border: 2px solid var(--txl-border-color, #e2e8f0);
    padding: 0.875rem 1.25rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    font-size: 0.95rem;
    background: white;
}

.form-control:focus {
    border-color: var(--txl-color-primary, #1877F2);
    box-shadow: 0 0 0 0.25rem rgba(24, 119, 242, 0.15);
    transform: translateY(-1px);
    outline: none;
}

.form-control::placeholder {
    color: var(--txl-text-muted, #6b7280);
    opacity: 0.6;
}

.form-text-small {
    font-size: 0.85rem;
    color: var(--txl-text-muted, #6b7280);
    margin-top: 0.5rem;
}

/* Checkbox moderne */
.form-check-input:checked {
    background-color: var(--txl-color-primary, #1877F2);
    border-color: var(--txl-color-primary, #1877F2);
}

.form-check-label {
    color: var(--txl-text-primary, #111);
    font-weight: 500;
}

/* ---------------------------------------------------------------------------
   Bouton principal auth
   --------------------------------------------------------------------------- */
.btn-auth {
    width: 100%;
    padding: 1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 1rem;
    background: var(--txl-gradient-hero, linear-gradient(135deg, #1877F2 0%, #764ba2 100%));
    border: none;
    color: white;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn-auth::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 -100%;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-auth:hover::before { left: 100%; }

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(24, 119, 242, 0.4);
    color: white;
}

.btn-auth:active { transform: translateY(0); }

/* ---------------------------------------------------------------------------
   Toggle mot de passe
   --------------------------------------------------------------------------- */
.password-toggle {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--txl-text-muted, #6b7280);
    transition: color 0.2s;
    font-size: 1.2rem;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--txl-color-primary, #1877F2);
}

/* ---------------------------------------------------------------------------
   Séparateur élégant
   --------------------------------------------------------------------------- */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.75rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 2px solid var(--txl-border-color, #e2e8f0);
}

.divider span {
    padding: 0 1.25rem;
    color: var(--txl-text-muted, #6b7280);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---------------------------------------------------------------------------
   Boutons sociaux
   --------------------------------------------------------------------------- */
.social-auth {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-social {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--txl-border-color, #e2e8f0);
    border-radius: 12px;
    background: white;
    color: var(--txl-text-primary, #111);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease,
                color 0.3s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-decoration: none;
}

.btn-social:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.btn-social i { font-size: 1.5rem; }

.btn-google:hover {
    border-color: #ea4335;
    color: #ea4335;
    background: linear-gradient(135deg, #fff5f5, white);
}

.btn-linkedin:hover {
    border-color: #0077b5;
    color: #0077b5;
    background: linear-gradient(135deg, #f0f8ff, white);
}

/* ---------------------------------------------------------------------------
   Champ code de vérification
   --------------------------------------------------------------------------- */
.verification-code-input {
    font-size: 2.2rem;
    text-align: center;
    letter-spacing: 1.2rem;
    padding: 1.5rem;
    font-weight: 700;
    color: var(--txl-color-primary, #1877F2);
    border: 3px solid var(--txl-color-primary, #1877F2) !important;
}

/* ---------------------------------------------------------------------------
   Lien "retour"
   --------------------------------------------------------------------------- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--txl-text-muted, #6b7280);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
    font-weight: 500;
}

.back-link:hover {
    color: var(--txl-color-primary, #1877F2);
    transform: translateX(-3px);
}

/* ---------------------------------------------------------------------------
   Renvoi de code
   --------------------------------------------------------------------------- */
.resend-code {
    text-align: center;
    margin-top: 1.25rem;
}

.resend-code button {
    background: none;
    border: none;
    color: var(--txl-color-primary, #1877F2);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.resend-code button:hover { opacity: 0.8; }

/* ---------------------------------------------------------------------------
   Notice de sécurité
   --------------------------------------------------------------------------- */
.security-notice {
    background: linear-gradient(
        135deg,
        rgba(24, 119, 242, 0.1),
        rgba(13, 93, 189, 0.05)
    );
    border-left: 4px solid var(--txl-color-primary, #1877F2);
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.security-notice i {
    color: var(--txl-color-primary, #1877F2);
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* ---------------------------------------------------------------------------
   Alertes inline
   --------------------------------------------------------------------------- */
.auth-card .alert {
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: none;
    padding: 1rem 1.25rem;
}

/* ---------------------------------------------------------------------------
   Liens généraux dans le contexte auth
   --------------------------------------------------------------------------- */
.auth-container a {
    color: var(--txl-color-primary, #1877F2);
    transition: opacity 0.2s;
}

.auth-container a:hover { opacity: 0.8; }

} /* end @layer components */
