:root {
    --primary:       #1a3c6e;
    --primary-light: #2f5da6;
    --accent:        #0ea5e9;
    --error:         #dc2626;
    --success:       #16a34a;
    --text-dark:     #111827;
    --text-mid:      #374151;
    --text-soft:     #6b7280;
    --border:        #e5e7eb;
    --bg-page:       #eef2f8;
    --radius:        12px;
    --transition:    0.2s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-page);
    color: var(--text-dark);
    min-height: 100vh;
}

/* ── LAYOUT ─────────────────────────────────────────────── */
.login-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - 64px);
}

/* ── IMAGE GAUCHE ────────────────────────────────────────── */
.login-image {
    position: relative;
    overflow: hidden;
    background: var(--primary);
}

.login-logo {
    position: absolute;
    top: 28px;
    left: 32px;
    z-index: 3;
}
.login-logo img { filter: brightness(0) invert(1); }

.login-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.45;
    display: block;
}

.login-image-overlay {
    position: absolute;
    bottom: 48px;
    left: 40px;
    right: 40px;
    z-index: 2;
    color: #fff;
}

.login-image-overlay h2 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
}

.login-image-overlay p {
    font-size: 16px;
    opacity: 0.85;
    line-height: 1.6;
}

/* ── FORM SIDE ───────────────────────────────────────────── */
.login-form-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
    background: #fff;
    overflow-y: auto;
}

.back-link {
    align-self: flex-start;
    font-size: 14px;
    color: var(--text-soft);
    text-decoration: none;
    margin-bottom: 32px;
    transition: color var(--transition);
}
.back-link:hover { color: var(--primary); }

/* ── ONGLETS ─────────────────────────────────────────────── */
.login-tabs {
    display: flex;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 36px;
    width: 100%;
    max-width: 400px;
}

.login-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.login-tab.active {
    background: var(--primary);
    color: #fff;
}

/* ── PANEL ───────────────────────────────────────────────── */
.login-panel {
    width: 100%;
    max-width: 400px;
}
.login-panel.hidden { display: none; }

.login-panel h1 {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 28px;
}

/* ── BOUTON GOOGLE (même style que modal index) ──────────── */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: rgba(26, 60, 110, 0.06);
    border: 2px solid rgba(26, 60, 110, 0.15);
    color: var(--text-dark);
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s;
}
.btn-google:hover {
    border-image: linear-gradient(45deg, #4285f4, #ea4335, #fbbc05, #34a853) 1;
}

.google-g {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-dark);
    transition: all 0.3s ease;
    display: inline-block;
}
.btn-google:hover .google-g {
    background: conic-gradient(
        from 231deg,
        #FBBC05 58deg 41deg,
        #EA4335 57deg 193deg,
        #4285F4 204deg 284deg,
        #34A853 211deg 120deg
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--text-soft);
    font-size: 13px;
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── FORMULAIRE ──────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-mid);
}

.form-group input {
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 17px;
    font-family: inherit;
    color: var(--text-dark);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}
.form-group input::placeholder { color: #9ca3af; }

.feedback {
    font-size: 12px;
    color: var(--error);
    min-height: 16px;
}

/* ── BOUTON SUBMIT ───────────────────────────────────────── */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 14px rgba(26,60,110,0.28);
    margin-top: 4px;
}
.btn-submit:hover {
    background: linear-gradient(135deg, #2563eb, var(--accent));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26,60,110,0.35);
}
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── SWITCH ──────────────────────────────────────────────── */
.switch-text {
    text-align: center;
    margin-top: 22px;
    font-size: 16px;
    color: var(--text-soft);
}

.switch-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color var(--transition);
}
.switch-btn:hover { color: var(--primary); }

/* ── MESSAGE GLOBAL ──────────────────────────────────────── */
.global-message {
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    width: 100%;
    max-width: 400px;
}
.global-message.hidden { display: none; }
.global-message.error   { background: #fef2f2; color: var(--error);   border: 1px solid #fecaca; }
.global-message.success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .login-page { grid-template-columns: 1fr; }
    .login-image { display: none; }
    .login-form-side { padding: 40px 24px; justify-content: flex-start; padding-top: 48px; }
}

@media (max-width: 480px) {
    .login-form-side { padding: 32px 16px; }
}
