/**
 * ============================================
 * LAYOUT PUBLIC
 * ============================================
 * Styles pour les pages publiques (login, register, etc.)
 * ============================================
 */

/* Body des pages auth */
body.auth-page {
    background: var(--gradient-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

/* Particules d'arrière-plan */
body.auth-page::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    animation: float 6s ease-in-out infinite;
}

body.auth-page::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    bottom: -150px;
    left: -150px;
    animation: float 8s ease-in-out infinite;
}

/* Container principal auth */
.auth-container {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 3rem 2.5rem;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease-out;
}

/* Header auth */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header h1 {
    font-size: var(--text-4xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
}

.auth-header p {
    color: #000000;
    font-size: var(--text-base);
    font-weight: 600;
}

/* Formulaire auth */
.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form .form-control {
    padding: 0.875rem 1rem;
    font-size: var(--text-base);
}

.auth-form .form-label {
    color: #000000;
    font-weight: 600;
}

/* Remember me + Forgot password */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.remember-me input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

.remember-me label {
    color: #000000;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    margin: 0;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 600;
    transition: color var(--transition-base);
}

.forgot-password:hover {
    color: var(--primary-dark);
}

/* Terms checkbox */
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: 1.5rem;
}

.terms-checkbox input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.terms-checkbox label {
    color: #000000;
    font-size: var(--text-sm);
    cursor: pointer;
    line-height: 1.5;
    margin: 0;
    font-weight: 500;
}

.terms-checkbox label a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.terms-checkbox label a:hover {
    text-decoration: underline;
}

/* Bouton auth */
.btn-auth {
    width: 100%;
    padding: 0.875rem;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-auth:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-auth:active:not(:disabled) {
    transform: translateY(0);
}

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-auth .spinner {
    display: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

.btn-auth.loading .spinner {
    display: block;
}

.btn-auth.loading .btn-text {
    display: none;
}

/* Lien alternatif (inscription/connexion) */
.alt-link {
    text-align: center;
    margin-top: 1.5rem;
    color: #000000;
    font-size: var(--text-sm);
    font-weight: 600;
}

.alt-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-base);
}

.alt-link a:hover {
    color: var(--primary-dark);
}

/* Grille pour prénom/nom */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

/* Password strength indicator */
.password-strength {
    margin-top: var(--spacing-sm);
    height: 4px;
    border-radius: var(--radius-sm);
    background: var(--gray-200);
    overflow: hidden;
    display: none;
}

.password-strength.show {
    display: block;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all var(--transition-base);
}

.password-strength.weak .password-strength-bar {
    width: 33%;
    background: var(--error);
}

.password-strength.medium .password-strength-bar {
    width: 66%;
    background: var(--warning);
}

.password-strength.strong .password-strength-bar {
    width: 100%;
    background: var(--success);
}

.password-strength-text {
    font-size: var(--text-xs);
    margin-top: var(--spacing-xs);
    display: none;
    font-weight: 500;
}

.password-strength-text.show {
    display: block;
}

.password-strength.weak .password-strength-text {
    color: var(--error);
}

.password-strength.medium .password-strength-text {
    color: var(--warning);
}

.password-strength.strong .password-strength-text {
    color: var(--success);
}

/* Responsive */
@media (max-width: 640px) {
    .auth-container {
        padding: 2.5rem 2rem;
    }
    
    .auth-header h1 {
        font-size: var(--text-3xl);
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
}