/* ============================================================
   PresentAR — Sistema de diseño compartido (vanilla CSS)
   Paleta: navy #0F3D63 / celeste #1D8FD1 / #63C0FF
   Tipografía: Manrope
   ============================================================ */

:root {
  --bg: #070f22;
  --bg2: #0e2240;
  --surface: #0e2440;
  --surface-2: #133154;
  --navy: #0F3D63;
  --sky: #1D8FD1;
  --sky-light: #63c0ff;
  --white: #f7f9fc;
  --muted: #a8b8ca;
  --muted-2: #7c8fa3;
  --line: rgba(140, 185, 225, .20);
  --line-soft: rgba(140, 185, 225, .13);
  --good: #3ecf8e;
  --danger: #f87171;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius: 16px;
  --shadow: 0 10px 40px -10px rgba(7, 15, 34, .7), 0 0 25px 0 rgba(29, 143, 240, .10);
  --gradient: linear-gradient(135deg, #1D8FD1 0%, #63c0ff 100%);
  --cta-shadow: 0 8px 24px -6px rgba(29, 143, 240, .5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--white);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body.bg-ambient {
  background:
    radial-gradient(circle at 50% 18%, rgba(29, 143, 240, .18) 0%, rgba(7, 15, 34, 0) 70%),
    var(--bg);
}

a { color: var(--sky-light); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout helpers ---------- */
.shell { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px; border-radius: 14px; border: none;
  font-weight: 700; font-size: 15px; transition: all .15s ease;
  line-height: 1.2; text-align: center; user-select: none;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--gradient); color: #061021; box-shadow: var(--cta-shadow); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: rgba(15, 23, 42, .85); color: var(--white); border: 1px solid rgba(56, 189, 248, .25); }
.btn-ghost:hover { background: rgba(15, 23, 42, 1); }
.btn-white { background: #fff; color: #1e293b; font-weight: 700; }
.btn-white:hover { background: #f1f5f9; }
.btn-danger { background: rgba(248, 113, 113, .15); color: var(--danger); border: 1px solid rgba(248, 113, 113, .3); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 12px; }
.btn-lg { padding: 17px 26px; font-size: 16px; }

/* ---------- Cards ---------- */
.card {
  background: rgba(14, 36, 64, .75);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(29, 143, 240, .15); color: var(--sky-light);
  border: 1px solid rgba(29, 143, 240, .25);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sky-light); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Headings ---------- */
.h1 { font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.h2 { font-size: 18px; font-weight: 800; }
.h3 { font-size: 14px; font-weight: 700; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.input-inline { display: flex; align-items: center; gap: 10px; }
.input-inline .input { flex: 1; min-width: 0; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--white); margin-bottom: 6px; }
.label .req { color: var(--sky-light); }
.label .hint { color: var(--muted-2); font-weight: 400; font-size: 12px; }
.input, .textarea, .select {
  width: 100%; background: #050b1c; border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 13px; color: var(--white);
  font-family: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(29, 143, 240, .2);
}
.input::placeholder, .textarea::placeholder { color: #5b6b7e; }
.input:disabled, .textarea:disabled { opacity: .45; cursor: not-allowed; }
.textarea { resize: vertical; line-height: 1.5; }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8fa3' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.error-msg { color: var(--danger); font-size: 12px; margin-top: 5px; display: none; }
.field.invalid .error-msg { display: block; }
.field.invalid .input, .field.invalid .textarea { border-color: var(--danger); }

/* ---------- Toggle switch ---------- */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #050b1c; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.toggle-row .t-label { font-size: 13px; font-weight: 600; }
.toggle-row .t-sub { font-size: 11px; color: var(--muted-2); }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #334155; border-radius: 999px; transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--sky); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------- Zonas de cobertura (buscador + chips) ---------- */
.zona-search-wrap { position: relative; }
.zona-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  background: #0a1830; border: 1px solid var(--line); border-radius: 12px;
  max-height: 220px; overflow-y: auto; box-shadow: 0 14px 34px -10px rgba(0,0,0,.65);
  display: none;
}
.zona-dropdown.open { display: block; }
.zona-dropdown .zona-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.04);
}
.zona-dropdown .zona-item:last-child { border-bottom: 0; }
.zona-dropdown .zona-item:hover, .zona-dropdown .zona-item.sel { background: rgba(62,207,142,.1); }
.zona-dropdown .zona-item .z-n { font-weight: 600; color: var(--txt); }
.zona-dropdown .zona-item .z-p { font-size: 11px; color: var(--muted-2); flex-shrink: 0; margin-left: 10px; }
.zona-dropdown .zona-item .z-added { font-size: 11px; color: var(--good); flex-shrink: 0; margin-left: 10px; }
.zona-dropdown .zona-empty { padding: 12px; font-size: 12px; color: var(--muted-2); }
.zona-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.zona-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(62,207,142,.12); border: 1px solid rgba(62,207,142,.25);
  color: var(--txt); border-radius: 999px; padding: 6px 8px 6px 12px; font-size: 12px; font-weight: 600;
  max-width: 100%;
}
.zona-chip .z-chip-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zona-chip .z-chip-prov { color: var(--muted-2); font-weight: 500; }
.zona-chip button {
  border: 0; background: rgba(255,255,255,.08); color: var(--txt); cursor: pointer;
  width: 20px; height: 20px; border-radius: 50%; font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.zona-chip button:hover { background: rgba(248,113,113,.35); }

/* ---------- Calendario (selector de fecha dd/mm/aaaa) ---------- */
.cal-popover {
  position: fixed; z-index: 95; width: 268px; padding: 10px;
  background: #0a1830; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.7);
}
.cal-popover[hidden] { display: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-title { font-size: 13px; font-weight: 700; color: var(--white); text-transform: capitalize; }
.cal-nav {
  border: 0; background: rgba(255,255,255,.06); color: var(--txt); cursor: pointer;
  width: 28px; height: 28px; border-radius: 9px; font-size: 17px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cal-nav:hover { background: rgba(29,143,240,.25); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: 10px; font-weight: 700; color: var(--muted-2); padding: 4px 0; }
.cal-day {
  border: 0; background: transparent; color: var(--txt); cursor: pointer;
  aspect-ratio: 1 / 1; border-radius: 9px; font-size: 12px; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.cal-day:hover { background: rgba(255,255,255,.08); }
.cal-day.is-out { visibility: hidden; }
.cal-day.is-today { box-shadow: inset 0 0 0 1px var(--sky); color: var(--sky-light); }
.cal-day.is-sel { background: var(--sky); color: #fff; font-weight: 700; }
.cal-foot { display: flex; justify-content: center; margin-top: 8px; }
.cal-today {
  border: 1px solid var(--line); background: transparent; color: var(--txt); cursor: pointer;
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; font-family: inherit;
}
.cal-today:hover { background: rgba(29,143,240,.18); border-color: var(--sky); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 16px; left: 16px; right: 16px; max-width: 480px; margin: 0 auto; z-index: 100;
  transform: translateY(-120%); opacity: 0; transition: all .3s ease;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(10, 25, 47, .97); border: 1px solid rgba(62, 207, 142, .5);
  border-radius: 16px; padding: 12px 14px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.6);
  font-size: 13px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-color: rgba(248, 113, 113, .5); }
.toast .toast-icon {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(62, 207, 142, .2); color: var(--good);
}
.toast.error .toast-icon { background: rgba(248,113,113,.2); color: var(--danger); }
.toast .toast-title { font-weight: 700; color: #fff; font-size: 13px; }
.toast .toast-msg { color: var(--muted); font-size: 12px; }
.toast .toast-close { background: none; border: none; color: var(--muted-2); font-size: 18px; line-height: 1; }
.toast .toast-body { flex: 1; min-width: 0; }

/* ============================================================
   Tarjeta pública — temas (misma plantilla, distinta paleta)
   ============================================================ */
body.tema-claro {
  --card-bg: #ffffff; --card-border: #e2e8f0; --text-main: #0f172a; --text-sub: #475569;
  --accent: #1D8FD1; --accent-2: #0284c7; --badge-bg: #f1f5f9; --badge-text: #0f172a;
  --item-bg: #f8fafc; --item-border: #e2e8f0; --btn-bg: #ffffff; --btn-border: #cbd5e1;
  --btn-text: #1e293b; --avatar-border: #e2e8f0;
  --avatar-ring: transparent; --glow: none; --footer-bg: #ffffff; --alias-bg: #1D8FD1; --alias-text: #fff;
}
body.tema-oscuro_glow {
  --card-bg: #0b1326; --card-border: rgba(56, 189, 248, .25); --text-main: #ffffff; --text-sub: #94a3b8;
  --accent: #38bdf8; --accent-2: #63c0ff; --badge-bg: rgba(56, 189, 248, .12); --badge-text: #7dd3fc;
  --item-bg: rgba(255, 255, 255, .04); --item-border: rgba(56, 189, 248, .15); --btn-bg: rgba(15, 23, 42, .85);
  --btn-border: rgba(56, 189, 248, .25); --btn-text: #e2e8f0;
  --avatar-border: #38bdf8; --avatar-ring: rgba(56, 189, 248, .4);
  --glow: 0 0 25px rgba(56, 189, 248, .5); --footer-bg: #0b1326; --alias-bg: #38bdf8; --alias-text: #0b1326;
}
body.tema-dorado {
  --card-bg: #0a1128; --card-border: rgba(212, 175, 55, .45); --text-main: #f8f6f0; --text-sub: #d0d7e5;
  --accent: #d4af37; --accent-2: #dfb15b; --badge-bg: rgba(212, 175, 55, .12); --badge-text: #f4f1ea;
  --item-bg: rgba(23, 35, 56, .65); --item-border: rgba(212, 175, 55, .22); --btn-bg: #172338;
  --btn-border: rgba(212, 175, 55, .3); --btn-text: #f8f6f0;
  --avatar-border: #d4af37; --avatar-ring: rgba(212, 175, 55, .4);
  --glow: 0 0 30px rgba(212, 175, 55, .5); --footer-bg: #0a1128; --alias-bg: #d4af37; --alias-text: #0a1128;
  /* El dorado es el único acento: el botón principal también es dorado (no celeste). */
  --gradient: linear-gradient(135deg, #d4af37 0%, #dfb15b 100%);
  --cta-shadow: 0 8px 24px -6px rgba(212, 175, 55, .45);
}

/* Página de tarjeta */
body.tarjeta-body { background: var(--bg); }
body.tarjeta-body .tarjeta-main { display: flex; flex-direction: column; align-items: center; padding: 16px clamp(12px, 4vw, 16px) 40px; }
.tarjeta-card {
  width: 100%; max-width: 440px;
  background: var(--card-bg); color: var(--text-main);
  border: 1px solid var(--card-border);
  border-radius: 24px; padding: clamp(16px, 6vw, 24px);
  position: relative; overflow: hidden;
  transition: background .3s, color .3s;
}
.tarjeta-card .tarjeta-hero { display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; z-index: 2; }
.tarjeta-card .portada { width: 100%; height: 120px; border-radius: 16px; object-fit: cover; margin-bottom: -48px; z-index: 1; }
.tarjeta-card.no-portada .avatar-wrap { margin-top: 8px; }
.tarjeta-card.no-portada .tarjeta-hero { margin-top: -8px; }
.tarjeta-card .avatar-wrap { position: relative; margin-top: 52px; z-index: 2; }
.tarjeta-card .avatar {
  width: 104px; height: 104px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--avatar-border); box-shadow: var(--glow), 0 8px 16px -6px rgba(0,0,0,.5);
  background: var(--card-bg);
}
.tarjeta-card .t-nombre { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 12px 0 4px; text-transform: uppercase; }
.tarjeta-card .t-oficio {
  display: inline-flex; align-items: center; white-space: nowrap; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: var(--badge-bg); color: var(--badge-text); border: 1px solid var(--card-border);
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
}
.tarjeta-card .t-bio { color: var(--text-sub); font-size: 14px; margin: 10px 0; max-width: 320px; line-height: 1.6; }
.tarjeta-card .t-ciudad { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--accent); font-size: 13px; font-weight: 600; }

/* Botones de la tarjeta */
.tarjeta-actions { margin-top: 20px; }
.t-wa {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px; border-radius: 16px; border: none;
  font-weight: 800; font-size: 15px; background: var(--gradient); color: #061021;
  box-shadow: var(--cta-shadow); transition: transform .12s, opacity .12s;
}
.t-wa:hover { opacity: .95; }
.t-wa:active { transform: scale(.98); }
.t-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.t-dir-link { color: var(--accent); text-decoration: none; border-bottom: 1px dashed rgba(62,207,142,.4); padding-bottom: 1px; }
.t-dir-link:hover { border-bottom-style: solid; }
.t-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 14px; font-size: 13px; font-weight: 600;
  background: var(--btn-bg); color: var(--btn-text); border: 1px solid var(--btn-border);
  transition: filter .12s, transform .12s;
}
.t-btn:hover { filter: brightness(1.1); }
.t-btn:active { transform: scale(.98); }
.t-btn.copied { border-color: var(--good); color: var(--good); }
.t-btn.full { grid-column: 1 / -1; }
.t-grid2 .t-btn { min-height: 46px; }
/* Íconos de los botones: misma lógica que /c/ (color del template sobre fondo tintado). */
.t-btn svg {
  width: 16px; height: 16px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 7px; padding: 2px; box-sizing: content-box;
}
.t-btn.copied svg { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
/* Botón de reserva de turnos (agenda Premium) — debajo del bloque de horarios */
.t-btn-agenda {
  justify-content: flex-start;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  margin-top: 12px;
  font-weight: 700;
}
/* Modal de reserva: campos alineados a la izquierda, títulos centrados */
.modal-agenda { max-width: 360px; text-align: left; }
.modal-agenda h3, .modal-agenda .modal-sub { text-align: center; }
.modal-agenda .chip { margin: 0; }
.modal-agenda .chip { background: var(--item-bg, #050b1c); border-color: var(--item-border, var(--line)); color: var(--text-sub, var(--muted)); }
.modal-agenda .chip.on { border-color: var(--accent, var(--sky)); background: color-mix(in srgb, var(--accent, var(--sky)) 15%, transparent); color: var(--accent, var(--sky-light)); }
body.tema-claro .modal-agenda .chip.on { color: #075985; }

.tarjeta-section { margin-top: 22px; border-top: 1px solid var(--card-border); padding-top: 18px; }
.tarjeta-section h3 { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }

/* Servicios */
.servicio-item {
  display: flex; align-items: baseline; gap: 10px;
  background: var(--item-bg); border: 1px solid var(--item-border);
  padding: 11px 12px; border-radius: 13px; margin-bottom: 8px; font-size: 13px; color: var(--text-main);
}
.servicio-item .check { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.servicio-item .precio { margin-left: auto; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* Redes */
.redes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.red-item {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px;
  background: var(--item-bg); border: 1px solid var(--item-border); color: var(--text-main);
  font-size: 13px; font-weight: 600; text-align: left; transition: filter .12s;
}
.red-item:hover { filter: brightness(1.1); }
.red-item .red-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); flex-shrink: 0; }
.red-item .kicker { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Zonas de cobertura en la tarjeta: misma superficie que los botones de Redes (los chips verdes solo aplican al alta/panel) */
.card-zonas .zona-chip {
  background: var(--item-bg); border: 1px solid var(--item-border); color: var(--text-main);
  border-radius: 13px; padding: 11px 12px; font-size: 13px;
}
.card-zonas .zona-chip .z-chip-prov { color: var(--text-sub); }

/* Horarios & alias & QR row */
.info-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; padding: 6px 0; }
.info-row .k { color: var(--text-sub); display: flex; align-items: center; gap: 8px; font-weight: 600; flex-shrink: 0; }
.info-row .k-horarios { max-width: 112px; align-items: flex-start; }
.info-row .v { flex: 1; min-width: 0; font-weight: 700; line-height: 1.45; }
.h-hoy { display: block; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
.h-hoy-k { color: var(--text-sub); font-weight: 600; }
.alias-block {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px;
  background: var(--item-bg); border: 1px solid var(--item-border); border-radius: 14px; margin-top: 10px;
}
.alias-block .alias-titulo { font-size: 10px; color: var(--text-sub); text-transform: uppercase; letter-spacing: .06em; }
.alias-block .alias-valor { font-family: ui-monospace, monospace; font-weight: 700; color: var(--accent); margin-top: 2px; font-size: 13px; word-break: break-all; }

/* Sello PresentAR */
.footer-sello { width: 100%; max-width: 440px; margin: 22px auto 0; text-align: center; color: var(--muted); font-size: 13px; }
.footer-sello a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(15,23,42,.85); border: 1px solid var(--line); font-weight: 700; color: var(--white); }
.footer-sello img { width: 22px; height: 22px; border-radius: 50%; }

/* No disponible */
.no-disponible { text-align: center; padding: 60px 24px; }

/* ---------- Cabeceras de app (login/alta/panel) ---------- */
.app-header { position: sticky; top: 0; z-index: 30; background: rgba(7, 15, 34, .9); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,.06); }
.app-header .shell { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; padding-bottom: 10px; }
.brand-link { display: flex; align-items: center; gap: 10px; }
.brand-link .brand-img { width: 34px; height: 34px; object-fit: contain; border-radius: 6px; }
.brand-link .brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.02em; line-height: 1; color: var(--white); }
.brand-link .brand-sub { font-size: 10px; color: var(--muted-2); font-weight: 600; letter-spacing: .04em; }
.back-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted);
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); padding: 7px 13px; border-radius: 999px;
}
.back-pill:hover { color: #fff; }

.app-footer { text-align: center; padding: 20px 16px; color: var(--muted-2); font-size: 11px; border-top: 1px solid rgba(255,255,255,.05); background: rgba(7,15,34,.7); }

/* ---------- Stepper (alta) ---------- */
.stepper { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0; }
.step-dot { width: 30px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.12); transition: background .2s; }
.step-dot.active { background: var(--sky-light); }
.step-dot.done { background: var(--good); }

/* ---------- Área de contenido de app ---------- */
.app-main { padding: 18px 0 40px; }

/* Paneles colapsables (edición) */
.panel { background: rgba(14, 36, 64, .6); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-bottom: 12px; }
.panel > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px;
  cursor: pointer; list-style: none; user-select: none;
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary .p-head { display: flex; align-items: center; gap: 12px; }
.panel-icon { width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(29,143,240,.12); color: var(--sky-light); border: 1px solid rgba(29,143,240,.2); }
.panel-title { font-size: 14px; font-weight: 700; }
.panel-sub { font-size: 12px; color: var(--muted-2); }
.panel-caret { transition: transform .2s; color: var(--muted-2); }
.panel[open] > summary .panel-caret { transform: rotate(180deg); }
.panel-body { padding: 14px; border-top: 1px solid rgba(255,255,255,.06); }

/* Usuario actual / chips */
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.user-chip img { width: 22px; height: 22px; border-radius: 50%; }
.user-chip .chip-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Plan del usuario (badge en la tarjeta "Tu tarjeta") */
.plan-badge { display: inline-block; margin-top: 12px; padding: 5px 12px; border-radius: 999px; background: rgba(118,181,255,.12); border: 1px solid rgba(118,181,255,.3); color: var(--sky-light); font-size: 12px; font-weight: 700; white-space: nowrap; }

/* Pestañas del panel */
.tabs { display: flex; gap: 8px; padding: 5px; background: rgba(14, 36, 64, .6); border: 1px solid var(--line); border-radius: 14px 14px 0 0; border-bottom: none; }
.tab-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; padding: 9px 12px; border: none; border-radius: 10px; background: transparent; color: var(--muted-2); font-weight: 700; font-size: 13px; cursor: pointer; transition: background .15s, color .15s; }
.tab-btn:hover:not(:disabled) { color: var(--white); }
.tab-btn.is-active { background: var(--gradient); color: #061021; }
.tab-btn:disabled { cursor: not-allowed; opacity: .55; }
.tab-lock { margin-left: 6px; flex-shrink: 0; opacity: .85; }
.tab-soon { font-size: 10px; font-weight: 600; opacity: .55; margin-left: 4px; }
.tab-count {
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  font-size: 11px; font-weight: 800; line-height: 1;
  background: rgba(251,191,36,.16); color: #fbbf24; border: 1px solid rgba(251,191,36,.35);
}
.tab-count[hidden] { display: none; }
.tab-btn.is-active .tab-count { background: rgba(6,16,33,.85); color: #fbefd8; border-color: rgba(6,16,33,.85); }

/* Contenido de la pestaña activa: encierra los desplegables en el mismo marco */
.tab-panel { border: 1px solid var(--line); border-top: none; border-radius: 0 0 14px 14px; background: rgba(5, 11, 28, .35); padding: 12px; margin-bottom: 12px; }
.tab-panel .panel { border-radius: 12px; }
.tab-panel .panel:last-child { margin-bottom: 0; }

/* Fila de item lista (servicios/redes) */
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #050b1c; border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; margin-bottom: 8px; }
.list-item .li-main { min-width: 0; flex: 1; }
.list-item .li-title { font-size: 13px; font-weight: 700; }
.list-item .li-sub { font-size: 11px; color: var(--muted-2); }
.icon-btn { background: none; border: none; color: var(--muted-2); padding: 6px; border-radius: 8px; }
.icon-btn:hover { color: var(--danger); background: rgba(248,113,113,.1); }

/* Pie fijo de guardar (panel) */
.bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: rgba(7,15,34,.95); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom, 12px)); }
.bottom-bar .shell { display: flex; gap: 10px; }
.bottom-bar .btn { flex: 1; }
.bottom-bar .btn-secondary { flex: 0 0 33%; }

/* Footer espaciador para no tapar bottom-bar */
.spacer-bottom { height: 96px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.78); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal { width: 100%; max-width: 340px; background: var(--card-bg); color: var(--text-main, #fff); border: 1px solid var(--card-border, var(--line)); border-radius: 20px; padding: 22px; text-align: center; position: relative; }
.modal h3 { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--accent, var(--sky)); margin-bottom: 4px; }
.modal .modal-sub { font-size: 13px; color: var(--text-sub, var(--muted)); margin-bottom: 16px; }
.modal .modal-close { position: absolute; top: 12px; right: 12px; background: none; border: none; color: var(--text-sub, var(--muted-2)); font-size: 20px; line-height: 1; }
.modal .qr-box { display: grid; place-items: center; }

/* Chips de interés (alta) */
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: #050b1c; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; transition: all .15s; }
.chip.on { border-color: var(--sky); background: rgba(29,143,240,.15); color: var(--sky-light); }
.chip-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: none; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; line-height: 1;
  background: rgba(29,143,240,.18); color: var(--sky-light);
}
.chip.on .chip-count { background: rgba(29,143,240,.35); }
.chips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Checklist vertical de funciones (alta) */
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #050b1c; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; transition: all .15s; }
.check-row.on { border-color: var(--sky); background: rgba(29,143,240,.15); color: var(--sky-light); }
.check-row input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--sky); cursor: pointer; }
.check-row span { font-size: 13px; font-weight: 600; line-height: 1.35; }

/* Foto upload preview */
.photo-preview { display: flex; gap: 12px; align-items: center; }
.photo-preview img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: #050b1c; border: 1px solid var(--line); }
.photo-preview .portada-prev { width: 120px; height: 64px; }

/* Link pill (legales) */
.legal-link { font-weight: 700; color: var(--sky-light); text-decoration: underline; }

@media (max-width: 640px) {
  .chips-grid { grid-template-columns: 1fr; }
}

/* Cuando el dueño ve su propia tarjeta, el botón fijo "Editar mi tarjeta"
   tapa el pie de página; se reserva espacio al final para que el sello
   "Creado con PresentAR" no quede oculto detrás de él. */
body.tarjeta-body.has-fab .tarjeta-main { padding-bottom: calc(48px + 100px); }

/* Tarjeta pública: en pantallas muy angostas (<360px) el oficio más largo
   necesita un empujón extra para no cortarse; el ancho ya lo ganaron los
   paddings responsive de arriba, acá solo se achica levemente la pill. */
@media (max-width: 360px) {
  .tarjeta-card .t-oficio { font-size: 10px; padding: 4px 10px; gap: 5px; letter-spacing: .02em; }
}

/* Tarjeta pública: en celulares se recorta el padding lateral para que la
   tarjeta y su contenido usen casi todo el ancho de pantalla. */
@media (max-width: 480px) {
  body.tarjeta-body .tarjeta-main { padding-left: 10px; padding-right: 10px; padding-bottom: 48px; }
  .tarjeta-card { padding: 16px 14px; }
  .footer-sello { margin-bottom: 6px; }
}
