/* ============================================================
   ServiYa — Estilos globales
   Mobile-first, diseño limpio y profesional
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Nunito+Sans:wght@400;500;600&display=swap');

/* ── VARIABLES ─────────────────────────────────────────── */
:root {
  --green:        #1D9E75;
  --green-dark:   #0F6E56;
  --green-light:  #E1F5EE;
  --green-mid:    #5DCAA5;
  --amber:        #EF9F27;
  --amber-light:  #FAEEDA;
  --red:          #E24B4A;
  --red-light:    #FCEBEB;
  --blue:         #378ADD;
  --blue-light:   #E6F1FB;
  --gray-50:      #F8F9FA;
  --gray-100:     #F1F3F5;
  --gray-200:     #E9ECEF;
  --gray-400:     #ADB5BD;
  --gray-600:     #6C757D;
  --gray-800:     #343A40;
  --gray-900:     #212529;
  --white:        #FFFFFF;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.12);
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    18px;
  --radius-xl:    24px;
  --font-display: 'Nunito', sans-serif;
  --font-body:    'Nunito Sans', sans-serif;
  --nav-height:   60px;
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--gray-900);
  background: var(--gray-50);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* ── TYPOGRAPHY ────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.3; color: var(--gray-900); }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 4vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p  { color: var(--gray-600); }

/* ── NAVBAR ────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem;
  box-shadow: var(--shadow-sm);
}
.navbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 800;
  color: var(--gray-900);
}
.navbar-brand .logo-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.navbar-brand .logo-icon svg { width: 18px; height: 18px; fill: white; }
.navbar-actions { display: flex; align-items: center; gap: 8px; }
.navbar-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem; font-weight: 600; color: var(--gray-800);
}
.avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--green-light); color: var(--green-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}
.notif-btn {
  position: relative; width: 36px; height: 36px;
  border: none; background: var(--gray-100); border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid white;
}

/* ── BOTTOM NAV (móvil) ────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: 64px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex; align-items: center;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 8px 4px;
  font-size: 0.65rem; font-weight: 600;
  color: var(--gray-400);
  transition: color .15s;
}
.bottom-nav a.active, .bottom-nav a:hover { color: var(--green); }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active svg { stroke: var(--green); }

/* ── LAYOUT ────────────────────────────────────────────── */
.page-wrapper {
  max-width: 480px; margin: 0 auto;
  padding: 1rem 1rem calc(64px + 1rem);
  min-height: 100vh;
}
.page-wrapper.no-nav { padding-bottom: 1rem; }
.page-wrapper.wide   { max-width: 900px; }

/* ── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 12px; }

/* ── BOTONES ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 20px;
  border-radius: var(--radius-md); border: none;
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary   { background: var(--green); color: white; }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-outline   { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn-outline:hover { background: var(--green-light); }
.btn-danger    { background: var(--red-light); color: var(--red); }
.btn-success   { background: var(--green-light); color: var(--green-dark); }
.btn-full { width: 100%; }
.btn-sm   { padding: 8px 14px; font-size: 0.825rem; border-radius: var(--radius-sm); }
.btn-lg   { padding: 15px 28px; font-size: 1.05rem; border-radius: var(--radius-lg); }

/* ── FORMULARIOS ───────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: 0.825rem; font-weight: 600;
  color: var(--gray-800); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.95rem; color: var(--gray-900);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}
.form-control::placeholder { color: var(--gray-400); }
.form-control.error { border-color: var(--red); }
.form-error { font-size: 0.8rem; color: var(--red); margin-top: 4px; }
.form-hint  { font-size: 0.8rem; color: var(--gray-600); margin-top: 4px; }

.input-icon-wrap { position: relative; }
.input-icon-wrap .form-control { padding-left: 44px; }
.input-icon-wrap .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--gray-400);
}
.input-icon-wrap .input-icon-right {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: var(--gray-400);
}

/* ── BADGES ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700;
}
.badge-green   { background: var(--green-light);  color: var(--green-dark); }
.badge-amber   { background: var(--amber-light);  color: #854F0B; }
.badge-red     { background: var(--red-light);    color: #A32D2D; }
.badge-blue    { background: var(--blue-light);   color: #185FA5; }
.badge-gray    { background: var(--gray-100);     color: var(--gray-600); }

/* ── ESTRELLAS ─────────────────────────────────────────── */
.stars { display: flex; align-items: center; gap: 2px; }
.star  { color: var(--gray-200); font-size: 1rem; }
.star.filled { color: var(--amber); }

