/* ===== RESET & VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --orange: #f97316;
    --orange-dark: #b45309;
    --orange-light: #fb923c;
    --orange-bg: #fff7ed;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --green: #22c55e;
    --green-dark: #15803d;
    --red: #ef4444;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --border-radius: 32px;
    --border-radius-inner: 24px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    margin: 0;
    color: var(--gray-800);
}

/* ===== ÉCRAN DE CHARGEMENT ===== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    max-width: 300px;
    width: 80%;
}

.loading-logo {
    max-width: 120px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar-fill-loading {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--orange), #fbbf24);
    border-radius: 10px;
    transition: width 0.1s linear;
}

.loading-text {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* ===== CARTE PRINCIPALE ===== */
.payment-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(249, 115, 22, 0.1);
    max-width: 600px;
    width: 100%;
    padding: 2rem 1.8rem;
    position: relative;
    transition: var(--transition);
    border: 1px solid rgba(249,115,22,0.1);
    overflow: hidden;
}

/* ===== PROGRESSION ===== */
.progress-container { margin-bottom: 2rem; }
.progress-steps { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.75rem; font-weight: 600; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.5px; }
.progress-step { flex: 1; text-align: center; }
.progress-step.active { color: var(--orange); font-weight: 700; }
.progress-bar-bg { height: 6px; background: var(--gray-200); border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--orange), #fbbf24); border-radius: 10px; transition: width 0.4s ease; }

/* ===== LOGO ===== */
.logo-wrapper { text-align: center; margin: 1rem 0 2rem; }
.logo-kilo { max-width: 150px; height: auto; border-radius: 12px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.05)); }
.logo-fallback { display: inline-block; background: var(--orange); padding: 0.5rem 1.5rem; border-radius: 60px; color: white; font-weight: 700; font-size: 1.5rem; box-shadow: 0 4px 0 var(--orange-dark); }

/* ===== TYPOGRAPHIE ===== */
h1, .page-title { font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 700; text-align: center; color: var(--gray-800); margin: 0 0 0.5rem; line-height: 1.3; }
.page-subtitle { text-align: center; color: var(--gray-600); margin-bottom: 1.5rem; font-size: 0.95rem; }

/* ===== CARTES DE CONFIRMATION ===== */
.confirmation-card { background: var(--gray-50); border-radius: var(--border-radius-inner); padding: 1.5rem; margin: 1.5rem 0; border-left: 5px solid var(--orange); box-shadow: var(--shadow-sm); }
.confirmation-item { display: flex; align-items: flex-start; gap: 0.8rem; margin-bottom: 0.8rem; font-size: 0.95rem; }
.icon-circle { background: var(--orange); color: white; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 600; flex-shrink: 0; }
.approve-tag { background: var(--orange); color: white; font-weight: 600; padding: 0.2rem 0.7rem; border-radius: 30px; font-size: 0.8rem; display: inline-block; margin-left: 0.3rem; }

