/* Shared styles for the diagnostic/Radiografía pages
   (RadiografiaStatus.razor and DiagnosticResults.razor). */

.rg-wrap {
    max-width: 1240px;          /* iguala al contenedor del panel de resultados (.rg2-root) */
    margin: 2rem auto;
    padding: 0 16px;
    font-family: 'Inter', system-ui, sans-serif;
}

.rg-center {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.rg-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    min-height: 420px;
    max-width: 680px;            /* estados None/InProgress: tarjeta angosta centrada aunque .rg-wrap sea ancho */
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.rg-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* INITIAL / INCOMPLETE shared */
.rg-state-centered {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.rg-icon-container { margin-bottom: 16px; }

.rg-large-icon {
    font-size: 56px;
    display: block;
    animation: rg-float 3s ease-in-out infinite;
}

@keyframes rg-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.rg-state-centered h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
    color: #0f172a;
}

.rg-state-centered > p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 20px;
}

.rg-small-text {
    font-size: 12px;
    margin-top: 10px;
    margin-bottom: 0;
    color: #94a3b8;
}

/* INCOMPLETE ring */
.rg-progress-ring {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 0;
    border: 4px solid #fbbf24;
}

.rg-progress-value {
    font-size: 26px;
    font-weight: 900;
    color: #92400e;
}

/* STEPS */
.rg-steps {
    background: #dcfce7;
    border-radius: 12px;
    padding: 18px;
}

.rg-steps h4 {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #166534;
}

.rg-steps ol { margin: 0; padding-left: 20px; }
.rg-steps li { font-size: 13px; font-weight: 600; color: #15803d; padding: 4px 0; line-height: 1.5; }

/* SUGGESTIONS */
.rg-suggestions {
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    border-radius: 12px;
    padding: 18px;
}

.rg-suggestions h4 {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #0369a1;
}

.rg-suggestions ul { list-style: none; margin: 0; padding: 0; }
.rg-suggestions li {
    font-size: 13px;
    font-weight: 600;
    color: #0c4a6e;
    padding: 8px 0 8px 24px;
    position: relative;
    line-height: 1.5;
    border-bottom: 1px solid #e0f2fe;
}
.rg-suggestions li:last-child { border-bottom: none; }
.rg-suggestions li::before { content: "💡"; position: absolute; left: 0; }

/* BUTTONS */
.rg-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.rg-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3); }