/* ── SKELETON LOADER ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── ALERTS ────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500; margin-bottom: 1rem;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: var(--green-light); color: var(--green-dark); }
.alert-error   { background: var(--red-light);   color: #A32D2D; }
.alert-info    { background: var(--blue-light);  color: #185FA5; }
.alert-warning { background: var(--amber-light); color: #854F0B; }

/* ── DIVIDER ───────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--gray-400); font-size: 0.825rem; margin: 1.25rem 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-200);
}

/* ── MODAL ─────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.5); align-items: flex-end;
  animation: fadeIn .2s;
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  background: var(--white); width: 100%;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 1.5rem 1.25rem 2rem;
  animation: slideUp .25s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--gray-200); margin: 0 auto 1.25rem;
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── CHIPS / TAGS ──────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 0.825rem; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600); background: var(--white);
  transition: all .15s; white-space: nowrap;
}
.chip:hover, .chip.active {
  background: var(--green-light);
  border-color: var(--green-mid);
  color: var(--green-dark);
}
.chips-scroll {
  display: flex; gap: 8px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.chips-scroll::-webkit-scrollbar { display: none; }

/* ── FILE UPLOAD ───────────────────────────────────────── */
.file-drop {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-md);
  padding: 2rem 1rem; text-align: center;
  cursor: pointer; transition: all .15s;
  background: var(--gray-50);
}
.file-drop:hover, .file-drop.dragover {
  border-color: var(--green);
  background: var(--green-light);
}
.file-drop input { display: none; }

/* ── STEPPER ───────────────────────────────────────────── */
.stepper { display: flex; align-items: center; margin-bottom: 2rem; }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  border: 2px solid var(--gray-200); background: var(--white); color: var(--gray-400);
}
.step-dot.done    { background: var(--green); border-color: var(--green); color: white; }
.step-dot.current { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }
.step-line { flex: 1; height: 2px; background: var(--gray-200); }
.step-line.done { background: var(--green); }

/* ── SWITCH ────────────────────────────────────────────── */
.switch-wrap { display: flex; align-items: center; justify-content: space-between; }
.switch { position: relative; width: 48px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--gray-200); border-radius: 999px;
  transition: background .2s;
}
.switch-slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px; border-radius: 50%;
  left: 3px; bottom: 3px;
  background: white; transition: transform .2s;
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch-slider { background: var(--green); }
.switch input:checked + .switch-slider::before { transform: translateX(22px); }

/* ── TOAST ─────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
  width: calc(100% - 2rem); max-width: 400px;
}
.toast {
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 600; color: white;
  box-shadow: var(--shadow-lg); text-align: center;
  animation: slideUp .25s ease;
}
.toast-success { background: var(--green); }
.toast-error   { background: var(--red); }
.toast-info    { background: var(--blue); }

/* ── PROVIDER CARD ─────────────────────────────────────── */
.provider-card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 1rem; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, border-color .15s;
  cursor: pointer;
}
.provider-card:hover { border-color: var(--green-mid); box-shadow: var(--shadow-md); }
.provider-card + .provider-card { margin-top: 10px; }
.provider-card-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.provider-avatar {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1rem; font-weight: 800;
}
.provider-name    { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; }
.provider-cat     { font-size: 0.8rem; color: var(--gray-600); margin-top: 2px; }
.provider-rating  { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 0.8rem; }
.provider-meta    { display: flex; justify-content: space-between; align-items: center; margin: 8px 0; font-size: 0.825rem; }
.provider-tags    { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.provider-tag     { font-size: 0.75rem; padding: 3px 8px; background: var(--gray-100); border-radius: 999px; color: var(--gray-600); }
.availability-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.available   { background: var(--green); }
.unavailable { background: var(--gray-400); }

/* ── UTILS ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-sm     { font-size: 0.825rem; }
.text-xs     { font-size: 0.75rem; }
.text-muted  { color: var(--gray-600); }
.text-green  { color: var(--green-dark); }
.text-red    { color: var(--red); }
.fw-bold     { font-weight: 700; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hidden { display: none !important; }

/* ── SPINNER ───────────────────────────────────────────── */
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: white;
  animation: spin .7s linear infinite;
}
.spinner-green {
  border-color: rgba(29,158,117,.2);
  border-top-color: var(--green);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--gray-400);
}
.empty-state svg { width: 56px; height: 56px; margin: 0 auto 1rem; opacity: .4; }
.empty-state p { font-size: 0.925rem; }

/* ── RESPONSIVE — desktop ──────────────────────────────── */
@media (min-width: 640px) {
  .bottom-nav { display: none; }
  .page-wrapper { padding-bottom: 2rem; }
  .desktop-nav-links {
    display: flex; gap: 4px;
  }
  .desktop-nav-link {
    padding: 6px 14px; border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 600; color: var(--gray-600);
    transition: all .15s;
  }
  .desktop-nav-link:hover, .desktop-nav-link.active {
    background: var(--green-light); color: var(--green-dark);
  }
}
@media (max-width: 639px) {
  .desktop-nav-links { display: none; }
}
