/* ============================================================
   TenAgile Team Health Radar — Styles
   Focused pulse check: single-column, no sidebar, fast flow
   ============================================================ */

/* --- Reset & Variables --- */
.thr *,
.thr *::before,
.thr *::after {
    box-sizing: border-box;
}

.thr {
    --teal: #0891b2;
    --teal-dark: #0e7490;
    --teal-light: #cffafe;
    --slate: #334155;
    --slate-dark: #1e293b;
    --slate-light: #64748b;
    --cream: #faf8f3;
    --white: #ffffff;
    --border: #e2e8f0;
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --error: #dc2626;
    --error-light: #fef2f2;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);

    /* Score colors */
    --score-critical: #dc2626;
    --score-warning: #d97706;
    --score-good: #0891b2;
    --score-excellent: #059669;

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--slate);
    max-width: 980px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ============================================================
   WIZARD STEP CARD
   ============================================================ */

.thr-step-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 3.5rem 3rem;
    box-shadow: var(--shadow);
    animation: thr-slideIn 0.3s ease;
}

@keyframes thr-slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.thr-step-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--slate-dark);
    margin: 0 0 3rem 0;
}

.thr-step-subtitle {
    font-size: 1.5rem;
    color: var(--slate-light);
    margin: 0 0 2rem 0;
}

.thr-step-desc {
    font-size: 2.0rem;
    color: var(--slate);
    margin: 0 0 3rem 0;
    font-style: italic;
    line-height: 1.6;
}

/* Force min font size across all thr elements */
.thr, .thr * {
    font-size: inherit;
}
.thr .thr-step-desc {
    font-size: 2.0rem !important;
}
.thr .thr-recommendation-action {
    font-size: 1.5rem !important;
}
.thr .thr-recommendation-link {
    font-size: 1.5rem !important;
}
.thr .thr-breakdown-name {
    font-size: 1.5rem !important;
}
.thr .thr-field label,
.thr .thr-membership label,
.thr .thr-step-subtitle,
.thr .thr-progress-header span,
.thr .thr-nav-back,
.thr .thr-insight-text,
.thr .thr-recommendation-action,
.thr .thr-share-section p {
    font-size: 1.5rem !important;
}

/* ============================================================
   PROGRESS BAR (wizard)
   ============================================================ */

.thr-progress {
    margin-bottom: 2rem;
}

.thr-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--slate-light);
}

.thr-progress-track {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.thr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--teal), var(--teal-dark));
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ============================================================
   NAVIGATION (wizard)
   ============================================================ */

.thr-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2.5rem;
}

.thr-nav-back {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--slate-light);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.thr-nav-back:hover {
    color: var(--slate-dark);
    background: var(--cream);
}

.thr-nav-next {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    border: none;
    border-radius: 50px;
    padding: 0.85rem 2.5rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 4px 16px rgba(8, 145, 178, 0.3);
}

.thr-nav-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(8, 145, 178, 0.4);
}

.thr-nav-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   EMAIL FIELDS (wizard step 1)
   ============================================================ */

.thr-email-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .thr-email-fields { grid-template-columns: 1fr; }
}

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

.thr-req { color: var(--error); }

.thr-field label {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--slate-dark);
    display: block;
    margin-bottom: 0.3rem;
}

.thr-field label .thr-required {
    color: var(--error);
}

.thr-field input {
    font-size: 1.3rem;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--slate);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.thr-field input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

.thr-field input::placeholder {
    color: #94a3b8;
}

/* Dimension cards — now handled by step-card in wizard */

