/* ════════════════════════════════════════════════════════════
   CALCULADORA PRIMA DE SERVICIOS — prima.css
   Diseño: azul consistente con el sitio + acentos verdes en resultados
   Mobile-first · Chips de acceso rápido · Micro-animaciones
   ════════════════════════════════════════════════════════════ */

/* ── Tokens ───────────────────────────────────────────────── */
:root {
    --azul:        #1d4ed8;
    --azul-dark:   #1e3a5f;
    --azul-mid:    #2563eb;
    --azul-light:  #dbeafe;
    --verde:       #059669;
    --verde-light: #d1fae5;
    --gris-50:     #f9fafb;
    --gris-100:    #f3f4f6;
    --gris-200:    #e5e7eb;
    --gris-400:    #9ca3af;
    --gris-600:    #4b5563;
    --gris-700:    #374151;
    --gris-900:    #111827;
    --radius-sm:   8px;
    --radius-md:   14px;
    --radius-lg:   20px;
    --shadow-sm:   0 2px 8px rgba(0,0,0,.06);
    --shadow-md:   0 4px 20px rgba(0,0,0,.09);
}

/* ── Hero — AZUL (consistente con el sitio) ───────────────── */
.prima-hero {
    background: linear-gradient(135deg, var(--azul-dark) 0%, #1e40af 55%, var(--azul-mid) 100%);
    color: white;
    padding: 36px 20px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Textura sutil de fondo */
.prima-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 0%, rgba(255,255,255,.07) 0%, transparent 60%);
    pointer-events: none;
}

.prima-hero-inner {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

/* Badge countdown */
.prima-countdown {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 99px;
    padding: 6px 16px;
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: .02em;
}

.cd-pulse {
    width: 8px; height: 8px;
    background: #34d399;
    border-radius: 50%;
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .5; transform: scale(.7); }
}

.prima-hero h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.2;
}

.prima-hero p {
    font-size: .97rem;
    opacity: .88;
    line-height: 1.6;
    margin-bottom: 18px;
}

.hero-chips-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.h-chip {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 99px;
    padding: 4px 13px;
    font-size: .78rem;
    font-weight: 700;
}

.hide-mobile { display: inline; }

/* ── Vertical nav laboral ─────────────────────────────────── */
.laboral-nav {
    background: var(--azul-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
}

.ln-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #1e40af;
    display: block;
    margin-bottom: 10px;
}

.ln-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.laboral-nav a {
    font-size: .78rem;
    font-weight: 600;
    color: #1d4ed8;
    background: white;
    border: 1px solid #bfdbfe;
    border-radius: 99px;
    padding: 5px 13px;
    text-decoration: none;
    transition: all .18s;
    white-space: nowrap;
}

.laboral-nav a:hover { background: var(--azul); color: white; border-color: var(--azul); }
.laboral-nav a.ln-active { background: var(--azul); color: white; border-color: var(--azul); }

/* ── Form cards ───────────────────────────────────────────── */
.form-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gris-200);
    margin-bottom: 16px;
    transition: box-shadow .2s;
}

.form-card:focus-within { box-shadow: 0 0 0 3px rgba(29,78,216,.1), var(--shadow-sm); }

/* Step label */
.step-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gris-600);
    margin-bottom: 14px;
}

.step-num {
    width: 22px; height: 22px;
    background: var(--azul);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* ── Modo tabs ────────────────────────────────────────────── */
.modo-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.modo-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 14px 6px;
    background: var(--gris-50);
    border: 2px solid var(--gris-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .18s;
    text-align: center;
    min-height: 80px;
    justify-content: center;
}

.modo-tab:hover {
    border-color: var(--azul-mid);
    background: var(--azul-light);
    transform: translateY(-1px);
}

.modo-tab.active {
    border-color: var(--azul);
    background: var(--azul-light);
    box-shadow: 0 0 0 3px rgba(29,78,216,.15);
}

.mt-icon  { font-size: 1.4rem; }
.mt-title { font-size: .82rem; font-weight: 700; color: var(--gris-900); }
.mt-sub   { font-size: .7rem; color: var(--gris-400); }

/* ── Salary quick chips ───────────────────────────────────── */
.quick-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.qc-hint {
    font-size: .73rem;
    color: var(--gris-400);
    font-weight: 600;
    white-space: nowrap;
}

.q-chip {
    background: var(--azul-light);
    color: var(--azul);
    border: 1px solid #bfdbfe;
    border-radius: 99px;
    padding: 5px 12px;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.q-chip:hover       { background: var(--azul); color: white; border-color: var(--azul); transform: translateY(-1px); }
.q-chip.chip-active { background: var(--azul); color: white; border-color: var(--azul); }

/* ── Salary input ─────────────────────────────────────────── */
.salary-input-wrap {
    display: flex;
    align-items: center;
    background: var(--gris-50);
    border: 2px solid var(--gris-200);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    transition: all .2s;
    margin-bottom: 6px;
}

.salary-input-wrap:focus-within {
    border-color: var(--azul);
    background: white;
    box-shadow: 0 0 0 3px rgba(29,78,216,.1);
}

.sip {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--azul);
    margin-right: 6px;
    user-select: none;
}

.salary-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gris-900);
    padding: 14px 0;
    outline: none;
    font-family: 'Courier New', monospace;
    min-width: 0;
}

