/* ==========================================================================
   OWF CRM — Public Stylesheet
   Dark theme matching onlywayfootball.fr
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Required star & validation
   -------------------------------------------------------------------------- */

.owf-star {
    color: #AA1A1A;
    font-weight: 700;
}

.owf-field-invalid input,
.owf-field-invalid select,
.owf-field-invalid textarea {
    border-color: #AA1A1A !important;
    box-shadow: 0 0 0 3px rgba(170, 26, 26, 0.15) !important;
}

.owf-field-error-msg {
    color: #AA1A1A;
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 6px;
}

.owf-field-error-msg::before {
    content: "⚠";
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   1. Wrapper
   -------------------------------------------------------------------------- */

.owf-inscription-wrapper {
    max-width: 100%;
    margin: 0 auto;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: #ffffff;
    -webkit-font-smoothing: antialiased;
}

.owf-inscription-wrapper *,
.owf-inscription-wrapper *::before,
.owf-inscription-wrapper *::after {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   2. Loading State
   -------------------------------------------------------------------------- */

.owf-form-loading {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 15px;
}

.owf-form-loading::before {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto 16px;
    border: 3px solid #333;
    border-top-color: #E63946;
    border-radius: 50%;
    animation: owf-spin 0.7s linear infinite;
}

@keyframes owf-spin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   3. Closed State
   -------------------------------------------------------------------------- */

.owf-form-closed {
    background: #2a2a2a;
    border: 1px solid #444;
    border-left: 4px solid #E63946;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    color: #ccc;
    font-size: 15px;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   4. Success State
   -------------------------------------------------------------------------- */

.owf-form-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 32px;
    text-align: center;
}

.owf-form-success h3 {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 700;
    color: #10b981;
}

.owf-form-success p {
    margin: 0;
    font-size: 15px;
    color: #ccc;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   5. Detection Banner
   -------------------------------------------------------------------------- */

.owf-detection-banner {
    background: #2a2a2a;
    border-left: 4px solid #E63946;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.owf-detection-banner h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.owf-detection-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #999;
}

.owf-detection-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* --------------------------------------------------------------------------
   6. Form Base
   -------------------------------------------------------------------------- */

.owf-inscription-form {
    max-width: 100%;
}

.owf-form-required-note {
    font-size: 13px;
    color: #E63946;
    margin: 0 0 20px;
}

/* --------------------------------------------------------------------------
   7. Form Rows (2-column grid)
   -------------------------------------------------------------------------- */

.owf-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   8. Form Groups
   -------------------------------------------------------------------------- */

.owf-form-group {
    margin-bottom: 20px;
}

.owf-form-group--full {
    grid-column: 1 / -1;
}

.owf-form-group label,
.owf-inscription-form > .owf-form-group label {
    display: block;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   9. Form Inputs
   -------------------------------------------------------------------------- */

.owf-inscription-form input[type="text"],
.owf-inscription-form input[type="email"],
.owf-inscription-form input[type="tel"],
.owf-inscription-form input[type="date"],
.owf-inscription-form input[type="number"],
.owf-inscription-form select,
.owf-inscription-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: #2a2a2a;
    border: 1.5px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.owf-inscription-form input[type="text"]:focus,
.owf-inscription-form input[type="email"]:focus,
.owf-inscription-form input[type="tel"]:focus,
.owf-inscription-form input[type="date"]:focus,
.owf-inscription-form input[type="number"]:focus,
.owf-inscription-form select:focus,
.owf-inscription-form textarea:focus {
    border-color: #E63946;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

.owf-inscription-form input::placeholder,
.owf-inscription-form textarea::placeholder {
    color: #666;
}

/* Select styling */
.owf-inscription-form select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.owf-inscription-form select option {
    background: #2a2a2a;
    color: #fff;
}

/* Textarea */
.owf-inscription-form textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Date input */
.owf-inscription-form input[type="date"] {
    color-scheme: dark;
}

/* --------------------------------------------------------------------------
   10. Payment Display
   -------------------------------------------------------------------------- */

.owf-paiement-display {
    background: #2a2a2a;
    padding: 14px 18px;
    border-radius: 8px;
    border: 1.5px solid #444;
    font-weight: 600;
    font-size: 15px;
    color: #fff;
}

.owf-inline-payment {
    margin-top: 4px;
}

.owf-stripe-payment-element {
    background: #2a2a2a;
    border: 1.5px solid #444;
    border-radius: 8px;
    padding: 14px 16px;
    min-height: 58px;
}

.owf-inline-fallback-btn {
    margin-top: 12px;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid #555;
    border-radius: 8px;
    color: #ddd;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.owf-inline-fallback-btn:hover {
    border-color: #E63946;
    color: #fff;
}

.owf-inline-fallback-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.owf-inline-payment-note {
    margin-top: 10px;
    font-size: 13px;
    color: #9e9eb8;
    line-height: 1.5;
}

.owf-inline-payment-note.owf-inline-payment-note--error {
    color: #ef4444;
}

.owf-inline-payment-note.owf-inline-payment-note--success {
    color: #10b981;
}

/* --------------------------------------------------------------------------
   11. Total
   -------------------------------------------------------------------------- */

.owf-form-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #2a2a2a;
    border: none;
    border-radius: 8px;
    margin: 24px 0;
}

.owf-form-total span {
    font-size: 16px;
    font-weight: 600;
    color: #ccc;
}

.owf-form-total strong {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

/* --------------------------------------------------------------------------
   12. Checkbox / CGV
   -------------------------------------------------------------------------- */

.owf-form-checkbox {
    margin-bottom: 20px;
}

.owf-form-checkbox label {
    display: inline !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #ccc !important;
    line-height: 1.7;
    cursor: pointer;
}

.owf-form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #E63946;
    vertical-align: middle;
    margin-right: 8px;
    cursor: pointer;
}

.owf-form-checkbox a {
    color: #E63946;
    text-decoration: underline;
}

.owf-form-checkbox a:hover {
    color: #ff6b6b;
}

/* --------------------------------------------------------------------------
   13. Submit Button
   -------------------------------------------------------------------------- */

.owf-form-submit {
    margin-top: 8px;
}

.owf-btn-submit {
    display: block;
    width: 100%;
    padding: 16px 24px;
    background: #E63946;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    font-family: inherit;
}

.owf-btn-submit:hover {
    background: #C62828;
}

.owf-btn-submit:active {
    transform: scale(0.98);
}

.owf-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* --------------------------------------------------------------------------
   14. Error Message
   -------------------------------------------------------------------------- */

.owf-form-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   15. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .owf-form-row {
        grid-template-columns: 1fr;
    }

    .owf-form-group--full {
        grid-column: span 1;
    }

    .owf-detection-meta {
        flex-direction: column;
        gap: 8px;
    }

    .owf-form-total {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .owf-inscription-wrapper {
        padding: 0 4px;
    }

    .owf-inscription-form input[type="text"],
    .owf-inscription-form input[type="email"],
    .owf-inscription-form input[type="tel"],
    .owf-inscription-form input[type="date"],
    .owf-inscription-form select,
    .owf-inscription-form textarea {
        padding: 10px 14px;
        font-size: 14px;
    }

    .owf-btn-submit {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* ==========================================================================
   Contact Form
   ========================================================================== */

.owf-contact-wrapper {
    max-width: 100%;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.owf-contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.owf-contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.owf-contact-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.owf-contact-field--full {
    grid-column: 1 / -1;
}

.owf-contact-field label {
    font-size: 13px;
    font-weight: 600;
    color: #cccccc;
}

.owf-contact-form input,
.owf-contact-form textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    color: #ffffff;
    background: #1B1B1D;
    border: 1px solid #333333;
    border-radius: 8px;
    transition: border-color 0.2s;
    line-height: 1.5;
}

.owf-contact-form input:focus,
.owf-contact-form textarea:focus {
    outline: none;
    border-color: #AA1A1A;
    box-shadow: 0 0 0 3px rgba(170, 26, 26, 0.15);
}

.owf-contact-form input::placeholder,
.owf-contact-form textarea::placeholder {
    color: #555;
}

.owf-contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.owf-contact-submit {
    margin-top: 8px;
}

.owf-contact-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: #1AAA43;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.owf-contact-btn:hover {
    background: #158f38;
    transform: translateY(-1px);
}

.owf-contact-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.owf-contact-error {
    padding: 12px 16px;
    background: rgba(170, 26, 26, 0.1);
    border: 1px solid rgba(170, 26, 26, 0.3);
    border-radius: 8px;
    color: #AA1A1A;
    font-size: 14px;
    margin-top: 8px;
}

.owf-contact-success {
    text-align: center;
    padding: 40px 20px;
}

.owf-contact-success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* ==========================================================================
   International Telephone Input
   ========================================================================== */

.iti {
    width: 100%;
}

.iti input {
    padding-left: 50px !important;
}

.owf-inscription-form .iti input,
.owf-contact-form .iti input {
    padding-left: 50px !important;
}

.iti__country-container {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-right: none;
    border-radius: 8px 0 0 8px;
}

.iti__selected-country {
    background-color: #2a2a2a;
    border-radius: 8px 0 0 8px;
}

.iti__selected-country:hover {
    background-color: #3a3a3a;
}

.iti__country-list {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.iti__country-list-item {
    color: #ffffff;
}

.iti__country-list-item:hover {
    background-color: #3a3a3a;
}

.iti__country-list-item--highlighted {
    background-color: #E63946;
    color: #ffffff;
}

.iti__dial-code {
    color: #9e9eb8;
}

.iti__arrow {
    border-top-color: #9e9eb8;
}

.iti__arrow--up {
    border-bottom-color: #9e9eb8;
}

/* Contact form specific */
.owf-contact-form .iti {
    margin-bottom: 0;
}

.owf-contact-form .iti__country-container {
    background-color: #ffffff;
    border-color: #ddd;
}

.owf-contact-form .iti__selected-country {
    background-color: #ffffff;
}

.owf-contact-form .iti__selected-country:hover {
    background-color: #f5f5f5;
}

.owf-contact-form .iti__country-list {
    background-color: #ffffff;
    border-color: #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.owf-contact-form .iti__country-list-item {
    color: #333;
}

.owf-contact-form .iti__country-list-item:hover {
    background-color: #f5f5f5;
}

.owf-contact-form .iti__country-list-item--highlighted {
    background-color: #E63946;
    color: #ffffff;
}

.owf-contact-form .iti__dial-code {
    color: #666;
}

.owf-contact-form .iti__arrow {
    border-top-color: #666;
}

.owf-contact-form .iti__arrow--up {
    border-bottom-color: #666;
}

.owf-contact-success h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1AAA43;
    margin: 0 0 8px;
}

.owf-contact-success p {
    font-size: 15px;
    color: #aaa;
    margin: 0;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .owf-contact-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Flatpickr Dark Theme Override
   ========================================================================== */

.flatpickr-calendar {
    background: #1B1B1D !important;
    border: 1px solid #333 !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
    border-radius: 10px !important;
    font-family: system-ui, -apple-system, sans-serif !important;
}

.flatpickr-months {
    background: #111 !important;
    border-radius: 10px 10px 0 0 !important;
}

.flatpickr-months .flatpickr-month {
    color: #fff !important;
    fill: #fff !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: #fff !important;
    background: transparent !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: #1B1B1D !important;
    color: #fff !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: #fff !important;
    fill: #fff !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: #AA1A1A !important;
    fill: #AA1A1A !important;
}

/* Mois / année courants + spinners haut-bas : blancs et visibles sur fond sombre */
.flatpickr-current-month,
.flatpickr-current-month span.cur-month {
    color: #fff !important;
}

.flatpickr-calendar .numInputWrapper span {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.flatpickr-calendar .numInputWrapper span:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

.flatpickr-calendar .numInputWrapper span.arrowUp:after {
    border-bottom-color: #fff !important;
}

.flatpickr-calendar .numInputWrapper span.arrowDown:after {
    border-top-color: #fff !important;
}

span.flatpickr-weekday {
    color: #888 !important;
    font-weight: 600 !important;
    font-size: 11px !important;
}

.flatpickr-day {
    color: #ccc !important;
    border-radius: 6px !important;
}

.flatpickr-day:hover {
    background: #333 !important;
    border-color: #333 !important;
    color: #fff !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #AA1A1A !important;
    border-color: #AA1A1A !important;
    color: #fff !important;
}

.flatpickr-day.today {
    border-color: #1AAA43 !important;
}

.flatpickr-day.today:hover {
    background: #1AAA43 !important;
    color: #fff !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #444 !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #555 !important;
}

.flatpickr-input[readonly] {
    cursor: pointer !important;
}

/* Alt input styling */
.flatpickr-input.flatpickr-mobile,
input.flatpickr-input + .form-control,
.owf-inscription-form input.flatpickr-input {
    cursor: pointer !important;
}

/* ==========================================================================
   Detection Info Block (auto mode)
   ========================================================================== */

.owf-det-info-block {
    margin: 0 0 28px;
    padding: 20px 24px;
    background: #111111;
    border: 1px solid #222222;
    border-radius: 12px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.owf-det-info-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.owf-det-info-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    border-radius: 4px;
}

.owf-det-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.owf-det-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #cccccc;
}

.owf-det-info-item svg {
    flex-shrink: 0;
    color: #888888;
}

.owf-det-info-item span {
    line-height: 1.4;
}

@media (max-width: 600px) {
    .owf-det-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Geo Restriction Notice
   ========================================================================== */

.owf-restriction-notice {
    margin: 32px 0;
    padding: 32px;
    background: #111111;
    border: 1px solid #222222;
    border-radius: 12px;
    text-align: center;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.owf-restriction-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.owf-restriction-notice h3 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px;
}

.owf-restriction-notice p {
    font-size: 14px;
    color: #aaaaaa;
    line-height: 1.6;
    margin: 0 0 8px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.owf-restriction-notice h4 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 28px 0 16px;
}

.owf-restriction-alternatives {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    text-align: left;
    margin-top: 16px;
}

.owf-restriction-alt-card {
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s, border-color 0.2s;
}

.owf-restriction-alt-card:hover {
    transform: translateY(-2px);
    border-color: #1AAA43;
}

.owf-restriction-alt-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.owf-restriction-alt-info {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.owf-restriction-alt-info strong {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.owf-restriction-alt-info span {
    font-size: 12px;
    color: #888888;
}

@media (max-width: 480px) {
    .owf-restriction-alternatives {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────────────────────────────────────────────────────
   Geo hide (client-side) : anti-FOUC pour cards détections
   Voir assets/js/public/owf-geo-hide.js
   ───────────────────────────────────────────────────────────────── */

/* Cards marquées comme bloquées par filtre géo côté client.
   Note : on n'utilise PAS visibility:hidden en anti-FOUC pour éviter tout
   risque de layout collé si le JS ne tourne pas. Trade-off : les cards
   restreintes peuvent flasher très brièvement (~200-500ms) avant d'être
   masquées par le JS. Layout stable en toutes circonstances. */
.owf-geo-blocked {
    display: none !important;
}

/* ─────────────────────────────────────────────────────────────────
   Emojis WordPress (img.emoji) : force la taille standard 1em.
   WordPress convertit les emojis unicode (📅 📍 🎯 …) en <img>
   pointant vers s.w.org/images/core/emoji/…svg. Le CSS normalement
   injecté par wp_head peut être supprimé par des plugins de perf
   (WP Rocket, Disable Emojis, Autoptimize…), auquel cas les
   emojis s'affichent à leur taille native (72px+) et cassent le
   layout des descriptions détection. On re-applique la règle ici
   pour garantir un rendu correct quel que soit le contexte.
   ───────────────────────────────────────────────────────────────── */
img.emoji,
img.wp-smiley {
    display: inline !important;
    height: 1em !important;
    width: 1em !important;
    margin: 0 .07em !important;
    vertical-align: -0.1em !important;
    background: none !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important; /* Neutralise le border-radius: 50% de certains thèmes (WoodMart) qui découpe les emojis en cercle */
    box-shadow: none !important;
    object-fit: contain !important;
    clip-path: none !important;
}
