/* TH Tyre Calculator — CSS v1.0 */

.thtc-wrap {
    font-family: 'Open Sans', sans-serif;
    color: #2C2C2C;
}

.thtc-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #1A1A1A;
    margin: 0 0 8px;
}

.thtc-subtitle {
    font-size: .9rem;
    color: #666;
    line-height: 1.6;
    margin: 0 0 20px;
}

/* ── Caja principal ── */
.thtc-box {
    background: #fff;
    border: 1px solid #E2E2E0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Grid de inputs ── */
.thtc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px 12px;
    align-items: center;
}

.thtc-col-head {
    font-family: 'Oswald', sans-serif;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: #999;
    text-align: center;
    padding-bottom: 4px;
    border-bottom: 2px solid #E2E2E0;
}

.thtc-label {
    font-size: .82rem;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}
.thtc-label-result {
    color: #999;
    font-weight: 400;
    font-style: italic;
}
.thtc-unit {
    font-weight: 400;
    color: #AAA;
    font-size: .78rem;
}

/* ── Inputs ── */
.thtc-input,
.thtc-result-input {
    width: 100%;
    padding: 9px 10px;
    border: 1.5px solid #E2E2E0;
    font-family: 'Open Sans', sans-serif;
    font-size: .875rem;
    color: #2C2C2C;
    background: #fff;
    text-align: center;
    transition: border-color .15s;
    appearance: textfield;
    -moz-appearance: textfield;
}
.thtc-input::-webkit-outer-spin-button,
.thtc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.thtc-input:focus {
    outline: none;
    border-color: #C91C1C;
}
.thtc-input.error { border-color: #C91C1C; background: #fff5f5; }

.thtc-result-input {
    background: #F5F5F3;
    color: #666;
    cursor: default;
    font-size: .82rem;
}

/* ── Botón ── */
.thtc-btn {
    font-family: 'Oswald', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    background: #C91C1C;
    color: #fff;
    border: none;
    padding: 13px 28px;
    cursor: pointer;
    width: 100%;
    transition: background .18s, transform .12s;
}
.thtc-btn:hover  { background: #A01515; }
.thtc-btn:active { transform: scale(.98); }

/* ── Resultado ── */
.thtc-output {
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: thtc-fadein .3s ease;
}
@keyframes thtc-fadein { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

.thtc-output-row {
    display: flex;
    gap: 16px;
}

.thtc-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: #F5F5F3;
    padding: 12px 16px;
    border-left: 3px solid #E2E2E0;
}
.thtc-stat-label {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #999;
}
.thtc-stat-val {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1;
}

/* ── Badge de nivel ── */
.thtc-badge {
    padding: 11px 18px;
    font-family: 'Oswald', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-align: center;
    transition: background .3s, color .3s;
}

/* ── Barra de progreso ── */
.thtc-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.thtc-bar-track {
    position: relative;
    height: 8px;
    background: #F0F0EE;
    overflow: visible;
}
.thtc-bar-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0;
    transition: width .5s cubic-bezier(.4,0,.2,1), background .3s;
    background: #22c55e;
}
.thtc-bar-limit {
    position: absolute;
    top: -4px; bottom: -4px;
    width: 2px;
    background: #C91C1C;
    opacity: .6;
}
.thtc-bar-limit::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #C91C1C;
    opacity: .7;
}
.thtc-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: .7rem;
    color: #AAA;
}

/* ── Botón leyenda ── */
.thtc-legend-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    font-size: .78rem;
    color: #999;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .15s;
}
.thtc-legend-btn:hover { color: #C91C1C; }

/* ── Overlay lightbox ── */
.thtc-legend-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: thtc-fadein .22s ease;
}
.thtc-legend-overlay img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.thtc-legend-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.thtc-legend-close:hover { background: rgba(255,255,255,.3); }

/* ── Nota al pie ── */
.thtc-nota {
    font-size: .78rem;
    color: #999;
    line-height: 1.5;
    border-top: 1px solid #F0F0EE;
    padding-top: 14px;
    margin: 0;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .thtc-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px 8px;
    }
    .thtc-box { padding: 16px; }
    .thtc-label { font-size: .75rem; }
    .thtc-output-row { flex-direction: column; gap: 8px; }
}
@media (max-width: 360px) {
    .thtc-grid { grid-template-columns: auto 1fr 1fr; }
}