/* ===== EN ATTENTE ===== */
.pending-box { background: var(--white); border: 2px dashed var(--orange); border-radius: var(--border-radius-inner); padding: 1.2rem; margin: 1.5rem 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; box-shadow: 0 4px 0 #fde68a; font-size: 0.95rem; }
.pending-message { display: flex; align-items: center; gap: 0.6rem; font-weight: 500; }
.pending-message span { background: var(--orange); color: white; border-radius: 40px; padding: 0.2rem 0.8rem; font-size: 0.85rem; font-weight: 600; }

/* ===== CARTE DE CRÉDIT ===== */
.credit-card-preview { perspective: 1000px; margin-bottom: 2rem; width: 100%; max-width: 280px; margin-left: auto; margin-right: auto; }
.credit-card { width: 100%; height: 170px; border-radius: 16px; background: linear-gradient(145deg, #1e293b, #0f172a); color: white; padding: 1.2rem; box-shadow: 0 15px 25px -10px rgba(0,0,0,0.6); display: flex; flex-direction: column; justify-content: space-between; font-family: 'Courier New', monospace; border: 2px solid rgba(255,255,255,0.1); }
.credit-card__chip { width: 35px; height: 25px; background: linear-gradient(135deg, #d4af37, #f1c40f); border-radius: 6px; margin-bottom: 0.3rem; }
.credit-card__number { font-size: 1rem; letter-spacing: 1.5px; word-break: break-all; font-weight: 600; background: rgba(255,255,255,0.1); padding: 0.2rem 0.4rem; border-radius: 6px; margin: 0.3rem 0; }
.credit-card__details { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; }
.credit-card__name { text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.credit-card__expiry { font-weight: 600; }
.credit-card__cvc { font-size: 0.7rem; background: rgba(255,255,255,0.2); padding: 0.1rem 0.4rem; border-radius: 20px; }

/* ===== FORMULAIRES ===== */
.form-group { margin-bottom: 1.2rem; position: relative; }
label { display: block; font-weight: 600; font-size: 0.85rem; color: var(--gray-800); margin-bottom: 0.2rem; }
.input-wrapper { position: relative; display: flex; align-items: center; }
input, select { width: 100%; padding: 0.8rem 1.2rem; border: 1px solid var(--gray-200); border-radius: 60px; font-size: 0.95rem; transition: var(--transition); background: var(--white); box-shadow: var(--shadow-sm); }
input:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(249,115,22,0.15); }
input.valid, select.valid { border-color: var(--green); background-color: #f0fdf4; }
.valid-icon { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--green); font-weight: bold; font-size: 1.2rem; display: none; pointer-events: none; }
input.valid ~ .valid-icon, select.valid ~ .valid-icon { display: block; }

/* ===== TOGGLE VISIBILITÉ ===== */
.input-wrapper.with-toggle input { padding-right: 4rem; }
.toggle-visibility { position: absolute; right: 2.2rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1.2rem; padding: 0; color: var(--gray-600); z-index: 2; transition: color 0.2s; }
.toggle-visibility:hover { color: var(--orange); }
.input-wrapper .valid-icon { right: 0.8rem; }

/* ===== GESTION DES ERREURS ===== */
input.error { border-color: var(--red); background-color: #fef2f2; }
.error-message { color: var(--red); font-size: 0.75rem; margin-top: 0.2rem; margin-left: 1rem; display: none; }
.error-message.visible { display: block; }

/* ===== NOTE DE SÉCURITÉ ===== */
.security-note { background: #ecfdf5; border-left: 4px solid var(--green); padding: 0.8rem; border-radius: 12px; margin: 1.2rem 0; font-size: 0.85rem; color: #065f46; display: flex; align-items: center; gap: 0.5rem; }

/* ===== BOUTONS ===== */
.btn-primary, .btn-secondary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 60px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    padding: 0.7rem 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Bouton principal centré avec animation de pulsation */
.btn-primary {
    background: var(--orange);
    color: white;
    border: 1px solid var(--orange-dark);
    display: block;
    width: fit-content;
    margin: 0 auto;
    min-width: 200px;
    animation: gentlePulse 2s infinite;
}

.btn-primary:hover {
    background: var(--orange-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(249,115,22,0.2);
    animation: none;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

@keyframes gentlePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
    animation: none;
}

.btn-primary.loading .btn-text {
    display: none;
}

.btn-primary.loading .loader-gif {
    display: inline-block;
    width: 20px;
    height: 20px;
}

.loader-gif { display: none; }

/* Bouton secondaire (Retour, Suivant) */
.btn-secondary {
    background: transparent;
    color: var(--orange);
    border: 1px solid var(--orange);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--orange-bg);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Navigation : boutons décentrés (gauche et droite) */
.navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 2rem 0 0;
}

/* ===== FOOTER ===== */
.secure-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem 1.5rem; margin: 2rem 0 0.5rem; font-size: 0.75rem; color: var(--gray-600); border-top: 1px solid var(--gray-200); padding-top: 1.2rem; }
.footer-copyright { text-align: center; color: var(--gray-600); font-size: 0.75rem; margin-top: 1rem; }

/* ===== DIVERS ===== */
.bank-select { background: white; }
.info-text { background: #e6f7ff; border-left: 4px solid #1890ff; padding: 0.8rem; border-radius: 12px; margin: 1.2rem 0; font-size: 0.9rem; color: #0050b3; white-space: pre-line; }
#otherBankGroup { transition: all 0.2s; }
.success-gif { text-align: center; margin: 1rem 0; }
.success-gif img { width: 70px; height: 70px; }
.page { display: none; animation: slideIn 0.3s ease forwards; }
.page.active { display: block; }

@keyframes slideIn {
    0% { opacity: 0.5; transform: translateX(20px); }
    100% { opacity: 1; transform: translateX(0); }
}

.honeypot { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .payment-card { padding: 1.5rem 1rem; }
    .btn-primary, .btn-secondary { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
    .btn-primary { min-width: 160px; }
    .navigation { flex-direction: column; align-items: stretch; }
    .btn-secondary { width: 100%; }
}