/*
 * Moodle Perú — Configurador v0.15.3
 * Paleta: Azul #0A2463 · Naranja #FF8C00
 */

/* CRÍTICO: [hidden] siempre oculta, incluso dentro de un grid */
.mpc [hidden] { display: none !important; }

.mpc {
    --mpc-accent:     #0A2463;
    --mpc-accent2:    #FF8C00;
    --mpc-ink:        #1F2937;
    --mpc-muted:      #6B7280;
    --mpc-line:       #E5E7EB;
    --mpc-surface:    #ffffff;
    --mpc-soft:       #F9FAFB;
    --mpc-good:       #0f7b4b;
    --mpc-bad:        #b42318;
    --mpc-radius:     12px;

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--mpc-ink);
    font-size: 16px;
    line-height: 1.5;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
}

.mpc *, .mpc *::before, .mpc *::after { box-sizing: inherit; }
.mpc button { font: inherit; color: inherit; cursor: pointer; border: none; }
.mpc :focus-visible { outline: 3px solid var(--mpc-accent2); outline-offset: 2px; }

/* ── Selector de moneda ── */
.mpc-toolbar {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.mpc-currency {
    display: inline-flex;
    padding: 4px;
    background: #fff;
    border: 2px solid var(--mpc-accent);
    border-radius: 999px;
    gap: 4px;
}

.mpc-currency button {
    border: 0;
    background: transparent;
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mpc-accent);
    transition: background .2s, color .2s;
}

.mpc-currency button[aria-pressed="true"] {
    background: var(--mpc-accent);
    color: #fff;
}

.mpc-currency button:hover:not([aria-pressed="true"]) { background: #f0f4ff; }

/* ── Tabs de categoría ── */
.mpc-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.mpc-tabs__btn {
    padding: 8px 20px;
    border: 1.5px solid var(--mpc-line);
    border-radius: 999px;
    background: var(--mpc-surface);
    color: var(--mpc-muted);
    font-size: 14px;
    font-weight: 600;
    transition: border-color .15s, color .15s, background .15s;
}

.mpc-tabs__btn:hover { border-color: var(--mpc-accent); color: var(--mpc-accent); }

.mpc-tabs__btn.is-active {
    border-color: var(--mpc-accent);
    background: var(--mpc-accent);
    color: #fff;
}

/* ══════════════════════════════════════════════════════
   TARJETAS DE PLAN — selector estilo profesional
   Layout: [ícono] [nombre + precio] [○]
   Fila completa, sin texto cortado
══════════════════════════════════════════════════════ */
.mpc-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.mpc-plan-grid[aria-busy="true"] { min-height: 100px; opacity: .6; }

.mpc-plan-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--mpc-surface);
    border: 1.5px solid var(--mpc-line);
    border-radius: var(--mpc-radius);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    width: 100%;
}

.mpc-plan-card:hover {
    border-color: var(--mpc-accent);
    box-shadow: 0 4px 14px rgba(10,36,99,.1);
}

.mpc-plan-card.is-selected {
    border-color: var(--mpc-accent2);
    background: #FFF8F0;
    box-shadow: 0 0 0 2px rgba(255,140,0,.25);
}

.mpc-plan-card__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: var(--mpc-soft);
    border-radius: 10px;
    font-size: 22px;
    line-height: 1;
}

.mpc-plan-card.is-selected .mpc-plan-card__icon { background: rgba(255,140,0,.12); }

.mpc-plan-card__body {
    flex: 1;
    min-width: 0;
}

/* SIN text-overflow: ellipsis — nombres completos */
.mpc-plan-card__name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--mpc-accent);
    line-height: 1.25;
    word-break: break-word;
}

.mpc-plan-card__price {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--mpc-accent2);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.mpc-plan-card__price small {
    font-size: 11px;
    font-weight: 400;
    color: var(--mpc-muted);
    margin-left: 1px;
}

.mpc-plan-card__check {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--mpc-line);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    color: transparent;
    transition: all .15s;
}

.mpc-plan-card.is-selected .mpc-plan-card__check {
    background: var(--mpc-accent2);
    border-color: var(--mpc-accent2);
    color: #fff;
}

/* ══════════════════════════════════════════════════════
   DETALLE DEL PLAN SELECCIONADO
   Aparece DEBAJO de las tarjetas al elegir un plan
══════════════════════════════════════════════════════ */
.mpc-plan-detail {
    margin-top: 16px;
    border: 2px solid var(--mpc-accent2);
    border-radius: var(--mpc-radius);
    background: linear-gradient(135deg, #fff 0%, #FFF8F0 100%);
    animation: mpc-reveal .2s ease;
    overflow: hidden;
}

@keyframes mpc-reveal {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mpc-plan-detail__inner { padding: 18px 20px; }

.mpc-plan-detail__header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.mpc-plan-detail__icon { font-size: 26px; line-height: 1; }

.mpc-plan-detail__name {
    font-size: 17px;
    font-weight: 800;
    color: var(--mpc-accent);
    flex: 1;
}

.mpc-plan-detail__price {
    font-size: 18px;
    font-weight: 800;
    color: var(--mpc-accent2);
    white-space: nowrap;
}

.mpc-plan-detail__price small {
    font-size: 12px;
    font-weight: 400;
    color: var(--mpc-muted);
}

.mpc-plan-detail__label {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--mpc-accent);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Lista de características ── */
.mpc-feat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 6px 20px;
}

.mpc-feat-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: var(--mpc-ink);
    padding: 3px 0;
}

