/* ─────────────────────────────────────────────────────────────────
   brand-shared.css · design tokens + componentes compartidos MPA
   Marc 2026-12-01: unificar look vistas secundarias (/me, /welcome,
   /alta, /descubre, /me-nuevo-salon, signup-v2, legales) con stack
   admin/cliente PWA. Fuentes/colores/spacing/componentes idénticos.
   Importar: <link rel="stylesheet" href="/brand-shared.css">
   ───────────────────────────────────────────────────────────────── */

:root {
  /* Colors brand */
  --brand: #0a1a3a;
  --brand-dark: #050f24;
  --brand-light: #1e3a6f;
  --brand-accent: #00aeef;
  --brand-pink: #ff1c8e;
  --brand-purple: #a020f0;
  --brand-orange: #ff8c00;

  /* Semantic colors */
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #0284c7;

  /* Surfaces (light default) */
  --bg: #f5f8fc;
  --surface: #ffffff;
  --text: #0a1a3a;
  --text-soft: #64748b;
  --text-mute: #94a3b8;
  --input-bg: #eef4fa;
  --divider: #dbe3ee;
  --shadow: 0 2px 6px rgba(10, 26, 58, 0.08);
  --shadow-hover: 0 4px 14px rgba(10, 26, 58, 0.12);
  --shadow-strong: 0 10px 40px rgba(10, 26, 58, 0.2);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b141a;
  --surface: #202c33;
  --text: #e9edef;
  --text-soft: #8696a0;
  --text-mute: #64748b;
  --input-bg: #1f2c33;
  --divider: #2a3942;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-strong: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

body.loaded { opacity: 1; }
body.leaving { opacity: 0; }

@media (min-width: 640px) {
  body {
    max-width: 640px;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  }
}

/* ─── Header gradient brand + stripe multicolor ──────────────────── */
.brand-header {
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 60%, var(--brand-dark) 100%);
  color: #fff;
  padding: 18px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 14px rgba(10, 26, 58, 0.35);
  flex-shrink: 0;
  position: relative;
  overflow: visible;
  min-height: 90px;
  margin-bottom: 16px;
}
.brand-header::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-pink), var(--brand-purple), var(--brand-orange), var(--brand-accent));
  pointer-events: none;
  z-index: 1;
}
.brand-header::before {
  content: "";
  position: absolute;
  right: -20px; top: -20px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(0, 174, 239, 0.15) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}
.brand-header .avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #fff;
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.3);
  object-fit: cover;
}
.brand-header .title {
  flex: 1;
  min-width: 0;
  z-index: 2;
  position: relative;
}
.brand-header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.brand-header .sub {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 2px;
}

/* ─── Main container ─────────────────────────────────────────────── */
/* Marc 2026-12-03: fondo brand característico (mismo patrón chat-admin).
   Radial-gradients cyan + pink + purple sobre var(--bg) = vibe de la app. */
.brand-main {
  flex: 1;
  padding: 0 16px 24px;
  background:
    radial-gradient(1200px 500px at 20% -5%, rgba(0, 174, 239, 0.14), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(255, 28, 142, 0.10), transparent 65%),
    radial-gradient(1000px 600px at 90% 10%, rgba(160, 32, 240, 0.08), transparent 65%),
    var(--bg);
}

/* ─── Section ────────────────────────────────────────────────────── */
.brand-section {
  margin-bottom: 24px;
}
.brand-section-title {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}
.brand-section-title svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--brand-accent);
}

/* ─── Card ───────────────────────────────────────────────────────── */
.brand-card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.brand-card.interactive {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-card.interactive:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand-accent);
}
.brand-card .icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: #fff;
}
.brand-card .icon-circle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-card .meta {
  flex: 1;
  min-width: 0;
}
.brand-card .meta strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-card .meta .sub {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 2px;
}
.brand-card .arrow {
  color: var(--text-mute);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ─── Empty state ─────────────────────────────────────────────────── */
.brand-empty {
  background: var(--surface);
  border: 1px dashed var(--divider);
  border-radius: 12px;
  padding: 20px 18px;
  color: var(--text-soft);
  text-align: center;
  font-size: 0.9rem;
}
.brand-empty a {
  color: var(--brand-accent);
  font-weight: 600;
  text-decoration: none;
}
.brand-empty a:hover { text-decoration: underline; }

/* ─── Buttons CTA ─────────────────────────────────────────────────── */
.brand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  margin-bottom: 8px;
}
.brand-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.brand-btn.primary {
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: #fff;
  box-shadow: 0 2px 8px rgba(10, 26, 58, 0.25);
}
.brand-btn.primary:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 4px 12px rgba(10, 26, 58, 0.35);
  transform: translateY(-1px);
}
.brand-btn.accent {
  background: linear-gradient(135deg, var(--brand-accent), var(--info));
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 174, 239, 0.3);
}
.brand-btn.accent:hover {
  box-shadow: 0 4px 12px rgba(0, 174, 239, 0.4);
  transform: translateY(-1px);
}
.brand-btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--divider);
}
.brand-btn.ghost:hover {
  background: var(--input-bg);
  border-color: var(--brand-accent);
}
.brand-btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.brand-btn.danger:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--danger);
}
.brand-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Settings / data rows ────────────────────────────────────────── */
.brand-rows {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 4px 16px;
  box-shadow: var(--shadow);
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 0.92rem;
  gap: 12px;
}
.brand-row:last-child { border-bottom: none; }
.brand-row .k {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 500;
  flex-shrink: 0;
}
.brand-row .v {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-row .v a {
  color: var(--brand-accent);
  text-decoration: none;
  font-weight: 600;
}
.brand-row .v a:hover { text-decoration: underline; }
.brand-row.add-cta {
  cursor: pointer;
}
.brand-row.add-cta:hover .v { color: var(--brand-accent); }

/* ─── Callout ─────────────────────────────────────────────────────── */
.brand-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(0, 174, 239, 0.08) 0%, rgba(0, 174, 239, 0.02) 100%);
  border: 1px solid rgba(0, 174, 239, 0.25);
  border-radius: 12px;
  margin-bottom: 16px;
}
.brand-callout svg {
  width: 22px;
  height: 22px;
  stroke: var(--brand-accent);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  margin-top: 1px;
}
.brand-callout .text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}
.brand-callout .text strong { color: var(--brand); font-weight: 700; }