.salary-input::placeholder { color: var(--gris-200); font-weight: 400; }

/* Auxilio pill */
.auxilio-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--verde-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 99px;
    padding: 5px 13px;
    font-size: .78rem;
    font-weight: 700;
    margin: 8px 0;
    animation: slideIn .2s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aux-select-wrap { margin-top: 10px; }
.aux-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gris-200);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 600;
    color: var(--gris-700);
    background: white;
    cursor: pointer;
    transition: border-color .2s;
}
.aux-select:focus { outline: none; border-color: var(--azul); }

/* ── Semestre tabs ────────────────────────────────────────── */
.sem-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sem-tab {
    padding: 14px;
    background: var(--gris-50);
    border: 2px solid var(--gris-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .18s;
    text-align: left;
}

.sem-tab:hover { border-color: var(--azul-mid); background: var(--azul-light); }
.sem-tab.active { border-color: var(--azul); background: var(--azul-light); box-shadow: 0 0 0 3px rgba(29,78,216,.12); }

.sem-tab-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.sem-num { font-size: 1.3rem; font-weight: 800; color: var(--gris-900); }
.sem-pay-date { font-size: .72rem; font-weight: 700; color: var(--verde); background: var(--verde-light); border-radius: 99px; padding: 2px 8px; }
.sem-period { font-size: .78rem; color: var(--gris-600); }

.field-label { font-size: .85rem; font-weight: 600; color: var(--gris-700); margin-bottom: 6px; display: block; }
.date-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gris-200);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-weight: 600;
    color: var(--gris-900);
    transition: border-color .2s;
    box-sizing: border-box;
}
.date-input:focus { outline: none; border-color: var(--azul); }

/* ── Campos comunes ───────────────────────────────────────── */
.field-hint { font-size: .76rem; color: var(--gris-400); margin-top: 4px; }
.field-err  { font-size: .78rem; color: #dc2626; margin-top: 4px; min-height: 16px; }

/* ── Live preview ─────────────────────────────────────────── */
.prima-preview {
    background: linear-gradient(135deg, var(--azul-dark) 0%, var(--azul-mid) 100%);
    border-radius: var(--radius-md);
    padding: 22px 20px;
    color: white;
    text-align: center;
    margin: 16px 0;
    transition: opacity .25s, transform .25s;
}

.prima-preview.hidden { opacity: .3; transform: scale(.98); }

.pv-label  { font-size: .82rem; opacity: .8; margin-bottom: 4px; }
.pv-amount { font-size: 2.4rem; font-weight: 900; font-family: 'Courier New', monospace; margin-bottom: 4px; }
.pv-meta   { font-size: .8rem; opacity: .85; }
.pv-detail { font-size: .74rem; opacity: .65; margin-top: 6px; }

/* ── Botones ──────────────────────────────────────────────── */
.btn-calcular {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--azul-mid) 0%, var(--azul-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(29,78,216,.3);
    transition: all .2s;
    margin-bottom: 10px;
}

.btn-calcular:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(29,78,216,.4); }
.btn-calcular:active { transform: translateY(0); }

.btn-limpiar {
    width: 100%;
    padding: 12px;
    background: white;
    color: var(--gris-600);
    border: 2px solid var(--gris-200);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    margin-bottom: 14px;
}
.btn-limpiar:hover { background: var(--gris-50); border-color: var(--gris-400); }

/* Data strip */
.datos-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: .74rem;
    color: var(--gris-400);
    flex-wrap: wrap;
}

/* ── Empty state ──────────────────────────────────────────── */
.prima-empty {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gris-200);
}

.empty-eyebrow {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--azul);
    margin-bottom: 14px;
}