.mpc-feat__ico {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    color: var(--mpc-accent2);
    font-weight: 700;
    margin-top: 1px;
}

.mpc-feat__ico--emoji { font-size: 15px; }

/* ── Landing page: planes completos ── */
.mpc-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.mpc-plans[aria-busy="true"] { min-height: 160px; opacity: 0.6; }

.mpc-plan {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    padding: 28px 22px;
    background: var(--mpc-surface);
    border: 2px solid var(--mpc-line);
    border-radius: var(--mpc-radius);
    transition: border-color .2s, box-shadow .2s, transform .2s;
    position: relative;
    overflow: hidden;
}

.mpc-plan::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--mpc-line);
    transition: background .2s;
}

.mpc-plan__tier {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #fff;
    background: var(--mpc-accent);
    padding: 3px 12px;
    border-radius: 999px;
    align-self: flex-start;
    margin-bottom: 4px;
}

.mpc-plan__name { display: block; margin: 0; font-size: 20px; font-weight: 700; color: var(--mpc-accent); }
.mpc-plan__desc { margin: 0; color: var(--mpc-muted); font-size: 14px; }

.mpc-plan__price { display: block; margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.mpc-plan__price strong { font-size: 32px; font-weight: 800; color: var(--mpc-accent2); }
.mpc-plan__price span  { color: var(--mpc-muted); font-size: 13px; margin-left: 2px; }

/* ── Botones ── */
.mpc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 12px 22px;
    border: 0;
    border-radius: 8px;
    background: var(--mpc-accent);
    color: #fff !important;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none !important;
    text-align: center;
    transition: background .2s, transform .15s;
}

.mpc-btn:hover { background: #1E40AF; transform: translateY(-1px); }
.mpc-btn:disabled { opacity: 0.6; cursor: progress; }

/* ── Pasos ── */
.mpc-step { margin-bottom: 36px; }

.mpc-step__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 700;
    color: var(--mpc-accent);
}

.mpc-step__title span {
    display: inline-grid;
    place-items: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--mpc-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

.mpc-subtitle { margin: 24px 0 10px; font-size: 16px; font-weight: 600; color: var(--mpc-accent); }
.mpc-hint, .mpc-rate { margin: 0 0 12px; color: var(--mpc-muted); font-size: 14px; }

.mpc-included {
    padding: 16px 20px;
    background: var(--mpc-soft);
    border-radius: var(--mpc-radius);
    border-left: 3px solid var(--mpc-accent2);
    margin-bottom: 20px;
}

.mpc-included h4 { margin: 0 0 8px; font-size: 15px; color: var(--mpc-accent); }
.mpc-included ul { margin: 0; padding-left: 20px; columns: 2 220px; }

/* ── Paquetes ── */
.mpc-bundles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }

.mpc-bundle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    padding: 18px;
    background: var(--mpc-surface);
    border: 2px dashed var(--mpc-line);
    border-radius: var(--mpc-radius);
    transition: border-color .2s;
}

.mpc-bundle:hover { border-color: var(--mpc-accent); }
.mpc-bundle[aria-pressed="true"] { border-style: solid; border-color: var(--mpc-accent2); box-shadow: 0 0 0 2px rgba(255,140,0,.2); }
.mpc-bundle__icon { font-size: 24px; }
.mpc-bundle__name { font-weight: 700; color: var(--mpc-accent); }
.mpc-bundle__desc { color: var(--mpc-muted); font-size: 14px; }
.mpc-bundle__price s, .mpc-svc__price s { color: var(--mpc-muted); font-weight: 400; }

/* ── Servicios ── */
.mpc-svcs { display: grid; gap: 10px; }

.mpc-svc {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 14px 16px;
    background: var(--mpc-surface);
    border: 1px solid var(--mpc-line);
    border-radius: var(--mpc-radius);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.mpc-svc:hover { border-color: var(--mpc-accent); }
.mpc-svc:has(input:checked) { border-color: var(--mpc-accent2); background: #FFF8F0; }
.mpc-svc input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--mpc-accent2); }
.mpc-svc__body { display: flex; flex-direction: column; gap: 2px; }
.mpc-svc__name { font-weight: 600; color: var(--mpc-accent); }
.mpc-svc__desc { color: var(--mpc-muted); font-size: 14px; }
.mpc-svc__price { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--mpc-accent2); }
.mpc-svc__price small { display: block; color: var(--mpc-muted); font-size: 12px; }

