/* =========================================================
   TIR CLASSEMENT - PAGE PUBLIQUE
   Style moderne / mobile / simple
   ========================================================= */

:root{
    --tc-bg: #f3f6fb;
    --tc-surface: #ffffff;
    --tc-surface-soft: #f8fbff;

    --tc-border: #d9e3f0;
    --tc-border-strong: #c4d3e6;

    --tc-text: #163047;
    --tc-text-soft: #5f7388;
    --tc-text-muted: #7d8fa3;

    --tc-primary: #1f5f99;
    --tc-primary-hover: #184d7d;
    --tc-primary-soft: #eaf3fb;

    --tc-success: #1f7a3f;
    --tc-success-bg: #eaf8ef;
    --tc-success-border: #b9dfc4;

    --tc-error: #b42318;
    --tc-error-bg: #fdeeee;
    --tc-error-border: #f1b8b1;

    --tc-shadow: 0 10px 28px rgba(20, 48, 71, 0.10);
    --tc-radius: 18px;
    --tc-radius-sm: 12px;
}

/* Base */
.tc-public-wrapper,
.tc-public-wrapper *{
    box-sizing: border-box;
}

.tc-public-wrapper{
    max-width: 760px;
    margin: 20px auto;
    padding: 18px;
    background: linear-gradient(180deg, #f9fbfe 0%, #f3f6fb 100%);
    border: 1px solid var(--tc-border);
    border-radius: 24px;
    box-shadow: var(--tc-shadow);
    color: var(--tc-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.tc-public-wrapper h2{
    margin: 0 0 18px;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--tc-text);
}

.tc-public-wrapper h3{
    margin: 22px 0 12px;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--tc-text);
}

/* Messages simples */
.tc-public-wrapper > p{
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--tc-primary-soft);
    border: 1px solid var(--tc-border);
    color: var(--tc-text);
}

/* Formulaires */
.tc-form{
    margin: 0 0 18px;
    padding: 18px;
    background: var(--tc-surface);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    box-shadow: 0 4px 16px rgba(20, 48, 71, 0.05);
}

.tc-field{
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.tc-field:last-child{
    margin-bottom: 0;
}

.tc-field label{
    font-size: 14px;
    font-weight: 700;
    color: var(--tc-text);
}

.tc-field input[type="text"],
.tc-field input[type="number"],
.tc-field select{
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    border: 1px solid var(--tc-border-strong);
    border-radius: 14px;
    background: #fff;
    color: var(--tc-text);
    font-size: 16px;
    line-height: 1.2;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    appearance: none;
}

.tc-field input::placeholder{
    color: var(--tc-text-muted);
}

.tc-field input[type="text"]:focus,
.tc-field input[type="number"]:focus,
.tc-field select:focus{
    border-color: var(--tc-primary);
    box-shadow: 0 0 0 4px rgba(31, 95, 153, 0.12);
    transform: translateY(-1px);
}

/* Actions */
.tc-actions{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tc-actions button{
    min-height: 50px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: var(--tc-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    box-shadow: 0 8px 18px rgba(31, 95, 153, 0.18);
}

.tc-actions button:hover{
    background: var(--tc-primary-hover);
    transform: translateY(-1px);
}

.tc-actions button:active{
    transform: translateY(0);
}

.tc-actions button#tc-stop-scanner{
    background: #6b7280;
    box-shadow: 0 8px 18px rgba(107, 114, 128, 0.18);
}

.tc-actions button#tc-stop-scanner:hover{
    background: #4b5563;
}

/* Carte du tireur sélectionné */
.tc-selected-user{
    margin: 0 0 18px;
    padding: 16px 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--tc-border);
    border-left: 6px solid var(--tc-primary);
    border-radius: var(--tc-radius);
    box-shadow: 0 4px 14px rgba(20, 48, 71, 0.05);
}

.tc-selected-user p{
    margin: 0 0 8px;
    color: var(--tc-text);
    font-size: 15px;
}

.tc-selected-user p:last-child{
    margin-bottom: 0;
}

.tc-selected-user strong{
    color: var(--tc-text);
}

/* Scanner QR */
#tc-scanner-wrapper{
    margin-top: 14px;
    padding: 14px;
    background: var(--tc-surface-soft);
    border: 1px dashed var(--tc-border-strong);
    border-radius: var(--tc-radius-sm);
}

#tc-qr-reader{
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
}

#tc-qr-reader video{
    border-radius: 14px;
}

#tc-scan-status{
    margin: 12px 0 0;
    font-size: 14px;
    color: var(--tc-text-soft);
}

/* Petits ajustements pour le select */
.tc-form-select select{
    background-image:
        linear-gradient(45deg, transparent 50%, var(--tc-text-soft) 50%),
        linear-gradient(135deg, var(--tc-text-soft) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 42px;
}

/* Bouton principal du formulaire résultat */
.tc-form-resultat .tc-actions button{
    min-width: 180px;
}

/* Tablette */
@media (max-width: 900px){
    .tc-public-wrapper{
        margin: 14px;
        padding: 16px;
        border-radius: 20px;
    }

    .tc-public-wrapper h2{
        font-size: 24px;
    }

    .tc-public-wrapper h3{
        font-size: 18px;
    }
}

/* Mobile */
@media (max-width: 640px){
    .tc-public-wrapper{
        margin: 10px;
        padding: 14px;
        border-radius: 18px;
    }

    .tc-form{
        padding: 14px;
        border-radius: 16px;
    }

    .tc-field input[type="text"],
    .tc-field input[type="number"],
    .tc-field select{
        min-height: 50px;
        font-size: 16px; /* évite le zoom iPhone */
        padding: 13px 14px;
        border-radius: 12px;
    }

    .tc-actions{
        flex-direction: column;
    }

    .tc-actions button{
        width: 100%;
        min-height: 52px;
        border-radius: 12px;
    }

    .tc-public-wrapper h2{
        font-size: 22px;
    }

    .tc-public-wrapper h3{
        font-size: 17px;
    }

    .tc-selected-user{
        padding: 14px;
        border-radius: 14px;
    }
}

/* Très petit mobile */
@media (max-width: 400px){
    .tc-public-wrapper{
        margin: 8px;
        padding: 12px;
    }

    .tc-form{
        padding: 12px;
    }

    .tc-public-wrapper h2{
        font-size: 20px;
    }
}
#tc-message{
    margin-bottom: 14px;
}

.tc-notice{
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--tc-border);
    background: var(--tc-primary-soft);
    color: var(--tc-text);
}

.tc-notice-success{
    background: var(--tc-success-bg);
    border-color: var(--tc-success-border);
    color: var(--tc-success);
}

.tc-notice-error{
    background: var(--tc-error-bg);
    border-color: var(--tc-error-border);
    color: var(--tc-error);
}

.tc-search-results{
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tc-search-item{
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    padding: 14px 16px;
    border: 1px solid var(--tc-border);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.tc-search-item:hover{
    transform: translateY(-1px);
    border-color: var(--tc-primary);
    box-shadow: 0 8px 18px rgba(31, 95, 153, 0.10);
}

.tc-search-name{
    font-size: 15px;
    font-weight: 700;
    color: var(--tc-text);
}

.tc-search-avs{
    font-size: 13px;
    color: var(--tc-text-soft);
}

.tc-search-empty{
    padding: 12px 14px;
    border: 1px dashed var(--tc-border-strong);
    border-radius: 12px;
    background: var(--tc-surface-soft);
    color: var(--tc-text-soft);
}