.ref-sem-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.ref-card {
    border-radius: var(--radius-sm);
    padding: 14px;
}
.ref-s1 { background: #eff6ff; border: 1px solid #bfdbfe; }
.ref-s2 { background: #f0fdf4; border: 1px solid #a7f3d0; }

.rc-badge  { font-size: .72rem; font-weight: 700; color: var(--gris-600); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.rc-period { font-size: .92rem; font-weight: 700; color: var(--gris-900); margin-bottom: 5px; }
.rc-payment { font-size: .76rem; color: var(--verde); }

.formula-block {
    background: var(--gris-50);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
    margin-bottom: 14px;
}
.fb-title   { font-size: .72rem; font-weight: 700; color: var(--gris-400); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.fb-formula { font-size: 1rem; font-weight: 700; color: var(--azul); font-family: 'Courier New', monospace; }

.smmlv-block {
    background: white;
    border: 1px solid var(--gris-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 14px;
}
.sb-title { background: var(--azul); color: white; padding: 8px 14px; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.sb-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 14px;
    font-size: .85rem;
    color: var(--gris-700);
    border-bottom: 1px solid var(--gris-100);
}
.sb-row:last-child { border-bottom: none; }
.sb-total { font-weight: 700; color: var(--verde); background: var(--verde-light); }

.empty-alert {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: .8rem;
    color: #78350f;
    line-height: 1.5;
}

/* ── Resultados ───────────────────────────────────────────── */
.result-hero {
    background: linear-gradient(135deg, var(--azul-dark) 0%, var(--azul-mid) 100%);
    border-radius: var(--radius-md);
    padding: 28px;
    color: white;
    text-align: center;
    margin-bottom: 18px;
}
.rh-label  { font-size: .88rem; opacity: .82; margin-bottom: 6px; }
.rh-amount { font-size: 3rem; font-weight: 900; font-family: 'Courier New', monospace; margin-bottom: 6px; }
.rh-note   { font-size: .82rem; opacity: .8; }

/* Barra de progreso días */
.progress-wrap { margin: 16px 0; }
.progress-label { display: flex; justify-content: space-between; font-size: .78rem; color: var(--gris-600); margin-bottom: 6px; }
.progress-bar { height: 10px; background: var(--gris-100); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--verde) 0%, #34d399 100%); border-radius: 99px; transition: width .6s ease; }

/* Summary cards */
.result-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.rmc {
    background: var(--gris-50);
    border: 1px solid var(--gris-200);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
}
.rmc-label { font-size: .74rem; color: var(--gris-400); margin-bottom: 5px; }
.rmc-value { font-size: 1.1rem; font-weight: 800; font-family: 'Courier New', monospace; color: var(--gris-900); }
.rmc-value.azul  { color: var(--azul); }
.rmc-value.verde { color: var(--verde); }

/* Desglose tabla */
.desglose-box {
    background: white;
    border: 1px solid var(--gris-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 14px;
}
.desglose-header { background: var(--azul); color: white; padding: 9px 16px; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.desglose-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--gris-100);
    font-size: .86rem;
}
.desglose-row:last-child { border-bottom: none; }
.dr-label  { color: var(--gris-700); }
.dr-detail { font-size: .74rem; color: var(--gris-400); margin-left: 6px; }
.dr-value  { font-weight: 700; font-family: 'Courier New', monospace; color: var(--azul); }
.dr-value.verde { color: var(--verde); }

/* Tabla anual */
.anual-wrap { margin-bottom: 14px; }
.anual-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.anual-table thead th { background: var(--azul); color: white; padding: 10px 14px; text-align: left; font-weight: 700; }
.anual-table tbody tr:nth-child(even) { background: var(--gris-50); }
.anual-table tbody td { padding: 10px 14px; color: var(--gris-700); border-bottom: 1px solid var(--gris-100); }
.anual-table tfoot td { padding: 11px 14px; font-weight: 700; background: var(--verde-light); color: var(--verde); border-top: 2px solid #a7f3d0; }

/* Recomendación */
.result-tip {
    background: var(--azul-light);
    border-left: 4px solid var(--azul);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.result-tip h4 { font-size: .9rem; font-weight: 700; color: var(--gris-900); margin-bottom: 6px; }
.result-tip p  { font-size: .84rem; color: var(--gris-700); line-height: 1.6; margin: 0; }

.btn-recalcular {
    width: 100%;
    padding: 12px;
    background: white;
    color: var(--azul);
    border: 2px solid var(--azul);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s;
}
.btn-recalcular:hover { background: var(--azul); color: white; }

/* Content sections */
.example-box { background: var(--azul-light); border-left: 4px solid var(--azul); border-radius: 8px; padding: 16px; margin: 16px 0; }
.example-box h4 { font-size: .95rem; font-weight: 700; color: var(--gris-900); margin-bottom: 8px; }
.example-box p  { font-size: .88rem; color: var(--gris-700); line-height: 1.7; margin-bottom: 4px; }
.highlight { color: var(--verde); font-weight: 700; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .modo-tabs { grid-template-columns: 1fr; }
    .modo-tab  { flex-direction: row; gap: 12px; text-align: left; min-height: auto; padding: 13px 16px; }
    .mt-icon   { font-size: 1.2rem; flex-shrink: 0; }
    .mt-sub    { display: none; }

    .ref-sem-cards     { grid-template-columns: 1fr; }
    .result-mini-grid  { grid-template-columns: 1fr; }
    .sem-tabs          { grid-template-columns: 1fr; }

    .rh-amount { font-size: 2.2rem; }
    .pv-amount { font-size: 1.9rem; }
    .hide-mobile { display: none; }
}

@media (max-width: 480px) {
    .prima-hero { padding: 28px 16px 22px; }
    .prima-hero h1 { font-size: 1.4rem; }
    .form-card { padding: 16px; }
    .quick-chips { gap: 5px; }
    .q-chip { padding: 5px 10px; font-size: .74rem; }
    .salary-input { font-size: 1.2rem; }
    .rh-amount { font-size: 1.9rem; }
    .btn-calcular { font-size: .97rem; padding: 14px; }
}

/* ── Accesibilidad ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .cd-pulse, .prima-preview, .btn-calcular, .q-chip { animation: none; transition: none; }
}