.mpc-badge {
    align-self: flex-start;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #DCFCE7;
    color: var(--mpc-good);
    font-size: 12px;
    font-weight: 600;
}

/* ── Resumen (panel azul) ── */
.mpc-summary {
    padding: 22px;
    background: var(--mpc-accent);
    color: #fff;
    border-radius: var(--mpc-radius);
    box-shadow: 0 8px 30px rgba(10,36,99,.2);
}

/* is-loading no debe mostrar un panel vacío — el panel está hidden mientras carga */
.mpc-summary.is-loading { opacity: 0.7; }

.mpc-summary__title { margin: 0 0 14px; font-size: 18px; font-weight: 700; color: #fff; }

.mpc-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,.15);
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    color: rgba(255,255,255,.85);
}

.mpc-row em { color: var(--mpc-accent2); font-style: normal; font-size: 13px; }
.mpc-row--total { border-bottom: 0; padding-top: 14px; font-size: 22px; font-weight: 800; color: #fff; }

.mpc-summary .mpc-btn {
    width: 100%;
    margin-top: 16px;
    background: var(--mpc-accent2);
    font-size: 16px;
    padding: 14px;
}

.mpc-summary .mpc-btn:hover { background: #E67E00; }

/* ── Escritorio: columna lateral para el resumen ── */
@media (min-width: 960px) {
    .mpc[data-widget="configurator"] {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 300px;
        column-gap: 32px;
        align-items: start;
    }
    /* Toolbar y pasos van a columna 1 */
    .mpc[data-widget="configurator"] > .mpc-toolbar { grid-column: 1; }
    .mpc[data-widget="configurator"] > .mpc-step   { grid-column: 1; }

    /* Resumen: columna 2, sticky — solo cuando NO está hidden */
    .mpc[data-widget="configurator"] > .mpc-summary:not([hidden]) {
        grid-column: 2;
        grid-row: 1 / span 4;
        position: sticky;
        top: 24px;
    }
}

/* ── Estados ── */
.mpc-error  { color: var(--mpc-bad); font-weight: 500; }
.mpc-empty, .mpc-loading { color: var(--mpc-muted); }

/* ── Mobile ── */
@media (max-width: 600px) {
    .mpc-svc { grid-template-columns: auto 1fr; }
    .mpc-svc__price { grid-column: 2; text-align: left; }
    .mpc-plan-card__name { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .mpc * { transition: none !important; animation: none !important; }
}

/* ══════════════════════════════════════════════════════
   PLAN SELECCIONADO — igual al diseño de la landing
══════════════════════════════════════════════════════ */

.mpc-plan-detail { margin-top: 20px; animation: mpc-reveal .22s ease; }

.mpc-selected-plan {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 28px 24px;
    background: var(--mpc-surface);
    border: 2px solid var(--mpc-line);
    border-top: 4px solid var(--mpc-accent2);
    border-radius: var(--mpc-radius);
    box-shadow: 0 4px 20px rgba(10,36,99,.08);
    position: relative;
}

/* Badge seleccionado arriba al centro */
.mpc-selected-plan__badge {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: var(--mpc-accent2);
    margin: 0 auto 8px;
}

.mpc-selected-plan__name {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--mpc-accent);
    text-align: center;
}

/* Precio estilo landing — símbolo pequeño + número grande + /mes pequeño */
.mpc-selected-plan__price {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    margin: 4px 0 8px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--mpc-accent2);
}

.mpc-selected-plan__price sup {
    font-size: 18px;
    font-weight: 700;
    color: var(--mpc-accent2);
    margin-top: 8px;
}

.mpc-selected-plan__price strong {
    font-size: 52px;
    font-weight: 800;
    color: var(--mpc-accent2);
    line-height: 1;
}

/* small para /mes */
.mpc-selected-plan__price small {
    font-size: 14px;
    font-weight: 400;
    color: var(--mpc-muted);
    align-self: flex-end;
    margin-bottom: 8px;
    margin-left: 2px;
}

/* compatibilidad: span también como /mes */
.mpc-selected-plan__price span {
    font-size: 14px;
    color: var(--mpc-muted);
    align-self: flex-end;
    margin-bottom: 6px;
    margin-left: 2px;
}

/* Lista de características dentro del plan seleccionado */
.mpc-selected-plan .mpc-feat-list {
    grid-template-columns: 1fr;  /* una sola columna */
    gap: 0;
}

.mpc-selected-plan .mpc-feat-list li {
    padding: 9px 12px;
    border-bottom: 1px solid var(--mpc-line);
    font-size: 15px;
    background: var(--mpc-surface);
}

.mpc-selected-plan .mpc-feat-list li:first-child {
    border-top: 1px solid var(--mpc-line);
}

.mpc-selected-plan .mpc-feat__ico { color: var(--mpc-accent2); }
