/* Page auth unique - connexion / inscription (modèle auth) */
.auth-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    z-index: 2000;
    pointer-events: none;
}

.auth-header .auth-back,
.auth-header .theme-toggle {
    pointer-events: auto;
    position: relative;
    z-index: 2001;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

/* Bouton retour — visible sur fond clair et violet */
.auth-header .auth-back {
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #5b6fd8 0%, #6b4f9a 100%);
    border: none;
    box-shadow: 0 4px 14px rgba(91, 111, 216, 0.4);
}

.auth-header .auth-back:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(91, 111, 216, 0.45);
}

.auth-header .auth-back i {
    font-size: 0.8rem;
}

.auth-header .theme-toggle {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e2e8f0;
    color: #475569;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.auth-header .theme-toggle:hover {
    background: #fff;
    transform: translateY(-1px);
}

html[data-theme="dark"] .auth-header .auth-back {
    background: linear-gradient(135deg, #4f5fc4 0%, #5a3f82 100%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .auth-header .theme-toggle {
    background: rgba(30, 41, 59, 0.92);
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

.auth-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}
.auth-left {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.auth-brand {
    text-align: center;
    color: #fff;
}

.auth-brand--link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.auth-brand--link:hover {
    opacity: 0.92;
    transform: translateY(-2px);
    color: #fff;
}
.auth-brand i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}
.auth-brand h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.auth-brand p {
    opacity: 0.9;
    font-size: 1rem;
}

.auth-right {
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.06);
}

.auth-form-container {
    display: none;
    animation: fadeIn 0.3s ease;
}
.auth-form-container.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-form-container h1 {
    font-size: 1.75rem;
    color: #333;
    margin-bottom: 0.25rem;
}
.auth-subtitle {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.auth-input-group {
    position: relative;
    margin-bottom: 1rem;
}
.auth-input-group input,
.auth-input-group select {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-input-group input:focus,
.auth-input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.auth-input-group.focused input,
.auth-input-group.focused select {
    border-color: #667eea;
}
.auth-input-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    transition: color 0.2s;
}
.auth-input-group input:focus + i,
.auth-input-group select:focus + i,
.auth-input-group.focused i {
    color: #667eea;
}

.auth-input-row {
    display: flex;
    gap: 12px;
}
.auth-input-row .auth-input-group {
    flex: 1;
}

.auth-btn {
    width: 100%;
    padding: 0.85rem 1.25rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}
.auth-btn:hover {
    opacity: 0.96;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}
.auth-btn:active {
    transform: translateY(0);
}

.auth-toggle {
    text-align: center;
    margin-top: 0.5rem;
}
.auth-toggle p {
    color: #666;
    font-size: 0.95rem;
}
.auth-toggle a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}
.auth-toggle a:hover {
    text-decoration: underline;
}

.auth-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.auth-message.error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}
.auth-message.success {
    background: #efe;
    color: #363;
    border: 1px solid #cfc;
}

/* Mode sombre (aligné sur html[data-theme] comme le reste de l'app) */
html[data-theme="dark"] .auth-right {
    background: #1e1e2e;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .auth-form-container h1 {
    color: #e8eaf0;
}

html[data-theme="dark"] .auth-subtitle {
    color: #a0a8b8;
}

html[data-theme="dark"] .auth-input-group input,
html[data-theme="dark"] .auth-input-group select {
    background: #2d2d3d;
    border-color: #3d4558;
    color: #e8eaf0;
}

html[data-theme="dark"] .auth-input-group i {
    color: #8892a4;
}

html[data-theme="dark"] .auth-input-group input:focus + i,
html[data-theme="dark"] .auth-input-group select:focus + i,
html[data-theme="dark"] .auth-input-group.focused i {
    color: #a78bfa;
}

html[data-theme="dark"] .auth-input-group input:focus,
html[data-theme="dark"] .auth-input-group select:focus,
html[data-theme="dark"] .auth-input-group.focused input,
html[data-theme="dark"] .auth-input-group.focused select {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

html[data-theme="dark"] .auth-toggle p {
    color: #a0a8b8;
}

html[data-theme="dark"] .auth-toggle a {
    color: #a78bfa;
}

html[data-theme="dark"] .auth-toggle a:hover {
    color: #c4b5fd;
}

html[data-theme="dark"] .auth-message.error {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border-color: rgba(220, 38, 38, 0.35);
}

html[data-theme="dark"] .auth-message.success {
    background: rgba(22, 163, 74, 0.15);
    color: #86efac;
    border-color: rgba(22, 163, 74, 0.35);
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }
    .auth-left {
        min-height: 200px;
    }
    .auth-right {
        max-width: none;
    }
}

.auth-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    background: #fff;
    color: #1f2937;
    border: 1px solid #d1d5db;
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.auth-btn-google:hover {
    background: #f9fafb;
    color: #111827;
    text-decoration: none;
}

.auth-btn--secondary {
    background: transparent;
    border: 1px solid var(--gray-300, #cbd5e1);
    color: inherit;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 1.1rem;
    color: #94a3b8;
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

html[data-theme="dark"] .auth-btn-google {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

html[data-theme="dark"] .auth-divider::before,
html[data-theme="dark"] .auth-divider::after {
    background: #334155;
}