.rg-btn.secondary { background: linear-gradient(135deg, #f59e0b, #d97706); }
.rg-btn.secondary:hover { box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3); }

.rg-btn.outlined { background: white; color: #4f46e5; border: 2px solid #e2e8f0; }
.rg-btn.outlined:hover { background: #f8fafc; border-color: #4f46e5; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15); }

.rg-btn-link {
    background: none;
    border: none;
    color: #64748b;
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    padding: 8px;
    margin-top: 2px;
}
.rg-btn-link:hover { color: #4f46e5; }

.rg-arrow { font-size: 16px; font-weight: 900; }

@media (max-width: 640px) {
    .rg-large-icon { font-size: 48px; }
}

/* ============================================================
   RESULTS PAGE — mockup-faithful layout (DiagnosticResults.razor)
   ============================================================ */
.rg-result-card { text-align: center; gap: 0; }

.rg-result-card > * + * { margin-top: 24px; }

/* Page header */
.rg-page-header { text-align: center; }

.rg-page-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.2;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rg-page-header p {
    color: #64748b;
    font-size: 15px;
    margin: 0;
}

/* Progress line (divider under header — full at results) */
.rg-progress-line {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.rg-progress-line-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
}

/* Hero */
.rg-hero { margin-bottom: 0; }

.rg-stage-emoji {
    font-size: 80px;
    line-height: 1;
    margin-bottom: 16px;
}

.rg-stage-name {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.2;
}

.rg-stage-desc {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

/* Score card */
.rg-score-card {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #bae6fd;
    border-radius: 12px;
    padding: 20px;
}

.rg-score-title {
    font-size: 13px;
    font-weight: 700;
    color: #0369a1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.rg-score-value {
    font-size: 48px;
    font-weight: 900;
    color: #0284c7;
    line-height: 1;
}

/* Issues (warning bullet list — not interactive checkboxes) */
.rg-issues {
    background: #fef3c7;
    border: 2px solid #fde047;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
}

.rg-issues h3 {
    font-size: 16px;
    font-weight: 800;
    color: #854d0e;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rg-issues ul { list-style: none; padding: 0; margin: 0; }

.rg-issues li {
    font-size: 14px;
    font-weight: 600;
    color: #713f12;
    padding: 8px 0 8px 24px;
    position: relative;
    border-bottom: 1px solid #fde68a;
    line-height: 1.5;
}

.rg-issues li:last-child { border-bottom: none; }
.rg-issues li::before { content: "⚠️"; position: absolute; left: 0; }
.rg-issues li.critical { color: #7f1d1d; }
.rg-issues li.critical::before { content: "🚨"; }

/* Re-align reused boxes left inside the centered result card */
.rg-result-card .rg-suggestions,
.rg-result-card .rg-steps { text-align: left; }

@media (max-width: 640px) {
    .rg-page-header h1 { font-size: 24px; }
    .rg-page-header p { font-size: 14px; }
    .rg-stage-emoji { font-size: 64px; }
    .rg-stage-name { font-size: 26px; }
    .rg-stage-desc { font-size: 15px; }
    .rg-score-card { padding: 16px; }
    .rg-score-value { font-size: 40px; }
    .rg-issues { padding: 16px; }
    .rg-issues h3 { font-size: 15px; }
    .rg-issues li { font-size: 13px; }
}

/* ════════════════════════════════════════════════════════════════════
   RESULTS PAGE v2 — port del mockup v1.9.14 (clases rg2-, scope .rg2-root)
   Compartido por /radiografia y /diagnostic-results
   ════════════════════════════════════════════════════════════════════ */
.rg2-root {
    --e1: #E24B4A; --e2: #EF9F27; --e3: #378ADD; --e4: #1D9E75; --e5: #7F77DD;
    --rg2-blue: #155EEF; --rg2-navy: #0F172A; --rg2-gray: #64748B;
    --rg2-border: #E2E8F0; --rg2-white: #fff;
    --rg2-head: 'Space Grotesk', system-ui, sans-serif;
    --rg2-body: 'Sora', system-ui, sans-serif;
    max-width: 1240px;
    margin: 0 auto;
    font-family: var(--rg2-body);
    color: var(--rg2-navy);
    line-height: 1.6;
}
.rg2-root *, .rg2-root *::before, .rg2-root *::after { box-sizing: border-box; }

/* ── HERO: intro + escalera ── */
.rg2-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: stretch; margin-bottom: 14px; }
.rg2-hero-left,
.rg2-ladder-wrap {
    background: var(--rg2-white); border: 1.5px solid var(--rg2-border);
    border-radius: 20px; padding: 1.2rem;
}
.rg2-hero-left { padding: 1.75rem; display: flex; flex-direction: column; justify-content: center; }
.rg2-eyebrow {
    display: inline-flex; align-items: center; gap: 6px; width: fit-content;
    font-family: var(--rg2-head); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; color: var(--rg2-blue);
    background: #EEF4FF; padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}
.rg2-hero-title {
    font-family: var(--rg2-head); font-size: 32px; font-weight: 700;
    color: var(--rg2-navy); line-height: 1.12; margin: 0 0 12px;
}
.rg2-lede { font-size: 14px; color: var(--rg2-gray); line-height: 1.6; margin: 0; }
.rg2-ladder-wrap { text-align: center; }
.rg2-ladder-title { font-size: 13px; color: var(--rg2-gray); margin-bottom: 1rem; }
.rg2-ladder { display: flex; align-items: flex-end; justify-content: center; gap: 16px; height: 260px; max-width: 560px; margin: 0 auto; }
.rg2-ladder-step {
    position: relative; flex: 1; max-width: 104px; min-width: 80px;
    border-radius: 12px 12px 0 0; display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 12px; opacity: .22; transition: transform .2s, opacity .2s;
}
.rg2-ladder-step.rg2-current { box-shadow: 0 0 0 3px #fff, 0 0 0 5px currentColor; transform: translateY(-4px); opacity: 1; }
.rg2-ladder-label {
    font-family: var(--rg2-head); font-size: 12px; font-weight: 700; color: #fff;
    letter-spacing: .01em; line-height: 1.3; text-align: center; padding: 0 4px; white-space: nowrap;
}
.rg2-ladder-num {
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    width: 30px; height: 30px; border-radius: 50%;
    background: #fff; border: 2px solid currentColor;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--rg2-head); font-size: 11px; font-weight: 700; color: var(--rg2-navy);
}
.rg2-ladder-step.rg2-current .rg2-ladder-num { background: var(--rg2-navy); border-color: var(--rg2-navy); color: #fff; }
.rg2-ls1 { height: 120px; background: var(--e1); color: var(--e1); }
.rg2-ls2 { height: 156px; background: var(--e2); color: var(--e2); }
.rg2-ls3 { height: 192px; background: var(--e3); color: var(--e3); }
.rg2-ls4 { height: 224px; background: var(--e4); color: var(--e4); }
.rg2-ls5 { height: 260px; background: var(--e5); color: var(--e5); }
.rg2-ladder-base { max-width: 540px; margin: 14px auto 0; height: 2px; background: var(--rg2-border); border-radius: 2px; }

/* ── TOP ROW: stage card + retake ── */
.rg2-top-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; align-items: stretch; }
.rg2-stage-card {
    border-radius: 20px; padding: 1.5rem; border: 1.5px solid;
    display: flex; flex-direction: column; gap: 1.1rem;
    position: relative; overflow: hidden;
}
.rg2-stage-card::after {
    content: ''; position: absolute; right: -30px; top: -30px;
    width: 160px; height: 160px; border-radius: 50%;
    background: currentColor; opacity: .06; pointer-events: none;
}
.rg2-stage-card-top { display: flex; align-items: center; gap: 1.1rem; }
.rg2-stage-icon-wrap {
    width: 60px; height: 60px; border-radius: 18px;
    background: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.6);
    display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.rg2-stage-info { flex: 1; min-width: 0; }
.rg2-stage-eyebrow { font-family: var(--rg2-head); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .7; margin-bottom: 4px; }
.rg2-stage-name { font-family: var(--rg2-head); font-size: 21px; font-weight: 700; }
.rg2-stage-big-pct { margin-left: auto; font-family: var(--rg2-head); font-size: 44px; font-weight: 700; line-height: 1; flex-shrink: 0; }
.rg2-stage-desc { font-size: 13px; opacity: .85; line-height: 1.5; }
.rg2-stage-bottom { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; border-top: 1px solid rgba(0,0,0,.08); }
.rg2-stage-pct-label { font-size: 11px; font-weight: 600; letter-spacing: .02em; opacity: .75; }
.rg2-bar-track { flex: 1; max-width: 140px; height: 6px; border-radius: 999px; background: rgba(0,0,0,.08); overflow: hidden; }
.rg2-bar-fill { height: 100%; border-radius: 999px; background: currentColor; opacity: .85; transition: width .5s ease; }

.rg2-retake-banner {
    background: linear-gradient(145deg, #1B3FCF 0%, #155EEF 55%, #3B7AFF 100%);
    border-radius: 18px; padding: 1.25rem 1.4rem;
    display: flex; flex-direction: column; justify-content: space-between; gap: 1rem;
    position: relative; overflow: hidden;
}
.rg2-retake-banner::after {
    content: ''; position: absolute; left: -40px; bottom: -50px;
    width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none;
}
.rg2-retake-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: var(--rg2-head); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: #fff; background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 999px; width: fit-content;
}
.rg2-retake-title { font-family: var(--rg2-head); font-size: 20px; font-weight: 700; color: #fff; margin: 8px 0 4px; line-height: 1.2; }
.rg2-retake-sub { font-size: 13px; color: rgba(255,255,255,.8); line-height: 1.5; }
.rg2-retake-btn {
    font-family: var(--rg2-head); font-size: 13.5px; font-weight: 700; color: var(--rg2-blue);
    background: #fff; border: none; border-radius: 12px; padding: 12px 16px; cursor: pointer;
    width: 100%; box-shadow: 0 4px 14px rgba(0,0,0,.18); transition: transform .15s, box-shadow .15s;
}
.rg2-retake-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.22); }

/* ── DOS COLUMNAS ── */
.rg2-three-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; align-items: stretch; }
.rg2-card {
    background: var(--rg2-white); border: 1.5px solid var(--rg2-border);
    border-radius: 16px; padding: 1.1rem 1.35rem; display: flex; flex-direction: column;
}
.rg2-card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 1rem; }
.rg2-card-icon { font-size: 18px; }
.rg2-card-head h2 { font-family: var(--rg2-head); font-size: 14px; font-weight: 700; color: var(--rg2-navy); margin: 0; }
.rg2-item-list { list-style: none; flex: 1; margin: 0; padding: 0; }
.rg2-item {
    display: flex; align-items: flex-start; gap: 10px; padding: 10px 0;
    border-bottom: 1px solid var(--rg2-border); font-size: 13px; line-height: 1.5; color: var(--rg2-navy);
}
.rg2-item:last-child { border-bottom: none; padding-bottom: 0; }
.rg2-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.rg2-dot-critical { background: var(--e1); }
.rg2-dot-warn { background: var(--e2); }
.rg2-dot-info { background: var(--rg2-blue); }
.rg2-empty-note { font-size: 13px; color: var(--rg2-gray); display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.rg2-en-ok { color: var(--e4); font-weight: 700; }
.rg2-en-muted { color: var(--rg2-gray); }

/* ── STEPS ── */
.rg2-steps-card { background: #0F2A6B; border-radius: 20px; padding: 1.5rem; border: 1.5px solid #1A3A8A; margin-bottom: 14px; }
.rg2-steps-head { display: flex; align-items: center; gap: 9px; margin-bottom: 1rem; }
.rg2-steps-icon { font-size: 18px; }
.rg2-steps-head h2 { font-family: var(--rg2-head); font-size: 15px; font-weight: 700; color: #fff; margin: 0; }
.rg2-steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.rg2-step { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 1rem; display: flex; flex-direction: column; gap: 9px; }
.rg2-step-num {
    width: 26px; height: 26px; border-radius: 50%; background: var(--rg2-blue); color: #fff;
    font-family: var(--rg2-head); font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rg2-step-num.rg2-urgent { background: var(--e1); }
.rg2-step-text { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,.85); flex: 1; }
.rg2-step-link {
    font-family: var(--rg2-body); font-size: 12px; font-weight: 600; color: #fff;
    background: var(--rg2-blue); border: none; border-radius: 9px; padding: 7px 12px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px; width: fit-content; text-decoration: none; transition: opacity .15s;
}
.rg2-step-link:hover { opacity: .82; color: #fff; text-decoration: none; }
.rg2-step-link.rg2-urgent { background: var(--e1); }

/* ── FOOTER (CTA por página) ── */
.rg2-footer { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 18px; }
.rg2-cta-btn {
    font-family: var(--rg2-head); font-size: 15px; font-weight: 700; color: #fff;
    background: linear-gradient(145deg, #1B3FCF 0%, #155EEF 55%, #3B7AFF 100%);
    border: none; border-radius: 14px; padding: 14px 28px; cursor: pointer; min-width: 280px;
    box-shadow: 0 4px 14px rgba(21,94,239,.28); transition: transform .15s, box-shadow .15s;
}
.rg2-cta-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(21,94,239,.34); }
.rg2-cta-outlined { background: #fff; color: var(--rg2-blue); border: 2px solid var(--rg2-blue); box-shadow: none; }
.rg2-cta-link { background: none; border: none; color: var(--rg2-blue); font-family: var(--rg2-body); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .rg2-hero { grid-template-columns: 1fr; gap: 1.25rem; }
    .rg2-ladder { height: 220px; }
    .rg2-ls1 { height: 100px; } .rg2-ls2 { height: 132px; } .rg2-ls3 { height: 163px; } .rg2-ls4 { height: 190px; } .rg2-ls5 { height: 220px; }
}
@media (max-width: 720px) {
    .rg2-hero-title { font-size: 26px; }
    .rg2-top-row { grid-template-columns: 1fr; }
    .rg2-three-col { grid-template-columns: 1fr; }
    .rg2-stage-big-pct { font-size: 32px; }
    .rg2-steps-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}
@media (max-width: 480px) {
    .rg2-steps-grid { grid-template-columns: 1fr; }
    .rg2-stage-name { font-size: 17px; }
    .rg2-ladder-label { font-size: 9px; }
    .rg2-ladder-num { width: 22px; height: 22px; font-size: 9px; }
}
