/* ========================================
   Tracking Pronto Soccorso - CSS
   Mobile-first, responsive
   ======================================== */

/* === Layout base === */
.tps-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.tps-section {
    animation: tpsFadeIn 0.3s ease-in;
}

@keyframes tpsFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Card === */
.tps-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.tps-card-body {
    padding: 24px;
}

/* === Titoli === */
.tps-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0;
}

.tps-subtitle {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.5;
}

/* === Login Card === */
.tps-login-card {
    margin-top: 20px;
}

.tps-otp-input {
    font-size: 1.8rem !important;
    letter-spacing: 0.5em;
    font-weight: 700;
    font-family: "SF Mono", "Fira Code", monospace;
    text-transform: uppercase;
}

.tps-otp-input::placeholder {
    letter-spacing: 0.3em;
    font-size: 1.4rem;
    color: #ccc;
}

/* === Form controls === */
.tps-container .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.tps-container .form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
}

/* === Bottoni === */
.tps-container .btn-primary {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.2s;
}

.tps-container .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}

.tps-container .btn-primary:active {
    transform: translateY(0);
}

.tps-container .btn-outline-danger {
    border-radius: 12px;
    font-weight: 600;
}

.tps-container .btn-outline-secondary {
    border-radius: 12px;
    font-weight: 600;
}

/* === Info box === */
.tps-info-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid #0d6efd;
}

.tps-info-mini {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 12px;
}

/* === Badge Triage === */
.tps-triage-badge {
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.tps-triage-badge.triage-bianco {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.tps-triage-badge.triage-verde {
    background: #d1e7dd;
    color: #0f5132;
}

.tps-triage-badge.triage-azzurro {
    background: #cff4fc;
    color: #055160;
}

.tps-triage-badge.triage-arancione {
    background: #fff3cd;
    color: #664d03;
}

.tps-triage-badge.triage-rosso {
    background: #f8d7da;
    color: #842029;
}

.tps-triage-badge.triage-sconosciuto {
    background: #e2e3e5;
    color: #41464b;
}

/* === Patient Header === */
.tps-patient-header {
    background: linear-gradient(135deg, #f8f9ff, #fff);
    border-left: 5px solid #0d6efd;
}

/* === Prestazione Card === */
.tps-prestazione {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.tps-prestazione:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tps-prestazione-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.tps-prestazione-desc {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 0.95rem;
    flex: 1;
}

.tps-prestazione-risorsa {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 4px;
}

.tps-prestazione-data {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 6px;
}

/* === Stato prestazione === */
.tps-stato {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.tps-stato-richiesto {
    background: #fff3cd;
    color: #664d03;
}

.tps-stato-erogato {
    background: #cff4fc;
    color: #055160;
}

.tps-stato-refertato {
    background: #d1e7dd;
    color: #0f5132;
}

.tps-stato-eseguita {
    background: #d1e7dd;
    color: #0f5132;
}

/* === Feedback === */
.tps-feedback-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 20px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    background: #fff;
    transition: all 0.2s;
    flex: 1;
}

.tps-feedback-btn i {
    font-size: 1.8rem;
}

.tps-feedback-btn small {
    font-size: 0.75rem;
    font-weight: 600;
}

.tps-feedback-btn:hover,
.tps-feedback-btn.active {
    border-color: #0d6efd;
    background: #f0f4ff;
    color: #0d6efd;
}

.tps-feedback-btn[data-tipo="positivo"].active {
    border-color: #198754;
    background: #d1e7dd;
    color: #0f5132;
}

.tps-feedback-btn[data-tipo="negativo"].active {
    border-color: #dc3545;
    background: #f8d7da;
    color: #842029;
}

/* === Privacy text === */
.tps-privacy-text {
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.tps-privacy-text h5,
.tps-privacy-text h6 {
    color: #1a1a2e;
}

/* === Responsive === */
@media (max-width: 576px) {
    .tps-container {
        padding: 12px;
    }

    .tps-card-body {
        padding: 20px 16px;
    }

    .tps-title {
        font-size: 1.2rem;
    }

    .tps-otp-input {
        font-size: 1.5rem !important;
        letter-spacing: 0.4em;
    }

    .tps-feedback-btn {
        padding: 10px 14px;
    }

    .tps-feedback-btn i {
        font-size: 1.5rem;
    }
}

/* === Auto-refresh indicator === */
.tps-auto-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tps-auto-refresh .tps-dot {
    width: 6px;
    height: 6px;
    background: #198754;
    border-radius: 50%;
    animation: tpsPulse 2s infinite;
}

@keyframes tpsPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
