/* Kortes PWA Clientes — tema "salón" (claro), mobile-first, CSS vanilla.
   Mismos tokens que assets/css/app.css para verse como una continuación
   natural de Kortes. */
:root {
  /* Canvas */
  --c-bg:           #F7F3EE;
  --c-surface:      #FFFFFF;
  --c-surface-2:    #F0EAE2;
  --c-surface-3:    #E7DDD3;

  /* Text */
  --c-text:         #1B1410;
  --c-text-2:       #3C3028;
  --c-muted:        #7C7068;

  /* Brand */
  --c-accent:       #C49A6C;
  --c-accent-light: #F4E8D4;
  --c-accent-dark:  #9A7040;
  --c-gold:         #D4AF7A;
  --c-dark:         #140F0C;

  /* Status */
  --c-success:      #3B7D5A;
  --c-success-light:#EAF4EE;
  --c-danger:       #BF3830;
  --c-danger-light: #FBEAEA;
  --c-warn:         #D97706;
  --c-warn-light:   #FEF3C7;

  /* Borders */
  --c-border:       #E5DDD3;
  --c-border-strong:#C8BFB4;

  /* Typography */
  --font-serif: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-sans:  'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Shape */
  --radius:    12px;
  --radius-sm:  8px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(27,20,16,0.05);
  --shadow:    0 1px 4px rgba(27,20,16,0.06), 0 4px 16px rgba(27,20,16,0.04);

  --nav-h: 64px;
  --header-h: 56px;
}

* { box-sizing: border-box; }

/* El atributo hidden siempre oculta, aunque una regla de display lo pisaría. */
[hidden] { display: none !important; }

.cli-body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────── */
.cli-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--c-dark);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding-top: env(safe-area-inset-top, 0);
}
.cli-header-inner {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cli-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  color: var(--c-gold);
}
.cli-header-right { display: flex; align-items: center; gap: 10px; }
.cli-user { font-size: 0.8rem; color: #C8BFB4; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-install-btn {
  background: var(--c-accent);
  color: #1a1200;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

/* ── iOS banner ─────────────────────────────────────────── */
.cli-ios-banner {
  background: var(--c-accent-light);
  color: var(--c-text-2);
  font-size: 0.85rem;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--c-border);
}
.cli-ios-banner button {
  margin-left: auto; background: none; border: 0; color: var(--c-muted); font-size: 1rem; cursor: pointer;
}

/* ── Layout ─────────────────────────────────────────────── */
.cli-main { width: 100%; max-width: 640px; margin: 0 auto; }
.cli-section { padding: 20px 16px 32px; }
.cli-center { text-align: center; }
.cli-h1 { font-size: 1.4rem; font-weight: 800; margin: 4px 0 18px; }
.cli-muted { color: var(--c-muted); }
.cli-empty { color: var(--c-muted); text-align: center; padding: 32px 0; }
.cli-empty a, .cli-section a { color: var(--c-accent-dark); }
.cli-back { display: inline-block; color: var(--c-muted); text-decoration: none; font-size: 0.85rem; margin-bottom: 8px; }

/* ── Forms ──────────────────────────────────────────────── */
.cli-form { display: flex; flex-direction: column; gap: 6px; }
.cli-label { font-size: 0.82rem; font-weight: 600; color: var(--c-text-2); margin-top: 10px; }
.cli-input {
  width: 100%;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  color: var(--c-text);
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.cli-input::placeholder { color: var(--c-muted); opacity: 0.6; }
.cli-input:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(196,154,108,.14); }
textarea.cli-input { resize: vertical; }
.cli-input-otp { text-align: center; letter-spacing: 0.5em; font-size: 1.6rem; font-weight: 700; }