/* Likert Scale — Pill Buttons */
.thr-rating-guide {
    margin: 0 0 3rem 0;
    padding: 1.5rem 2rem;
    background: var(--cream);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.thr-rating-row {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.6rem 0;
    font-size: 1.5rem;
}

.thr-rating-label {
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.thr-rating-hint {
    font-size: 1.5rem;
    color: var(--slate-light);
}

.thr-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    margin: 0 0 3rem 0;
}

.thr-pill {
    padding: 0.9rem 1.6rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.thr-pill:hover {
    background: rgba(0, 0, 0, 0.02);
    transform: translateY(-1px);
}

.thr-pill.selected {
    background: var(--slate-dark);
    color: var(--white) !important;
    border-color: var(--slate-dark) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 500px) {
    .thr-pills {
        flex-direction: column;
    }
    .thr-pill {
        text-align: center;
    }
}

/* ============================================================
   MEMBERSHIP CHECKBOX
   ============================================================ */

.thr-membership {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--cream);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.thr-membership input[type="checkbox"] {
    width: 1.3rem;
    height: 1.3rem;
    margin-top: 0.2rem;
    accent-color: var(--teal);
    flex-shrink: 0;
}

.thr-membership label {
    font-size: 1.3rem;
    color: var(--slate);
    cursor: pointer;
    line-height: 1.5;
}

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */

.thr-submit-wrapper {
    text-align: center;
    margin-bottom: 2rem;
}

.thr-submit-btn {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    border: none;
    border-radius: 50px;
    padding: 1rem 3rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 4px 16px rgba(8, 145, 178, 0.3);
}

.thr-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(8, 145, 178, 0.4);
}

.thr-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   LOADING STATE
   ============================================================ */

.thr-loading {
    display: none;
    text-align: center;
    padding: 4rem 2rem;
    animation: thr-fadeIn 0.3s ease;
}

.thr-loading.active {
    display: block;
}

.thr-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: thr-spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.thr-loading p {
    font-size: 1.3rem;
    color: var(--slate-light);
}

/* ============================================================
   ERROR STATE
   ============================================================ */

.thr-error {
    display: none;
    text-align: center;
    padding: 2rem;
    background: var(--error-light);
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.thr-error.active {
    display: block;
}

.thr-error p {
    color: var(--error);
    font-size: 1.3rem;
    margin: 0 0 1rem 0;
}

.thr-retry-btn {
    font-size: 1.2rem;
    padding: 0.6rem 1.5rem;
    background: var(--error);
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.thr-retry-btn:hover {
    opacity: 0.85;
}

/* ============================================================
   RESULTS
   ============================================================ */

.thr-results {
    display: none;
    animation: thr-fadeIn 0.6s ease;
}

.thr-results.active {
    display: block;
}

@keyframes thr-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Overall Score Hero --- */
.thr-results-hero {
    background: linear-gradient(135deg, var(--slate-dark) 0%, var(--slate) 100%);
    color: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 2rem;
}

.thr-results-hero h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.thr-overall-score {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0.5rem 0;
}

.thr-overall-label {
    font-size: 1.2rem;
    opacity: 0.85;
    margin: 0;
}

.thr-status-badge {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
}

.thr-status-badge--excellent {
    background: rgba(5, 150, 105, 0.2);
    border: 1px solid rgba(5, 150, 105, 0.4);
    color: #6ee7b7;
}

.thr-status-badge--good {
    background: rgba(8, 145, 178, 0.2);
    border: 1px solid rgba(8, 145, 178, 0.4);
    color: var(--teal-light);
}

.thr-status-badge--warning {
    background: rgba(217, 119, 6, 0.2);
    border: 1px solid rgba(217, 119, 6, 0.4);
    color: #fde68a;
}

.thr-status-badge--critical {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #fca5a5;
}

/* --- Radar Chart --- */
.thr-radar-section {
    margin-bottom: 2rem;
}

.thr-radar-container {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.thr-radar-canvas {
    max-width: 100%;
    max-height: 400px;
    margin: 0 auto;
    display: block;
}

/* --- Dimension Breakdown --- */
.thr-breakdown-section {
    margin-bottom: 2rem;
}

.thr-breakdown-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--slate-dark);
    margin: 0 0 1.25rem 0;
}

.thr-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.thr-breakdown-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.thr-breakdown-info {
    flex: 1;
}

.thr-breakdown-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--slate-dark);
    margin: 0 0 0.4rem 0;
}

.thr-breakdown-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.thr-breakdown-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.thr-breakdown-fill--critical { background: var(--score-critical); }
.thr-breakdown-fill--warning { background: var(--score-warning); }
.thr-breakdown-fill--good { background: var(--score-good); }
.thr-breakdown-fill--excellent { background: var(--score-excellent); }

.thr-breakdown-score {
    font-size: 1.4rem;
    font-weight: 700;
    min-width: 2.5rem;
    text-align: center;
}

.thr-breakdown-score--critical { color: var(--score-critical); }
.thr-breakdown-score--warning { color: var(--score-warning); }
.thr-breakdown-score--good { color: var(--score-good); }
.thr-breakdown-score--excellent { color: var(--score-excellent); }

.thr-breakdown-status {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    white-space: nowrap;
}

.thr-breakdown-status--critical {
    background: var(--error-light);
    color: var(--score-critical);
}

.thr-breakdown-status--warning {
    background: var(--warning-light);
    color: var(--score-warning);
}

.thr-breakdown-status--good {
    background: var(--teal-light);
    color: var(--teal-dark);
}

.thr-breakdown-status--excellent {
    background: var(--success-light);
    color: var(--score-excellent);
}

