/* ============================================
   ARTELIS - Connexion - Feuille de styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ===== RESET & VARIABLES ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --red:        #C0392B;
    --red-dark:   #922B21;
    --red-light:  #E74C3C;
    --white:      #FFFFFF;
    --off-white:  #F7F7F5;
    --text-dark:  #1A1A2E;
    --text-mid:   #6B7280;
    --text-light: #9CA3AF;
    --border:     #E5E7EB;
    --input-bg:   #F9FAFB;
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
    --shadow-md:  0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg:  0 20px 60px rgba(0,0,0,0.12);
    --font-display: 'Bebas Neue', sans-serif;
    --font-body:    'DM Sans', sans-serif;
}

/* ===== BODY ===== */
body {
    font-family: var(--font-body);
    background: var(--off-white);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* ===== PANNEAU GAUCHE ===== */
.panel-left {
    position: relative;
    width: 45%;
    min-height: 100vh;
    background: var(--red);
    overflow: hidden;
    flex-shrink: 0;
}

/* Forme décorative principale */
.panel-left::before {
    content: '';
    position: absolute;
    bottom: -120px;
    right: -80px;
    width: 420px;
    height: 420px;
    background: var(--red-dark);
    border-radius: 50%;
    opacity: 0.5;
}

.panel-left::after {
    content: '';
    position: absolute;
    top: -80px;
    left: -60px;
    width: 300px;
    height: 300px;
    background: var(--red-light);
    border-radius: 50%;
    opacity: 0.25;
}

/* Contenu gauche */
.panel-left-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 48px 52px;
}

/* Logo haut gauche */
.panel-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.panel-logo img {
    height: 120px;
    width: auto;
    filter: brightness(0) invert(1);
    object-fit: contain;
}

.panel-logo-text {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--white);
    letter-spacing: 3px;
    line-height: 1;
}

/* Zone centrale gauche */
.panel-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
}

.panel-tagline {
    font-family: var(--font-display);
    font-size: clamp(52px, 6vw, 80px);
    color: var(--white);
    line-height: 0.92;
    letter-spacing: 2px;
    margin-bottom: 28px;
}

.panel-tagline span {
    display: block;
    color: rgba(255,255,255,0.35);
}

.panel-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
    max-width: 320px;
    font-weight: 400;
    border-left: 3px solid rgba(255,255,255,0.3);
    padding-left: 16px;
}

/* Badges services */
.panel-services {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.service-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--white);
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}

.service-chip i {
    font-size: 13px;
}

/* Illustration pompier SVG */
.panel-illustration {
    position: absolute;
    bottom: 0;
    right: -10px;
    width: 65%;
    opacity: 0.12;
    pointer-events: none;
}

/* Bande diagonale décorative */
.panel-stripe {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
}

/* ===== PANNEAU DROIT ===== */
.panel-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    background: var(--white);
    position: relative;
}

/* Motif de fond subtil */
.panel-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, #e5e7eb 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.4;
    pointer-events: none;
}

/* Contenu formulaire */
.form-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* En-tête formulaire */
.form-header {
    margin-bottom: 40px;
}

.form-header .greeting {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-header .greeting::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 2px;
    background: var(--red);
}

.form-header h1 {
    font-family: var(--font-display);
    font-size: 44px;
    color: var(--text-dark);
    line-height: 1;
    letter-spacing: 1px;
}

.form-header h1 em {
    color: var(--red);
    font-style: normal;
}

.form-header p {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-mid);
    line-height: 1.6;
}

/* ===== ALERTES ===== */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: var(--red);
}

.alert-success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
}

.alert-info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
}

/* ===== GROUPES CHAMPS ===== */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-mid);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s;
}

.form-group input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--input-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-group input:focus {
    border-color: var(--red);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(192,57,43,0.08);
}

.form-group input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--red);
}

.form-group input::placeholder {
    color: var(--text-light);
}

/* Toggle mot de passe */
.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    font-size: 14px;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--red);
}

/* ===== BOUTON CONNEXION ===== */
.btn-login {
    width: 100%;
    padding: 15px 20px;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 18px;
    letter-spacing: 2.5px;
    cursor: pointer;
    transition: background 0.25s, transform 0.15s, box-shadow 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.btn-login::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.btn-login:hover {
    background: var(--red-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(192,57,43,0.35);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== SÉPARATEUR ===== */
.form-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--text-light);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ===== FOOTER DU FORMULAIRE ===== */
.form-footer {
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-footer .restricted {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-footer .restricted i {
    color: var(--red);
    font-size: 10px;
}

.form-footer .version {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
}

/* Status opérationnel */
.status-bar {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text-light);
    white-space: nowrap;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #22C55E;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    50%       { opacity: 0.7; box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    body { flex-direction: column; overflow: auto; }

    .panel-left {
        width: 100%;
        min-height: 220px;
        padding: 30px;
    }

    .panel-left-content {
        padding: 28px 32px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .panel-center { display: none; }

    .panel-services {
        flex-direction: row;
    }

    .panel-right {
        padding: 48px 28px;
        min-height: auto;
    }

    .status-bar { position: static; margin-top: 24px; justify-content: center; }
}

@media (max-width: 480px) {
    .panel-left-content { flex-direction: column; gap: 16px; }
    .form-header h1 { font-size: 36px; }
    .panel-tagline { font-size: 38px; }
}