/**
 * auth-style.css - Styles pour les pages d'authentification
 * Utilisé par login.html et register.html
 */

/* ==================== PAGE AUTH ==================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a2e 50%, #16213e 100%);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 2rem 0;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    position: relative;
    z-index: 2;
}

/* ==================== AUTH CARD ==================== */

.auth-card {
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(66, 133, 244, 0.2);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

/* ==================== HEADER ==================== */

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo h1 {
    font-size: 2rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #4285f4, #34a853);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary, #e0e0e0);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary, #a0a0a0);
    font-size: 0.95rem;
}

/* ==================== MESSAGES ==================== */

.auth-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-message.hidden {
    display: none;
}

.auth-message.error {
    background: rgba(234, 67, 53, 0.15);
    border: 1px solid rgba(234, 67, 53, 0.3);
    color: #f28b82;
}

.auth-message.success {
    background: rgba(52, 168, 83, 0.15);
    border: 1px solid rgba(52, 168, 83, 0.3);
    color: #81c995;
}

.auth-message.warning {
    background: rgba(251, 188, 4, 0.15);
    border: 1px solid rgba(251, 188, 4, 0.3);
    color: #fdd663;
}

/* ==================== FORMULAIRE ==================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary, #e0e0e0);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary, #e0e0e0);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4285f4;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.form-group input.error {
    border-color: #ea4335;
}

.form-group input.error:focus {
    box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.1);
}

.error-message {
    font-size: 0.85rem;
    color: #f28b82;
    min-height: 1.2em;
}

/* ==================== PASSWORD INPUT ==================== */

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary, #a0a0a0);
    transition: color 0.2s ease;
    font-size: 1.2rem;
}

.password-toggle:hover {
    color: var(--text-primary, #e0e0e0);
}

/* ==================== PASSWORD STRENGTH ==================== */

.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.strength-fill.very-weak {
    background: #ea4335;
}

.strength-fill.weak {
    background: #fbbc04;
}

.strength-fill.medium {
    background: #ff9800;
}

.strength-fill.strong {
    background: #34a853;
}

.strength-fill.very-strong {
    background: #0f9d58;
}

.strength-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.strength-text.very-weak {
    color: #f28b82;
}

.strength-text.weak {
    color: #fdd663;
}

.strength-text.medium {
    color: #ffb74d;
}

.strength-text.strong {
    color: #81c995;
}

.strength-text.very-strong {
    color: #57bb8a;
}

/* ==================== OPTIONS FORMULAIRE ==================== */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary, #a0a0a0);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* ==================== BOUTONS ==================== */

.btn-primary {
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

.btn-loader {
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

/* ==================== DIVIDER ==================== */

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-secondary, #a0a0a0);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    padding: 0 12px;
}

/* ==================== SOCIAL AUTH ==================== */

.social-auth {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-social {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary, #e0e0e0);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-social:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-social:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-social.btn-discord {
    background: linear-gradient(135deg, #5865f2, #7289da);
    color: white;
    border-color: #5865f2;
}

.btn-social.btn-discord:hover:not(:disabled) {
    background: linear-gradient(135deg, #4752c4, #5865f2);
    border-color: #4752c4;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

/* ==================== FOOTER ==================== */

.auth-footer {
    margin-top: 24px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-footer p {
    font-size: 0.9rem;
    color: var(--text-secondary, #a0a0a0);
}

/* ==================== LIENS ==================== */

.link-primary {
    color: #4285f4;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.link-primary:hover {
    color: #5a95f5;
    text-decoration: underline;
}

.link-secondary {
    color: var(--text-secondary, #a0a0a0);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.link-secondary:hover {
    color: var(--text-primary, #e0e0e0);
    text-decoration: underline;
}

/* ==================== BACKGROUND ANIMÉ ==================== */

.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

.star:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.star:nth-child(2) {
    top: 40%;
    left: 70%;
    animation-delay: 0.5s;
}

.star:nth-child(3) {
    top: 60%;
    left: 30%;
    animation-delay: 1s;
}

.star:nth-child(4) {
    top: 80%;
    left: 80%;
    animation-delay: 1.5s;
}

.star:nth-child(5) {
    top: 30%;
    left: 50%;
    animation-delay: 2s;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 600px) {
    .auth-card {
        padding: 24px;
    }

    .auth-header .logo h1 {
        font-size: 1.75rem;
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 400px) {
    .auth-container {
        padding: 12px;
    }

    .auth-card {
        padding: 20px;
    }
}
