/* =====================================================================
   Conecta Servicios · identidad visual del prototipo final
   Verde #0B6E4F (Amazonía, contraste AA) · Plus Jakarta Sans · móvil primero
   ===================================================================== */
:root {
    --verde: #0B6E4F;
    --verde-osc: #08573F;
    --menta: #E2F0E9;
    --menta-2: #D2E8DD;
    --tinta: #18211D;
    --gris: #5D6A64;
    --gris-claro: #8A958F;
    --borde: #E1E7E4;
    --fondo: #F3F5F4;
    --blanco: #FFFFFF;
    --ambar-bg: #FCEFD6;
    --ambar: #A2650B;
    --rojo: #B3261E;
    --rojo-bg: #FBE9E7;
    --azul: #2C5A8C;
    --oscuro: #18211D;
    --radio: 14px;
    --radio-sm: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--tinta);
    background: #DCE5E0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h1:focus { outline: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #7CC4A6; outline-offset: 2px; }

/* ---------- Marco tipo teléfono ---------- */
.app-fondo { min-height: 100dvh; display: flex; justify-content: center; }
.app-shell {
    width: 100%;
    max-width: 440px;
    min-height: 100dvh;
    background: var(--blanco);
    display: flex;
    flex-direction: column;
    position: relative;
}
@media (min-width: 600px) {
    .app-fondo { padding: 24px 0; }
    .app-shell {
        min-height: calc(100dvh - 48px);
        border-radius: 34px;
        border: 10px solid var(--oscuro);
        overflow: hidden;
        box-shadow: 0 30px 60px rgba(10, 40, 28, .25);
    }
}

.contenido { flex: 1; padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 12px; }
.fondo-gris { background: var(--fondo); }

/* ---------- Cabeceras ---------- */
.cab-verde { background: var(--verde); color: #fff; padding: 22px 18px 24px; }
.cab-fila { display: flex; justify-content: space-between; align-items: center; }
.marca { font-weight: 800; font-size: 1.15rem; }
.pastilla-ciudad { background: rgba(255,255,255,.2); border-radius: 999px; padding: 5px 12px; font-size: .85rem; font-weight: 700; }
.saludo { font-size: 1.55rem; line-height: 1.25; font-weight: 800; margin: 18px 0 16px; }
.buscador {
    display: flex; align-items: center; gap: 10px;
    background: #fff; color: var(--gris); border-radius: var(--radio-sm); padding: 0 14px; height: 50px;
}
.buscador input { border: 0; outline: 0; flex: 1; font: inherit; color: var(--tinta); background: transparent; min-width: 0; }

.cab-menta { background: var(--menta); padding: 18px 18px 18px; }
.btn-circulo {
    width: 44px; height: 44px; border-radius: 50%; background: #fff;
    display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.cab-negocio { color: var(--verde); font-weight: 700; font-size: .9rem; }
.titulo-servicio { font-size: 1.6rem; font-weight: 800; }
.cab-datos { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--gris); font-size: .9rem; margin-top: 2px; }
.cab-datos strong { color: var(--tinta); }

.cab-blanca { padding: 22px 18px 14px; border-bottom: 1px solid var(--borde); }
.cab-blanca h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 14px; }

