/* =============================================
   TOURNOI.CSS - Styles TTSRJ Tournoi
   Fichier externe (remplace le <style> inline)
   ============================================= */

/* --- Variables & Reset --- */
:root {
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --secondary: #1e293b;
    --accent: #f43f5e;
    --bg-body: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
}

/* --- Layout --- */
.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.05);
    padding-bottom: 20px;
}

/* --- Header --- */
header {
    background: white;
    padding: 0 20px;
    height: 70px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
#logo a {
    font-weight: 800;
    font-size: 1.5em;
    color: var(--primary);
    letter-spacing: -1px;
    text-decoration: none;
}
#navigation ul {
    list-style: none;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
#navigation ul li a {
    padding: 8px 12px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9em;
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
}
#navigation ul li a:hover,
#navigation ul li.active a {
    background: var(--primary-light);
    color: var(--primary);
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}
@media (max-width: 1080px) {
    .menu-toggle { display: block; }
    #navigation {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        padding: 20px;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        max-height: 80vh;
        overflow-y: auto;
    }
    #navigation.active { display: block; }
    #navigation ul { flex-direction: column; gap: 5px; }
}

/* --- Slider / Sponsors --- */
.slider-section {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.slider-section .swiper-slide {
    height: 280px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px !important;
}
.slider-section .swiper-slide img {
    max-width: 90% !important;
    max-height: 90% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 0 !important;
}
@media (max-width: 768px) {
    .slider-section .swiper-slide {
        height: 120px !important;
        padding: 5px 15px !important;
    }
}
.no-sponsor-slide {
    text-align: center;
    color: #aaa;
    padding: 20px;
}

/* --- Main Content --- */
.main-content { padding: 30px 20px; }

/* --- Info Banner (remplace inline styles) --- */
.text-center-info {
    text-align: center;
    margin-bottom: 25px;
    font-size: 0.95em;
}
.color-dark-pink { color: #330027; }
.link-primary {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

/* --- Cards --- */
.modern-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}
.modern-card.pos-relative { position: relative; }
.card-body { padding: 30px; }
.blue-header-zone {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    width: 100%;
    padding: 40px 20px;
    text-align: center;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.blue-header-zone h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    text-transform: uppercase;
}
.blue-header-zone p {
    margin: 5px 0 0;
    opacity: 0.9;
    font-size: 1em;
}

/* --- Alerts --- */
.alert {
    padding: 18px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
}
.alert-error { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background-color: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    color: inherit;
    padding: 0 0 0 10px;
    line-height: 1;
}
.alert-flex-start { align-items: flex-start; }
.alert-icon-margin { margin-top: 2px; flex-shrink: 0; }
.alert-text-flex { flex: 1; }

/* --- Licence Modal --- */
.licence-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15,23,42,0.7);
    backdrop-filter: blur(6px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeInOverlay 0.3s ease;
}
.licence-modal-overlay.active { display: flex; }
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.licence-modal {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    animation: slideUp 0.4s cubic-bezier(0.34,1.56,0.64,1);
    overflow: hidden;
}
@keyframes slideUp {
    from { transform: translateY(60px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.licence-modal-top {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    padding: 30px 20px 25px;
    position: relative;
    overflow: hidden;
}
.licence-modal-top::before {
    content: '\1F4B3';
    position: absolute;
    top: -15px;
    right: -10px;
    font-size: 7em;
    opacity: 0.08;
    transform: rotate(15deg);
}
.licence-modal-icon {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2em;
    margin: 0 auto 15px;
    box-shadow: 0 4px 15px rgba(245,158,11,0.3);
    animation: pulseIcon 2s ease-in-out infinite;
}
@keyframes pulseIcon {
    0%,100% { transform: scale(1); box-shadow: 0 4px 15px rgba(245,158,11,0.3); }
    50% { transform: scale(1.05); box-shadow: 0 6px 25px rgba(245,158,11,0.5); }
}
.licence-modal-body { padding: 25px 30px 30px; }
.licence-modal-body h2 { font-size: 1.15em; color: #1e293b; margin-bottom: 8px; font-weight: 700; line-height: 1.4; }
.licence-modal-body p { color: #64748b; font-size: 0.92em; line-height: 1.6; margin-bottom: 20px; }
.licence-modal-body p strong { color: #92400e; }
.licence-countdown-wrap { background: #fffbeb; border: 2px dashed #fbbf24; border-radius: 12px; padding: 15px; margin-bottom: 5px; }
.licence-countdown-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: #92400e; margin-bottom: 5px; }
.licence-countdown-num { font-size: 3em; font-weight: 800; color: #d97706; line-height: 1; }
.licence-loader {
    width: 36px;
    height: 36px;
    border: 3px solid #fde68a;
    border-top-color: #d97706;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 10px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.licence-modal-footer { padding: 0 30px 25px; background: #f9fafb; border-top: 1px solid #e5e7eb; }
.licence-btn-skip {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    text-decoration: underline;
    font-family: 'Inter', sans-serif;
    transition: color 0.2s;
}
.licence-btn-skip:hover { color: #64748b; }
.licence-modal-overlay.modal-paid .licence-modal-top { background: linear-gradient(135deg, #ef4444, #dc2626); }
.licence-modal-overlay.modal-paid .licence-modal-icon { box-shadow: 0 4px 15px rgba(239,68,68,0.3); }
.licence-modal-overlay.modal-paid .licence-modal-body h2 { color: #991b1b; }
.licence-modal-overlay.modal-paid .licence-modal-body p strong { color: #991b1b; }
.licence-modal-overlay.modal-paid .licence-countdown-wrap { display: none; }
.licence-modal-overlay.modal-paid .licence-loader { display: none; }

/* --- HelloAsso Box --- */
.helloasso-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
}
.helloasso-logo { width: 80px; height: auto; }
.helloasso-content h4 { font-size: 1.1em; margin-bottom: 5px; }
.helloasso-content h4 span { color: var(--accent); }
.helloasso-content p { font-size: 0.9em; color: var(--text-muted); margin: 0; }

/* --- Form --- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.form-group { margin-bottom: 5px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 0.9em; font-weight: 500; color: var(--text-muted); }
.input-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    transition: border 0.2s, background 0.2s;
}
.input-field:focus { border-color: var(--primary); outline: none; }
.input-field.error { background-color: #fff0f0; border-color: #ef4444; }
.input-field.licence-ok { border-color: #22c55e; background-color: #f0fdf4; }
.input-field.licence-blocked { border-color: #ef4444; background-color: #fff0f0; }

/* --- Licence Field Helpers (remplace inline styles) --- */
.licence-field-wrapper { position: relative; }
.licence-spinner,
.licence-check-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

/* --- Tableaux --- */
.tableau-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.tableau-card {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 12px 15px;
    transition: all 0.2s;
}
.tableau-card:hover { border-color: #cbd5e1; background: white; }
.tableau-card.row-disabled { opacity: 0.5; background: #f1f5f9; }
.tableau-card-aucun { border-style: dashed; background: white; border-width: 2px; }
.card-left { display: none; align-items: center; padding-right: 15px; }
.letter-badge {
    width: 45px;
    height: 45px;
    background: var(--secondary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2em;
    flex-shrink: 0;
}
.card-body { flex: 1; padding: 0 15px; min-width: 0; }
.card-body-center { margin-bottom: 0; text-align: center; }
.card-title { font-weight: 600; font-size: 0.95em; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title small { font-weight: 400; color: var(--text-muted); margin-left: 5px; }
.card-meta { display: flex; align-items: center; gap: 15px; font-size: 0.85em; color: var(--text-muted); margin-top: 4px; flex-wrap: wrap; }
.badge { padding: 3px 8px; border-radius: 4px; font-size: 0.75em; font-weight: 600; text-transform: capitalize; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-orange { background: #fff7ed; color: #c2410c; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-dark { background: #e2e8f0; color: #334155; }
.card-choice { display: flex; gap: 8px; flex-shrink: 0; }
.card-choice-center { justify-content: center; }
.radio-btn { cursor: pointer; }
.radio-btn input { display: none; }
.radio-btn span {
    display: block;
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9em;
    text-align: center;
    min-width: 45px;
    background: white;
    font-weight: 600;
    color: var(--secondary);
    transition: all 0.2s;
}
.radio-btn input:checked + span { background: var(--primary); color: white; border-color: var(--primary); }
.radio-btn:hover span { border-color: var(--primary); background: var(--primary-light); }

/* --- Section Title Tableaux (remplace inline style) --- */
.section-title-tableaux {
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}
.color-accent { color: var(--accent); }
.text-muted-card { color: var(--text-muted); }
.grid-full-width { grid-column: 1 / -1; }
.select-full-width { width: 100%; }

/* --- Footer --- */
footer {
    background: #f8fafc;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 30px;
}

/* --- Form Overlay --- */
.form-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 10;
    border-radius: 15px;
    cursor: not-allowed;
}
.form-overlay.active { display: block; }

/* --- Submit Button --- */
.btn-main {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}

/* --- Select2 overrides --- */
.select2-container--default .select2-selection--single {
    height: 42px;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 28px; color: #333; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px; }
.select2-container--default .select2-selection--single.error-select { border-color: #ef4444; background-color: #fff0f0; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .main-content { padding: 15px; }
    .blue-header-zone { padding: 30px 15px; margin-bottom: 20px; border-radius: 10px; }
    .blue-header-zone h2 { font-size: 1.4rem; }
    .form-grid { grid-template-columns: 1fr; gap: 15px; }
    .tableau-card { flex-direction: column; align-items: stretch; padding: 15px; border-radius: 10px; }
    .card-left { display: flex; justify-content: flex-start; padding-right: 0; margin-bottom: 10px; }
    .letter-badge { width: 40px; height: 40px; font-size: 1.1em; }
    .card-body { padding: 0; margin-bottom: 15px; text-align: left; }
    .card-title { font-size: 1em; white-space: normal; }
    .card-meta { margin-top: 6px; }
    .card-choice { justify-content: space-between; gap: 10px; }
    .radio-btn span { flex: 1; padding: 12px; font-size: 1em; }
    .helloasso-box { flex-direction: column; text-align: center; }
    .helloasso-content { text-align: center; }
    .licence-modal { max-width: 92vw; }
    .licence-modal-top { padding: 25px 15px 20px; }
    .licence-modal-icon { width: 65px; height: 65px; font-size: 1.8em; margin-bottom: 12px; }
    .licence-modal-body { padding: 20px; }
    .licence-modal-body h2 { font-size: 1.05em; }
    .licence-modal-body p { font-size: 0.85em; margin-bottom: 15px; }
    .licence-countdown-num { font-size: 2.4em; }
    .licence-modal-footer { padding: 0 20px 20px; }
}
@media (max-width: 400px) {
    .licence-modal-icon { width: 55px; height: 55px; font-size: 1.5em; }
    .licence-countdown-num { font-size: 2em; }
    .licence-modal-body { padding: 15px; }
    .licence-modal-footer { padding: 0 15px 15px; }
}