body {
	margin: 0;
	min-height: 100vh;
	font-family: "Segoe UI", Arial, sans-serif;
	background: radial-gradient(circle at top, #2d5a27, #1a3c1a);
	background-attachment: fixed;
	display: flex;
	flex-direction: column;
	align-items: center;
	overflow-x: hidden;
	color: #333;
}

body::before { content: "🌿"; font-size: 100px; opacity: 0.1; position: fixed; top: 5%; left: -20px; transform: rotate(-20deg); pointer-events: none; }
body::after { content: "🍃"; font-size: 80px; opacity: 0.1; position: fixed; bottom: 5%; right: -20px; transform: rotate(15deg); pointer-events: none; }

header {
	width: 100%;
	max-width: 480px;
	padding: 20px;
	display: flex;
	justify-content: center;
	z-index: 10;
}

header img { width: 80%; height: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); }

.container { width: 90%; max-width: 460px; z-index: 5; padding-bottom: 40px; }

/* PROGRESSION */
.steps { display: flex; justify-content: space-between; margin-bottom: 20px; width: 100%; }
.step {
	width: 35px; height: 35px; display: flex; align-items: center; justify-content: center;
	border-radius: 50%; background: rgba(255,255,255,0.15); color: #fff; font-size: 12px;
	backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.3); transition: 0.3s;
}
.step.active { background: #22c55e; box-shadow: 0 0 15px #22c55e; font-weight: bold; transform: scale(1.2); border-color: #fff; }

/* CARDS */
.box {
	background: rgba(255, 255, 255, 0.95); padding: 25px; border-radius: 25px;
	box-shadow: 0 20px 50px rgba(0,0,0,0.4); border: 3px solid #22c55e;
	animation: slideIn 0.5s ease; box-sizing: border-box; width: 100%;
}

h2 { text-align: center; color: #1a3c1a; margin-top: 0; font-size: 20px; text-transform: uppercase; }
p { text-align: center; color: #444; margin-bottom: 20px; font-size: 14px; }

.dinos { text-align: center; font-size: 45px; margin: 10px 0; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0px) rotate(0deg); } 50% { transform: translateY(-12px) rotate(5deg); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* TICKETS CATÉGORIES */
.ticket-categories { display: flex; justify-content: space-between; gap: 8px; margin: 20px 0; }
.cat-box { flex: 1; background: #f0fdf4; border: 2px solid #bcf0da; padding: 12px 5px; border-radius: 15px; text-align: center; }
.cat-box span { display: block; font-size: 30px; margin-bottom: 5px; }
.cat-box label { font-size: 11px; font-weight: bold; color: #166534; display: block; }
.cat-box .price-tag { font-size: 10px; color: #15803d; font-weight: bold; }
.cat-box select {
    /* 1. Retire le style forcé par iOS/Android */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* 2. Force l'espace interne */
    width: 100%;
    min-width: 45px;      /* Sécurité pour que le chiffre ne soit jamais écrasé */
    height: 40px;        /* Hauteur confortable pour le doigt */
    padding: 0 5px;      /* Un peu d'air sur les côtés */
    
    /* 3. Style visuel */
    font-size: 16px;     /* Taille minimale pour éviter le zoom auto */
    text-align: center;
    text-align-last: center; /* Centre le chiffre sur certains navigateurs */
    background-color: #fff;
    border: 1px solid #bcf0da;
    border-radius: 8px;
    color: #333;
}

/* BOUTONS AVENTURE */
button {
	width: 100%; padding: 16px; margin-top: 15px; border: none; border-radius: 15px;
	color: #fff; font-size: 16px; font-weight: bold; text-transform: uppercase; cursor: pointer;
	box-shadow: 0 4px 0 #065f27; transition: 0.1s; background: linear-gradient(135deg, #22c55e, #15803d);
}
button:active { transform: translateY(3px); box-shadow: 0 1px 0 #065f27; }
.btn-download { background: linear-gradient(135deg, #0ea5e9, #0369a1); box-shadow: 0 4px 0 #075985; }
.btn-back { background: #e2e8f0; color: #475569; box-shadow: 0 4px 0 #94a3b8; font-size: 13px; }

input, select {   width: calc(100% - 25px); padding: 12px 10px; margin-top: 10px; border-radius: 10px; border: 2px solid #e2e8f0; font-size: 14px; }
.recap-detail { background: #f0fdf4; border-left: 5px solid #22c55e; padding: 15px; border-radius: 10px; margin: 15px 0; font-size: 14px; }
.hidden { display: none; }

/* TICKET RÉSULTAT */
#ticket-result { padding: 20px; border-radius: 15px; background: white; text-align: center; border: 1px solid #eee; color: #333; }
.qr { width: 140px; height: 140px; margin: 15px auto; background: url('https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=DINO-ALGERIA-2026') no-repeat center; background-size: contain; }

.cibImg {
	height: 55px;
	border-radius: 11px;
}

.error {
	color: red;
	margin-top: 10px;
	padding: 10px;
	background: #ffeeee;
	border-radius: 4px;
}

		/* Checkbox personnalisée */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    margin: 15px 0;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    color: #333;
    line-height: 1.5;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #22c55e;
    border-radius: 4px;
    transition: all 0.3s;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #f0fdf4;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #22c55e;
    border-color: #15803d;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container a {
    color: #22c55e;
    text-decoration: none;
    font-weight: bold;
}

.checkbox-container a:hover {
    text-decoration: underline;
}

/* Captcha */
.cgu-captcha-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #e2e8f0;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.captcha-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #22c55e;
    border-radius: 8px;
    overflow: hidden;
}

.captcha-box span {
    background: linear-gradient(135deg, #22c55e, #15803d);
    color: white;
    padding: 12px 15px;
    font-size: 18px;
    font-weight: bold;
    font-family: monospace;
    min-width: 80px;
    text-align: center;
}

.captcha-box input {
    flex: 1;
    border: none;
    margin: 0;
    padding: 12px;
    font-size: 16px;
}

.captcha-box input:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px #22c55e;
}

.btn-refresh {
    width: 45px;
    height: 45px;
    padding: 0;
    margin: 0;
    background: #e2e8f0;
    color: #475569;
    font-size: 20px;
    border: 2px solid #cbd5e1;
    box-shadow: 0 2px 0 #94a3b8;
}

.btn-refresh:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #94a3b8;
}

/* Message d'erreur */
.captcha-error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.cgu-group {
    margin: 20px 0;
    padding: 15px;
    background: #f0fdf4;
    border-radius: 8px;
    border-left: 4px solid #22c55e;
}

/* ── Reçu SATIM ─────────────────────────────────────────── */
.satim-receipt {
    background: #fff;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: left;
}
.satim-receipt-header {
    background: linear-gradient(135deg, #1a3c1a, #2d6a2d);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.satim-logo {
    height: 32px;
    object-fit: contain;
}
.satim-receipt-title {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}
.satim-receipt-body {
    padding: 8px 16px;
}
.satim-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px dashed #e5e7eb;
    font-size: 13px;
    line-height: 1.4;
}
.satim-row:last-child {
    border-bottom: none;
}
.satim-row span:first-child {
    color: #6b7280;
    min-width: 130px;
}
.satim-row span:last-child {
    font-weight: 600;
    color: #111827;
    text-align: right;
    word-break: break-all;
}
.satim-approved { color: #16a34a !important; }
.satim-declined { color: #dc2626 !important; }

/* ===== PAYMENT SUCCESS CARD ===== */
.payment-success-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin: 12px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
    font-family: sans-serif;
}

.payment-success-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.success-icon { font-size: 28px; }

.success-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.success-subtitle {
    font-size: 13px;
    color: #16a34a;
    font-weight: 500;
}

/* Transaction details grid (2 colonnes comme l'image) */
.details-title {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 6px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.detail-item {
    padding: 10px 8px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    font-size: 13px;
    color: #111827;
    font-weight: 600;
    word-break: break-all;
}

.satim-approved {
    color: #16a34a !important;
    font-weight: 600 !important;
}

.satim-cib {
    color: #16a34a !important;
}

/* Email section */
.email-ticket-section {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 14px;
    margin: 16px 0 12px;
}

.email-ticket-title {
    font-size: 13px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 10px;
}

.email-ticket-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.email-input {
    flex: 1;
    min-width: 160px;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.email-input:focus { border-color: #16a34a; }

.btn-send-ticket {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-send-ticket:hover { background: #15803d; }

.email-hint {
    font-size: 11px;
    color: #6b7280;
    margin-top: 6px;
    margin-bottom: 0;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 12px 0 6px;
}

.btn-download-ticket {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-print-ticket {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-back-home {
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 13px;
    cursor: pointer;
}

/* SATIM Footer */
.satim-footer {
    text-align: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 12px;
}

.satim-footer-logo {
    max-width: 120px;
    margin-top: 8px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.payment-fail-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 2px solid #ef4444;
    max-width: 520px;
    margin: 0 auto;
}
.payment-fail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #fee2e2;
}
.fail-icon { font-size: 36px; }
.fail-title {
    font-size: 18px;
    font-weight: bold;
    color: #ef4444;
}
.fail-subtitle { font-size: 13px; color: #666; margin-top: 2px; }
.fail-reason {
    color: #ef4444 !important;
    font-weight: bold;
}
.satim-support-section {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    margin-top: 16px;
}
.satim-support-text { font-size: 13px; color: #555; margin-bottom: 8px; }
.satim-phone-badge {
    display: inline-block;
    background: #22c55e;
    color: white;
    font-size: 20px;
    font-weight: bold;
    padding: 8px 24px;
    border-radius: 30px;
    text-decoration: none;
    margin: 6px 0;
}
.satim-phone-badge:hover { background: #16a34a; }
.satim-support-hint { font-size: 11px; color: #888; margin-top: 4px; }


@media print {
    /* Cacher TOUT */
    body * { visibility: hidden; }

    /* Afficher uniquement le ticket */
    #ticket-result,
    #ticket-result * {
        visibility: visible !important;
        display: block !important;
    }

    /* Positionner le ticket en haut à gauche */
    #ticket-result {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: white !important;
    }

    @page {
        size: A4;
        margin: 10mm;
    }
}