/* ── Botones ────────────────────────────────────────────── */
.cli-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-sm); padding: 12px 18px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer; font-family: inherit;
  text-decoration: none; transition: filter .15s, background .15s, border-color .15s;
  min-height: var(--touch-min, 48px);
}
.cli-btn:disabled { opacity: 0.55; cursor: default; }
/* Botón claro (beige) con texto oscuro: alto contraste y aire. */
.cli-btn-primary {
  background: var(--c-accent-light);
  color: var(--c-text);
  font-weight: 700;
  border: 1.5px solid var(--c-accent);
  box-shadow: var(--shadow-xs);
}
.cli-btn-primary:hover { background: #ECDCC2; border-color: var(--c-accent-dark); }
.cli-btn-ghost {
  background: var(--c-surface); color: var(--c-text);
  border: 1.5px solid var(--c-border);
}
.cli-btn-ghost:hover { background: var(--c-surface-2); border-color: var(--c-border-strong); }
.cli-btn-danger { background: transparent; color: var(--c-danger); border: 1.5px solid var(--c-danger); }
.cli-btn-danger:hover { background: var(--c-danger-light); }
.cli-btn-sm { padding: 7px 12px; font-size: 0.8rem; border-radius: var(--radius-sm); min-height: 0; }
.cli-btn-block { width: 100%; margin-top: 12px; }

/* ── Auth ───────────────────────────────────────────────── */
.cli-auth { min-height: calc(100vh - var(--header-h) - 60px); display: flex; align-items: center; padding: 20px 16px; }
.cli-auth-card { width: 100%; max-width: 380px; margin: 0 auto; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 28px 22px; box-shadow: var(--shadow); }
.cli-auth-title { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; margin: 0 0 6px; }
.cli-auth-sub { color: var(--c-muted); margin: 0 0 18px; font-size: 0.9rem; }
.cli-auth-foot { text-align: center; margin-top: 18px; font-size: 0.85rem; }
.cli-alert { background: var(--c-danger-light); border: 1px solid rgba(191,56,48,.2); color: #7C1F1C; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.85rem; margin-bottom: 12px; }

/* ── Búsqueda + tarjetas de negocios ────────────────────── */
.cli-search { display: flex; gap: 8px; margin-bottom: 18px; }
.cli-search .cli-input { flex: 1; }
.cli-card-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cli-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.cli-card-body { display: flex; align-items: center; gap: 12px; }
.cli-card-logo { width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--c-accent-light); display: flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 800; color: var(--c-accent-dark); flex-shrink: 0; }
.cli-card-logo img { width: 100%; height: 100%; object-fit: cover; }
.cli-card-name { font-size: 1.05rem; font-weight: 700; margin: 0; }
.cli-card-meta { color: var(--c-muted); font-size: 0.82rem; margin: 2px 0 0; }

/* ── Wizard ─────────────────────────────────────────────── */
.cli-wz-block { margin-bottom: 18px; }
.cli-wz-label { font-size: 0.95rem; font-weight: 700; margin: 0 0 10px; }
.cli-wz-options { display: flex; flex-wrap: wrap; gap: 8px; }
.cli-opt {
  background: var(--c-surface); border: 1.5px solid var(--c-border); color: var(--c-text);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.88rem; cursor: pointer; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.cli-opt:hover { border-color: var(--c-accent); background: var(--c-accent-light); }
.cli-opt-sm { padding: 8px 12px; font-size: 0.82rem; }
.cli-opt.is-selected { background: var(--c-accent-light); color: var(--c-text); border-color: var(--c-accent); font-weight: 700; }
.cli-wz-cart { margin-top: 22px; border-top: 1px solid var(--c-border); padding-top: 16px; }
.cli-wz-cart-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cli-wz-cart-item { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; box-shadow: var(--shadow-xs); }
.cli-wz-done { text-align: center; padding: 40px 0; }
.cli-wz-done-ico { width: 64px; height: 64px; line-height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--c-success); color: #fff; font-size: 2rem; font-weight: 800; }

/* ── Mis citas ──────────────────────────────────────────── */
.cli-grupo { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow); }
.cli-grupo-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; font-weight: 700; list-style: none; }
.cli-grupo-head::-webkit-details-marker { display: none; }
.cli-cita-list { list-style: none; margin: 0; padding: 0; }
.cli-cita { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--c-border); }
.cli-cita-negocio { font-weight: 700; margin: 0 0 2px; }
.cli-cita-when { margin: 0 0 4px; font-size: 0.9rem; }
.cli-cita-meta { margin: 1px 0; font-size: 0.8rem; color: var(--c-muted); }
.cli-cita-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.cli-badge { font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.04em; }
.cli-badge-pendiente { background: var(--c-warn-light); color: #92400E; }
.cli-badge-confirmada { background: var(--c-success-light); color: #1A4A32; }
.cli-badge-completada { background: var(--c-accent-light); color: var(--c-accent-dark); }
.cli-badge-cancelada { background: var(--c-danger-light); color: #7C1F1C; }

/* ── Bottom nav ─────────────────────────────────────────── */
.cli-bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--c-surface); border-top: 1px solid var(--c-border);
  display: flex; align-items: stretch;
  box-shadow: 0 -1px 6px rgba(27,20,16,0.05);
}
.cli-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--c-muted); text-decoration: none; font-size: 0.68rem; font-weight: 600;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.cli-nav-item.is-active { color: var(--c-accent-dark); }
.cli-nav-ico { font-size: 1.15rem; line-height: 1; }

/* ── Hoja de perfil ─────────────────────────────────────── */
.cli-sheet {
  position: fixed; inset: 0; z-index: 40; background: rgba(20,15,12,.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.cli-sheet-card {
  background: var(--c-surface); width: 100%; max-width: 640px;
  border-radius: 18px 18px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
}
.cli-sheet-avatar {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px;
  background: var(--c-accent-light); color: var(--c-accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.4rem; text-transform: uppercase;
}
.cli-sheet-name { font-weight: 700; font-size: 1.05rem; margin: 0 0 2px; }
.cli-sheet-email { color: var(--c-muted); font-size: 0.85rem; margin: 0 0 18px; }
.cli-sheet-form { text-align: left; margin-bottom: 6px; }
.cli-sheet-form .cli-label:first-child { margin-top: 0; }
.cli-sheet-form .cli-input:disabled { background: var(--c-surface-2); color: var(--c-muted); cursor: not-allowed; }
/* Logout discreto: link pequeño, sin protagonismo, para evitar accidentes. */
.cli-sheet-logout {
  margin-top: 16px; background: none; border: 0; cursor: pointer; font-family: inherit;
  color: var(--c-muted); font-size: 0.82rem; text-decoration: underline; padding: 6px;
}
.cli-sheet-logout:hover { color: var(--c-danger); }

@media (min-width: 560px) {
  .cli-sheet-card { border-radius: 18px; margin-bottom: 80px; }
  .cli-sheet { align-items: center; }
}
