/* ==========================================================================
   components.css · PIEZAS REUTILIZABLES
   Botones, campos de formulario, tarjetas, avisos y mensajes de error.
   Todos los botones y campos miden mínimo 52 px de alto: cómodos para el pulgar.
   ========================================================================== */

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 54px; padding: 0 24px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 800; font-size: 1.0625rem; cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), background .2s, border-color .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn--primary { background: var(--green); color: #fff; box-shadow: 0 8px 20px rgba(45, 59, 255, .28); }
.btn--primary:hover { background: var(--green-2); }
.btn--ghost { background: transparent; border-color: var(--green); color: var(--green); }
.btn--text { background: transparent; color: var(--green); min-height: 44px; width: auto; padding: 0 12px; }
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: inline-grid; place-items: center; cursor: pointer; flex: none;
}

/* ---------- Campos de formulario ---------- */
/* minmax(0,1fr): la columna puede encogerse; sin esto los campos empujan el formulario fuera de la pantalla */
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.field__label { font-size: .875rem; font-weight: 500; }
.field__box {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 14px;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.field__box:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(45, 59, 255, .15); }
.field__box > svg { color: var(--muted); flex: none; }
.field__input { flex: 1; width: 100%; min-width: 0; height: 50px; border: 0; background: transparent; outline: none; font-size: 1rem; }
.field__input::placeholder { color: #8C90B5; }
.field__toggle { border: 0; background: transparent; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.field__error { color: var(--danger); font-size: .8125rem; min-height: 1.1em; }
.field--error .field__box { border-color: var(--danger); background: var(--danger-soft); }
.field--error .field__hint { display: none; }   /* si hay error, la pista se oculta para no repetir el mensaje */
.field__hint { font-size: .8125rem; color: var(--muted); }

/* Casilla de aceptar términos */
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .875rem; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--green); flex: none; }

/* ---------- Mensajes ---------- */
.notice { padding: 14px 16px; border-radius: var(--radius-sm); font-size: .9375rem; }
.notice--error { background: var(--danger-soft); color: var(--danger); }
.notice--ok { background: var(--green-soft); color: var(--green-2); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }

/* ---------- Avisos flotantes ---------- */
.toasts { position: fixed; left: 50%; translate: -50% 0; bottom: calc(20px + var(--safe-bottom)); z-index: 100; display: grid; gap: 10px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 14px 18px; border-radius: var(--radius-sm); background: var(--ink); color: #fff; box-shadow: var(--shadow); animation: screen-in .3s var(--ease); }
.toast--error { background: var(--danger); }

/* ---------- Paso 2: select, textarea, etiquetas, selector de rol, barra inferior ---------- */
.field__select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 8px; background: transparent; }
.field__box--select::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 6px 4px 0; flex: none; pointer-events: none; }
.field__box--top { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.field__box--top > svg, .field__box--top > span { margin-top: 3px; }
.field__textarea { height: auto; min-height: 84px; resize: none; padding: 0; line-height: 1.45; font-family: inherit; }

.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.pill--ok { background: var(--green-soft); color: var(--green-2); }
.pill--warn { background: var(--orange-soft); color: #A3105A; }
.pill--mute { background: #E6E8FA; color: var(--muted); }

/* Interruptor Cliente | Paseador. El modo activo se pinta con el color del rol. */
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; background: #E6E8FA; border-radius: 999px; }
.role-switch__btn { border: 0; background: transparent; border-radius: 999px; min-height: 56px; display: grid; align-content: center; justify-items: center; cursor: pointer; font-weight: 600; transition: background .2s, color .2s, box-shadow .2s; }
.role-switch__btn small { font-size: .6875rem; font-weight: 500; color: var(--muted); line-height: 1.2; }
.role-switch__btn.is-active { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(45, 59, 255, .3); }
.role-switch[data-role="paseador"] .role-switch__btn.is-active { background: var(--orange); color: var(--night); box-shadow: 0 6px 16px rgba(255, 79, 163, .35); }
.role-switch__btn.is-active small { color: rgba(255, 255, 255, .85); }
.role-switch[data-role="paseador"] .role-switch__btn.is-active small { color: rgba(14, 16, 51, .75); }

/* Barra de navegación inferior (queda pegada abajo al hacer scroll) */
.screen--tabs { padding-bottom: 0; }
.tabbar { position: sticky; bottom: 0; margin: 20px -22px 0; padding: 8px 10px calc(10px + var(--safe-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tabbar__item { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; text-decoration: none; color: var(--muted); font-size: .6875rem; font-weight: 600; transition: color .2s, background .2s; }
.tabbar__item[aria-current="page"] { color: var(--green); background: var(--green-soft); }
.screen--tabs[data-role="paseador"] .tabbar__item[aria-current="page"] { color: #A3105A; background: var(--orange-soft); }

/* Campo con lista de sugerencias (razas) */
.combo { position: relative; }
.combo__list { list-style: none; margin: 4px 0 0; padding: 6px; max-height: 260px; overflow-y: auto; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; box-shadow: 0 12px 30px rgba(14,16,51,.14); position: relative; z-index: 5; -webkit-overflow-scrolling: touch; }
.combo__list[hidden] { display: none; }
.combo__opt { padding: 12px 12px; border-radius: 10px; cursor: pointer; font-size: .98rem; }
.combo__opt:active, .combo__opt:hover { background: var(--green-soft); }
.combo__opt--free { color: var(--green); font-weight: 700; border-top: 1px solid var(--line); margin-top: 4px; }