/* ─── Loader ─────────────────────────────────────────────────────── */
.brand-loader {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

/* ─── Tiles grid (patrón chat-admin: 10 iconos coloridos) ─────────── */
.brand-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.brand-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 12px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.18s ease-out;
  text-decoration: none;
  color: var(--text);
  font-family: inherit;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 112px;
}
.brand-tile:hover,
.brand-tile:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(10, 26, 58, 0.15);
}
.brand-tile .tile-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--tile-color-bg, var(--input-bg));
  color: var(--tile-color, var(--brand-accent));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--tile-color, var(--brand-accent)) 20%, transparent);
}
.brand-tile .tile-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-tile .tile-label {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  line-height: 1.3;
  padding: 0 2px;
}
.brand-tile .tile-sub {
  font-size: 0.72rem;
  color: var(--text-soft);
  font-weight: 500;
  margin-top: -4px;
}
.brand-tile .tile-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--tile-color, var(--brand-accent));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  min-width: 26px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.brand-tile.danger {
  --tile-color: var(--danger);
  --tile-color-bg: rgba(239, 68, 68, 0.12);
}
.brand-tile.danger .tile-icon { color: var(--danger); }

/* Business tile grid: cuadraditos tipo IG/chat-admin para lista de negocios */
.biz-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.biz-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.18s ease-out;
  text-decoration: none;
  color: var(--text);
  font-family: inherit;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 150px;
}
.biz-tile:hover,
.biz-tile:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(10, 26, 58, 0.15);
  border-color: var(--tile-color, var(--brand-accent));
}
.biz-tile .biz-tile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--tile-color, var(--brand-accent)), color-mix(in srgb, var(--tile-color, var(--brand-accent)) 60%, black));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--tile-color, var(--brand-accent)) 35%, transparent);
}
.biz-tile .biz-tile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}
.biz-tile .biz-tile-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
  max-width: 100%;
}
.biz-tile .biz-tile-role {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tile-color, var(--brand-accent));
  padding: 3px 10px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--tile-color, var(--brand-accent)) 10%, transparent);
}
.biz-tile .biz-tile-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--tile-color, var(--brand-accent));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
/* "Ver como cliente" overlay badge en biz-tile anfitrión (más visible, color brand) */
.biz-tile .biz-tile-swap {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 11px 5px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.biz-tile .biz-tile-swap svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.biz-tile .biz-tile-swap:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.55);
}

/* Business card: tile tipo "acceso directo a MI NEGOCIO" (más grande) */
.brand-business-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: all 0.18s ease-out;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.brand-business-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--tile-color, var(--brand-accent));
}
.brand-business-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(10, 26, 58, 0.12);
  border-color: var(--tile-color, var(--brand-accent));
}
.brand-business-card .biz-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--tile-color, var(--brand-accent)), color-mix(in srgb, var(--tile-color, var(--brand-accent)) 60%, black));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--tile-color, var(--brand-accent)) 30%, transparent);
}
.brand-business-card .biz-meta {
  flex: 1;
  min-width: 0;
}
.brand-business-card .biz-meta strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-business-card .biz-meta .biz-role {
  font-size: 0.76rem;
  color: var(--text-soft);
  margin-top: 3px;
  text-transform: capitalize;
  font-weight: 500;
}
.brand-business-card .biz-meta .biz-role.anfitrion {
  color: var(--brand-accent);
  font-weight: 700;
}
.brand-business-card .biz-arrow {
  color: var(--text-mute);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ─── Theme toggle (opcional, instalable fácil) ───────────────────── */
.brand-theme-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 3;
}
.brand-theme-toggle:hover { background: rgba(255, 255, 255, 0.25); }
.brand-theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