/* --- Insights --- */
.thr-insights-section {
    margin-bottom: 2rem;
}

.thr-insights-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--slate-dark);
    margin: 0 0 1.25rem 0;
}

.thr-insights-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.thr-insight-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.thr-insight-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.thr-insight-item:first-child {
    padding-top: 0;
}

.thr-insight-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.2rem;
    font-size: 1rem;
}

.thr-insight-text {
    font-size: 1.2rem;
    color: var(--slate);
    margin: 0;
    line-height: 1.5;
}

/* --- Recommendations --- */
.thr-recommendations-section {
    margin-bottom: 2rem;
}

.thr-recommendations-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--slate-dark);
    margin: 0 0 1.25rem 0;
}

.thr-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.thr-recommendation-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.thr-recommendation-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.thr-recommendation-priority {
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
}

.thr-recommendation-priority--urgent {
    background: linear-gradient(135deg, var(--error) 0%, #991b1b 100%);
}

.thr-recommendation-content {
    flex: 1;
}

.thr-recommendation-action {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--slate-dark);
    margin: 0 0 0.3rem 0;
}

.thr-recommendation-link {
    font-size: 1.5rem;
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
}

.thr-recommendation-link:hover {
    text-decoration: underline;
}

.thr-recommendation-detail {
    font-size: 1.35rem;
    line-height: 1.7;
    color: var(--slate);
    margin-top: 0.6rem;
    padding: 1rem 1.2rem;
    background: rgba(8, 145, 178, 0.04);
    border-radius: 8px;
    border-left: 3px solid var(--teal);
}

/* --- Recommendations Narrative Block --- */
.thr-recommendations-narrative {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.thr-rec-block {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.thr-rec-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.thr-rec-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.thr-rec-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
}

.thr-rec-priority-label {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.thr-rec-priority-label--1 {
    color: var(--error, #dc2626);
}

.thr-rec-priority-label--2 {
    color: var(--teal-dark);
}

.thr-rec-priority-label--3 {
    color: var(--slate-light, #64748b);
}

.thr-rec-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--slate);
    margin: 0.4rem 0 0.6rem 0;
    line-height: 1.4;
}

.thr-rec-detail {
    font-size: 1.35rem;
    line-height: 1.8;
    color: #475569;
    margin: 0;
}

/* --- Share Section --- */
.thr-share-section {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
    margin-bottom: 2rem;
}

.thr-share-section h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--slate-dark);
    margin: 0 0 0.5rem 0;
}

.thr-share-section p {
    font-size: 1.1rem;
    color: var(--slate-light);
    margin: 0;
}

/* --- Actions --- */
.thr-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.thr-print-btn {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--teal);
    background: var(--white);
    border: 2px solid var(--teal);
    border-radius: 50px;
    padding: 0.75rem 2rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.thr-print-btn:hover {
    background: var(--teal);
    color: var(--white);
}

.thr-restart-btn {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--slate-light);
    background: none;
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: 0.75rem 2rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.thr-restart-btn:hover {
    border-color: var(--slate-light);
    color: var(--slate);
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    .thr {
        max-width: 100%;
        padding: 0;
    }

    .thr-banner,
    .thr-intro,
    .thr-form-section,
    .thr-dimensions,
    .thr-membership,
    .thr-submit-wrapper,
    .thr-loading,
    .thr-error,
    .thr-actions,
    .thr-share-section {
        display: none !important;
    }

    .thr-results {
        display: block !important;
    }

    .thr-results-hero {
        background: var(--slate-dark) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .thr-radar-container,
    .thr-breakdown-item,
    .thr-insights-card,
    .thr-recommendation-card {
        break-inside: avoid;
        box-shadow: none;
    }

    .thr-recommendation-priority {
        background: var(--teal) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
    .thr {
        padding: 0 0.5rem;
    }

    .thr-banner {
        padding: 2rem 1.5rem;
    }

    .thr-banner h1 {
        font-size: 1.6rem;
    }

    .thr-dimension-card {
        padding: 1.25rem;
    }

    .thr-likert-btn {
        width: 2.6rem;
        height: 2.6rem;
        font-size: 1.1rem;
    }

    .thr-breakdown-item {
        flex-wrap: wrap;
    }

    .thr-breakdown-status {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }

    .thr-results-hero {
        padding: 2rem 1.5rem;
    }

    .thr-overall-score {
        font-size: 2.8rem;
    }

    .thr-form-card {
        padding: 1.5rem;
    }

    .thr-recommendation-card {
        padding: 1rem 1.25rem;
    }
}