.cab-oscura { background: var(--oscuro); color: #fff; padding: 20px 18px 18px; }
.cab-pequena { font-size: .8rem; font-weight: 600; opacity: .85; }
.cab-negocio-titulo { font-size: 1.3rem; font-weight: 800; margin-bottom: 16px; }
.nav-fecha { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nav-fecha strong { text-align: center; }
.btn-cuadro {
    width: 44px; height: 44px; border-radius: var(--radio-sm); border: 0;
    background: #333D38; color: #fff; display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Pestañas ---------- */
.pestanas { display: grid; grid-template-columns: 1fr 1fr; background: #EEF1EF; border-radius: 12px; padding: 4px; }
.pestanas button { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--gris); min-height: 44px; }
.pestanas button.activa { background: #fff; color: var(--tinta); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.contador { background: var(--verde); color: #fff; border-radius: 999px; font-size: .72rem; padding: 1px 7px; margin-left: 4px; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    border: 1px solid var(--borde); background: #fff; border-radius: 999px;
    padding: 9px 16px; font-weight: 700; font-size: .9rem; white-space: nowrap; min-height: 40px;
}
.chip-activo { background: var(--oscuro); border-color: var(--oscuro); color: #fff; }
.chip-activo-verde { background: var(--menta); border-color: var(--verde); color: var(--verde); }
.chips-compactos .chip { padding: 7px 13px; font-size: .85rem; }

/* ---------- Títulos de sección ---------- */
.seccion-titulo { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 6px; }
.seccion-titulo h2 { font-size: 1.1rem; font-weight: 800; }
.enlace { border: 0; background: none; color: var(--verde); font-weight: 700; padding: 6px 0; }
.etiqueta { font-size: .95rem; font-weight: 800; margin-top: 6px; }
.nota-gris { color: var(--gris); font-size: .85rem; }
.leyenda { color: var(--gris); font-size: .78rem; line-height: 1.4; }

/* ---------- Tarjetas de servicio (inicio) ---------- */
.tarjeta-servicio {
    display: flex; gap: 14px; padding: 14px; border: 1px solid var(--borde); border-radius: var(--radio);
    background: #fff; transition: border-color .15s, box-shadow .15s;
}
.tarjeta-servicio:hover { border-color: var(--verde); box-shadow: 0 4px 14px rgba(11,110,79,.1); }
.icono-cat {
    width: 64px; height: 64px; flex-shrink: 0; border-radius: 12px; background: var(--menta); color: var(--verde);
    display: flex; align-items: center; justify-content: center;
}
.ts-cuerpo { flex: 1; min-width: 0; }
.ts-fila { display: flex; justify-content: space-between; gap: 8px; }
.ts-sub { color: var(--gris); font-size: .87rem; margin-top: 2px; }
.ts-turnos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.hora-chip { background: var(--menta); color: var(--verde); font-weight: 800; font-size: .82rem; padding: 3px 9px; border-radius: 7px; }
.mas-turnos { color: var(--gris); font-size: .8rem; }

/* ---------- Selección de profesional, día, turno ---------- */
.grilla-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grilla-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grilla-dias { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.grilla-turnos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.opcion-prof {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 56px;
    background: #fff; border: 1.5px solid var(--borde); border-radius: 12px; font-weight: 700; text-align: left;
}
.opcion-prof.seleccionado { border-color: var(--verde); box-shadow: inset 0 0 0 1px var(--verde); }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; background: var(--verde); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; flex-shrink: 0;
}
.avatar-azul { background: var(--azul); }

.opcion-dia {
    display: flex; flex-direction: column; align-items: center; padding: 8px 0; min-height: 56px;
    background: #fff; border: 1.5px solid var(--borde); border-radius: 12px; font-size: .85rem;
}
.opcion-dia strong { font-size: 1rem; }
.opcion-dia.seleccionado { background: var(--oscuro); border-color: var(--oscuro); color: #fff; }

.turno {
    min-height: 48px; border: 1.5px solid var(--borde); border-radius: 12px; background: #fff; font-weight: 800;
}
.turno:not(:disabled):hover { border-color: var(--verde); }
.turno.seleccionado { background: var(--verde); border-color: var(--verde); color: #fff; }
.turno.ocupado { background: #F0F2F1; border-style: dashed; color: #A4ADA8; text-decoration: line-through; }

.campo {
    width: 100%; font: inherit; padding: 12px 14px; border: 1.5px solid var(--borde); border-radius: 12px;
    background: #fff; color: var(--tinta); min-height: 48px;
}
.campo:focus { border-color: var(--verde); outline: none; }
.campo-etiqueta { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 700; color: var(--gris); }
textarea.campo { resize: vertical; }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 10px 16px; border-radius: 12px; border: 1.5px solid transparent;
    font-weight: 800; font-size: .98rem; text-align: center;
}
.btn-bloque { width: 100%; }
.btn-verde { background: var(--verde); color: #fff; }
.btn-verde:hover:not(:disabled) { background: var(--verde-osc); }
.btn-verde:disabled { background: #9DBDB0; }
.btn-claro { background: #fff; border-color: var(--borde); }
.btn-menta { background: var(--menta); color: var(--verde); }
.btn-rojo { background: #fff; border-color: #EBC2BE; color: var(--rojo); }
.btn-rojo-solido { background: var(--rojo); color: #fff; }

/* ---------- Barras fijas inferiores ---------- */
.barra-accion, .pie-fijo { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--borde); z-index: 5; }
.barra-accion { padding: 12px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.resumen-turno { color: var(--gris); font-size: .88rem; }
.barra-doble { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 18px; }
.pie-fijo .barra-inferior { position: static; }

.barra-inferior {
    position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr);
    background: #fff; border-top: 1px solid var(--borde); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 48px;
    font-size: .75rem; font-weight: 700; color: var(--gris-claro);
}
.nav-item.active { color: var(--verde); }

/* ---------- Reservas ---------- */
.tarjeta-reserva {
    background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
}
.tarjeta-reserva.recien { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(11,110,79,.15); }
.tr-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tr-cab h2 { font-size: 1.1rem; font-weight: 800; }

.badge { font-size: .78rem; font-weight: 800; padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.badge-pendiente { background: var(--ambar-bg); color: var(--ambar); }
.badge-ok { background: var(--menta); color: var(--verde); }
.badge-gris { background: #ECEFED; color: var(--gris); }

.grilla-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dato { background: var(--fondo); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.dato span { font-size: .75rem; color: var(--gris); }
.dato strong { font-size: .9rem; overflow-wrap: anywhere; }
.nota-reserva { color: var(--gris); font-style: italic; font-size: .88rem; }

.linea-tiempo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.linea-tiempo li { position: relative; padding-left: 24px; font-size: .9rem; color: var(--gris); }
.linea-tiempo li::before {
    content: ""; position: absolute; left: 2px; top: 4px; width: 11px; height: 11px;
    border-radius: 50%; border: 1.5px solid #A9B3AE; background: #fff;
}
.linea-tiempo li.hecho { color: var(--tinta); }
.linea-tiempo li.hecho::before { background: var(--verde); border-color: var(--verde); }
.linea-tiempo small { display: block; color: var(--gris); font-size: .78rem; }

.confirmar-cancelar { background: var(--rojo-bg); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: .9rem; }

.valoracion { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--borde); padding-top: 12px; }
.estrellas { display: flex; gap: 4px; }
.estrella-btn { border: 0; background: none; padding: 4px; min-width: 40px; min-height: 40px; }
.icono.llena { fill: #E8A317; stroke: #E8A317; }
.estrellas .icono:not(.llena) { stroke: #B8C1BC; }

/* ---------- Agenda ---------- */
.stat { background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.stat strong { font-size: 1.35rem; font-weight: 800; }
.stat span { font-size: .78rem; color: var(--gris); }
.titulo-agenda { font-size: 1rem; font-weight: 800; margin-top: 4px; }
.lista-agenda { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.fila-agenda { display: flex; gap: 14px; padding: 13px 14px; border-bottom: 1px solid var(--borde); align-items: flex-start; }
.fila-agenda:last-child { border-bottom: 0; }
.fila-pendiente { background: #FFF8EC; }
.fila-pasada { opacity: .55; }
.fa-hora { width: 46px; flex-shrink: 0; padding-top: 1px; }
.fa-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fa-fila { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.fa-nota { color: var(--gris); font-size: .8rem; }
.fa-acciones { margin-top: 8px; }
.fa-libre { color: var(--gris); }
.fa-bloqueado { color: var(--gris); font-weight: 700; }

/* ---------- Hoja inferior (modal) ---------- */
.hoja-fondo { position: fixed; inset: 0; background: rgba(10, 20, 15, .45); z-index: 20; }
.hoja {
    position: fixed; z-index: 21; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 440px; background: #fff; border-radius: 20px 20px 0 0;
    padding: 20px 18px 24px; display: flex; flex-direction: column; gap: 12px;
}
.hoja h2 { font-size: 1.2rem; font-weight: 800; }
.lista-servicios { list-style: none; margin: 0; padding: 0; }
.lista-servicios li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--borde); }
.lista-servicios li div { display: flex; flex-direction: column; }

/* ---------- Avisos y vacíos ---------- */
.aviso { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: .9rem; font-weight: 600; }
.aviso-ok { background: var(--menta); color: var(--verde-osc); }
.aviso-error { background: var(--rojo-bg); color: var(--rojo); }
.aviso-cerrar { border: 0; background: none; font-size: 1.2rem; line-height: 1; padding: 0 4px; color: inherit; }
.vacio { text-align: center; color: var(--gris); padding: 30px 10px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.vacio-mini { color: var(--gris); font-size: .9rem; }

/* ---------- Errores de Blazor ---------- */
#blazor-error-ui {
    background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none;
    left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "Ocurrió un error."; }

/* ---------- Sesión, formularios y pagos (v3: conectado a la API) ---------- */
.cab-acciones { display: flex; gap: 8px; align-items: center; }
.pastilla-boton {
    background: #fff; color: var(--verde); border: 0; border-radius: 999px; padding: 5px 12px;
    font-size: .85rem; font-weight: 800; min-height: 32px; display: inline-flex; align-items: center;
}
.cab-compacta { display: flex; flex-direction: column; gap: 4px; }
.cab-compacta .saludo { margin: 6px 0 0; }
.btn-circulo-claro { background: rgba(255,255,255,.18); color: #fff; margin-bottom: 8px; }
.formulario { display: flex; flex-direction: column; gap: 12px; }
select.campo { appearance: auto; }
.centro { text-align: center; color: var(--gris); font-size: .92rem; }
.demo-cuentas { margin-top: 8px; padding: 14px; border: 1px dashed var(--borde); border-radius: var(--radio); display: flex; flex-direction: column; gap: 10px; }
.opcion-prof small { font-weight: 500; }
.pago-ok { display: flex; align-items: center; gap: 8px; background: var(--menta); color: var(--verde-osc); padding: 9px 12px; border-radius: 10px; font-size: .88rem; }
.panel-pago { background: var(--fondo); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.grilla-3 .btn { padding-inline: 8px; }
.esqueleto { height: 92px; border-radius: var(--radio); background: linear-gradient(90deg, #EEF2F0 25%, #F7F9F8 50%, #EEF2F0 75%); background-size: 200% 100%; animation: brillo 1.2s infinite; }
.esqueleto-turno { height: 48px; border-radius: 12px; }
@keyframes brillo { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .esqueleto { animation: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
