/* =========================================
   1. VARIABLES & RESET GLOBAL
   ========================================= */
:root {
    /* Palette de couleurs UnivZone */
    --primary: #2563eb;
    /* Bleu principal */
    --primary-dark: #1e40af;
    /* Bleu foncé (survol) */
    --secondary: #6366f1;
    /* Violet/Indigo (Paiement) */
    --accent: #f59e0b;
    /* Orange (Prix/Alertes) */
    --success: #10b981;
    /* Vert (Succès) */
    --danger: #ef4444;
    /* Rouge (Erreur) */

    /* Couleurs de fond et texte */
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Ajoutez ceci ou remplacez dans style.css */

/* Onglets */
.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    padding: 0 10px;
}

.tab {
    padding: 10px 20px;
    border: 1px solid #2563eb;
    border-radius: 20px;
    color: #2563eb;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.tab.active,
.tab:hover {
    background-color: #2563eb;
    color: white;
}

/* Conteneur des offres */
.offers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Carte Offre */
.offer-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
    border: 1px solid #eee;
}

.offer-header {
    background: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.offer-header h3 {
    margin: 0;
    color: #1e40af;
}

.offer-body {
    padding: 20px;
}

.price {
    font-size: 2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.features {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    text-align: left;
    padding-left: 20px;
}

.features li {
    margin-bottom: 8px;
    color: #555;
}

/* Bouton de sélection */
.btn-select {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-select:hover {
    background-color: #1e40af;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #888;
    font-size: 0.9em;
}

/* =========================================
   2. HEADER (En-tête global)
   ========================================= */
.univzone-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    margin-bottom: 30px;
}

.logo-area {
    font-size: 2em;
    font-weight: 800;
    margin-bottom: 5px;
    letter-spacing: -1px;
}

.tagline {
    font-size: 0.9em;
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Conteneur principal centré */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* =========================================
   3. PAGE D'ACCUEIL (index.php)
   ========================================= */
.welcome-msg {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-muted);
    font-size: 1.1em;
}

/* --- Onglets (Tabs) --- */
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

/* --- Grille des Forfaits --- */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.package-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.package-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: #eff6ff;
    /* Bleu très clair */
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.pkg-name {
    color: var(--primary-dark);
    font-size: 1.25em;
    font-weight: 700;
}

.card-body {
    padding: 25px;
    text-align: center;
}

.pkg-price {
    font-size: 2.2em;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
}

.pkg-price small {
    font-size: 0.4em;
    color: var(--text-muted);
    vertical-align: super;
}

.pkg-features {
    list-style: none;
    margin-bottom: 25px;
    text-align: left;
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
}

.pkg-features li {
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 0.95em;
    display: flex;
    align-items: center;
}

.pkg-features li:last-child {
    margin-bottom: 0;
}

.pkg-features i {
    color: var(--primary);
    width: 25px;
    text-align: center;
    margin-right: 10px;
}

.btn-subscribe {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    padding: 14px;
    width: 100%;
    border-radius: 10px;
    font-weight: 600;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.btn-subscribe:hover {
    background: var(--primary-dark);
}

.footer-info {
    text-align: center;
    margin-top: 40px;
    font-size: 0.8em;
    color: var(--text-muted);
    opacity: 0.7;
}

/* =========================================
   4. PAGE DE PAIEMENT (checkout.php)
   ========================================= */
.checkout-bg {
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Prend toute la hauteur */
    padding: 20px;
}

.checkout-container {
    background: #fff;
    width: 100%;
    max-width: 480px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    padding: 35px;
    position: relative;
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.back-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9em;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary);
}

.secure-badge {
    background: #ecfdf5;
    color: var(--success);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Résumé de la commande */
.payment-summary {
    margin-bottom: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95em;
}

.summary-row .label {
    color: var(--text-muted);
}

.summary-row .value {
    font-weight: 600;
    color: var(--text-main);
}

.summary-row .highlight {
    color: var(--secondary);
}

.summary-row.total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed var(--border);
    font-size: 1.2em;
    align-items: center;
}

.summary-row .price {
    font-weight: 800;
    color: var(--text-main);
}

/* Formulaire Checkout */
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9em;
}

/* Input Téléphone avec préfixe */
.phone-input-group {
    display: flex;
    border: 2px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
}

.phone-input-group:focus-within {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.country-code {
    background: #f9fafb;
    padding: 0 15px;
    color: var(--text-main);
    font-weight: 600;
    border-right: 1px solid var(--border);
    display: flex;
    align-items: center;
    font-size: 1em;
}

.real-input {
    border: none;
    width: 100%;
    padding: 14px 15px;
    font-size: 1.1em;
    outline: none;
    letter-spacing: 1px;
    color: var(--text-main);
}

/* Cartes Opérateurs */
.operator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.operator-card {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    overflow: hidden;
}

.operator-card input {
    display: none;
}

/* Cache le bouton radio natif */

.card-content {
    padding: 20px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 110px;
}

/* État sélectionné */
.operator-card.selected {
    border-color: var(--secondary);
    background-color: #eef2ff;
}

.check-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--secondary);
    font-size: 1.1em;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.operator-card.selected .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* Logos Opérateurs (Stylisés en CSS) */
.op-logo {
    font-weight: 900;
    font-size: 1.4em;
    margin-bottom: 8px;
    line-height: 1;
}

.mtn-color {
    color: #ffcc00;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.1);
    letter-spacing: -1px;
}

.orange-color {
    color: #ff6600;
    letter-spacing: -1px;
}

.op-name {
    font-size: 0.8em;
    color: var(--text-muted);
    font-weight: 500;
}

/* Boutons Checkout */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.btn-cancel,
.btn-pay {
    padding: 15px;
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    font-size: 1em;
    flex: 1;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s;
}

.btn-cancel:active,
.btn-pay:active {
    transform: scale(0.98);
}

.btn-cancel {
    background: #fff;
    border: 2px solid var(--border);
    color: var(--text-muted);
}

.btn-cancel:hover {
    background: #f9fafb;
    color: var(--text-main);
}

.btn-pay {
    background: var(--secondary);
    color: #fff;
    border: none;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.btn-pay:hover {
    background: #4f46e5;
}

/* =========================================
   5. PAGE D'ATTENTE & ERREURS (waiting.php)
   ========================================= */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border-left-color: var(--primary);
    animation: spin 1s ease infinite;
    margin: 30px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-container {
    max-width: 500px;
    margin: 50px auto;
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.btn-retry {
    display: inline-block;
    margin-top: 25px;
    padding: 12px 30px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
}

/* =========================================
   6. RESPONSIVE (Mobile)
   ========================================= */
@media (max-width: 600px) {
    .packages-grid {
        grid-template-columns: 1fr;
    }

    .checkout-container {
        padding: 25px;
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
        height: 100vh;
        /* Plein écran sur mobile */
        display: flex;
        flex-direction: column;
    }

    .checkout-bg {
        padding: 0;
        background: #fff;
        align-items: flex-start;
    }

    .payment-summary {
        background: #f9fafb;
        padding: 15px;
        border-radius: 10px;
    }

    /* Pousser les boutons vers le bas sur mobile */
    .action-buttons {
        margin-top: auto;
    }
}