@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap');

:root {
  --pearl:    #FFFFFF;
  --silver:   #C5A059;
  --platinum: #E0E0E0;
  --steel:    #666666;
  --slate:    #1A1A1A;
  --onyx:     #0D0D0D;
  --carbon:   #000000;
  --ice-100:  #FFF3D1;
  --ice-300:  #C5A059;
  --ice-500:  #9F834D;
  --ice-800:  #261F09;
  --gold:     #D4AF37;
  --gold-gradient: linear-gradient(135deg, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
  --gold-shadow: rgba(191, 149, 63, 0.4);
  --danger:   #D96C6C;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--carbon);
  background-image:
    linear-gradient(135deg, rgba(212,175,55,0.06) 0%, transparent 40%, rgba(212,175,55,0.08) 100%),
    radial-gradient(at 20% 12%, rgba(212,175,55,0.08) 0, transparent 50%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.82  0 0 0 0 0.86  0 0 0 0 0.92  0 0 0 0.14 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  color: var(--pearl);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }

.app-shell {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
}

.topbar {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  background: rgba(10,12,16,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 0.5px solid rgba(220,226,234,0.08);
  z-index: 10;
}
.topbar-title { text-align: center; font-size: 13px; font-weight: 500; color: var(--pearl); letter-spacing: -0.005em; }
.ic-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--platinum);
  transition: background .15s;
}
.ic-btn:hover { background: rgba(184,192,204,0.08); color: var(--pearl); }

.screen-body { padding: 24px 18px 80px; }
.step-label {
  font-size: 11px;
  color: var(--ice-300);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 8px;
}
.screen-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--pearl);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  line-height: 1.2;
}
.screen-sub {
  font-size: 13px;
  color: var(--platinum);
  margin-bottom: 22px;
  line-height: 1.5;
}
.screen-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--ice-300);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.barber-bio {
  font-size: 13px;
  color: var(--silver);
  line-height: 1.6;
  padding: 12px 14px;
  background: rgba(184,192,204,0.04);
  border-left: 2px solid var(--ice-500);
  border-radius: 0 8px 8px 0;
  margin-bottom: 22px;
  font-style: italic;
}
.barber-price-from {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  background: rgba(111,138,176,0.18);
  color: var(--ice-300);
  font-size: 11px;
  letter-spacing: .06em;
  border-radius: 999px;
  font-weight: 500;
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 30px;
}
.portfolio-img {
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  background-color: var(--onyx);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: transform .08s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.big { padding: 16px 28px; font-size: 15px; min-width: 220px; }
.btn-primary { background: var(--gold-gradient); color: #000; font-weight: 600; box-shadow: 0 4px 15px var(--gold-shadow); text-shadow: 0 1px 0 rgba(255,255,255,0.4); }
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 6px 20px var(--gold-shadow); }
.btn-outline { background: transparent; color: var(--platinum); border: 0.5px solid rgba(220,226,234,0.20); }
.btn-outline:hover { color: var(--pearl); border-color: rgba(220,226,234,0.40); }

.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.splash { padding: 0; min-height: 100vh; }
.splash-hero {
  position: relative;
  min-height: 100vh;
  background-color: var(--carbon);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
.splash-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,12,16,0.55) 0%, rgba(10,12,16,0.78) 55%, rgba(10,12,16,0.96) 100%);
}
.splash-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 420px;
}
.splash-logo { width: 80px; height: auto; opacity: .95; margin-bottom: 8px; }
.splash-name {
  font-size: 28px;
  font-weight: 500;
  color: var(--pearl);
  letter-spacing: .02em;
  margin-bottom: 0;
}
.splash-tag {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ice-300);
  margin-bottom: 32px;
}
.splash-cta-label {
  font-size: 14px;
  color: var(--platinum);
  margin-bottom: 4px;
}
.splash-call {
  font-size: 12px;
  color: var(--steel);
  margin-top: 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.splash-call:hover { color: var(--platinum); }
.staff-login {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--platinum);
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .35;
  text-decoration: none;
  transition: opacity .2s;
  font-weight: 500;
}
.staff-login:hover { opacity: .85; }

.service-grid { display: grid; gap: 12px; }
.service-card {
  background: rgba(184,192,204,0.04);
  border: 0.5px solid rgba(220,226,234,0.10);
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
  position: relative;
  transition: border-color .15s, transform .08s;
}
.service-card:hover { border-color: rgba(220,226,234,0.25); }
.service-card:active { transform: scale(.99); }
.service-card.popular { border-color: rgba(111,138,176,0.30); }
.service-img {
  width: 110px;
  background-color: var(--onyx);
  background-size: cover;
  background-position: center;
}
.service-info { padding: 14px 16px; }
.service-name { font-size: 15px; font-weight: 500; color: var(--pearl); margin-bottom: 4px; }
.service-desc { font-size: 12px; color: var(--platinum); line-height: 1.5; margin-bottom: 10px; }
.service-meta { display: flex; gap: 14px; align-items: center; }
.service-price { font-size: 15px; font-weight: 500; color: var(--ice-300); }
.service-dur { font-size: 11px; color: var(--steel); }
.popular-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(111,138,176,0.20);
  color: var(--ice-100);
  font-size: 10px;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.barber-grid { display: grid; gap: 12px; }
.barber-card {
  background: rgba(184,192,204,0.04);
  border: 0.5px solid rgba(220,226,234,0.10);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 100px 1fr;
  text-align: left;
  transition: border-color .15s, transform .08s;
}
.barber-card:hover { border-color: rgba(180,196,219,0.30); }
.barber-card:active { transform: scale(.99); }
.barber-img {
  width: 100px;
  height: 120px;
  background-color: var(--onyx);
  background-size: cover;
  background-position: center;
}
.barber-info { padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.barber-name { font-size: 16px; font-weight: 500; color: var(--pearl); }
.barber-spec { font-size: 12px; color: var(--platinum); line-height: 1.4; margin-bottom: 6px; }
.barber-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--steel); }
.barber-rating { color: var(--ice-300); font-weight: 500; }

.date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.date-card {
  background: rgba(184,192,204,0.04);
  border: 0.5px solid rgba(220,226,234,0.10);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  transition: all .15s;
}
.date-card:hover { background: rgba(184,192,204,0.10); border-color: rgba(180,196,219,0.30); }
.date-card.disabled { opacity: .35; cursor: not-allowed; }
.date-day { font-size: 10px; color: var(--steel); letter-spacing: .08em; }
.date-num { font-size: 22px; color: var(--pearl); font-weight: 500; margin: 4px 0 2px; line-height: 1; }
.date-mes { font-size: 10px; color: var(--platinum); }
.date-closed { font-size: 9px; color: var(--danger); margin-top: 4px; }

.hora-section { margin-bottom: 22px; }
.hora-label {
  font-size: 11px;
  color: var(--ice-300);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 10px;
}
.hora-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}
.hora-slot {
  padding: 12px 6px;
  background: rgba(184,192,204,0.06);
  border: 0.5px solid rgba(220,226,234,0.10);
  border-radius: 10px;
  color: var(--pearl);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: all .15s;
}
.hora-slot:hover { background: var(--silver); color: var(--carbon); }

.no-slots {
  text-align: center;
  padding: 40px 24px;
}
.no-slots-icon { font-size: 36px; margin-bottom: 12px; opacity: .6; }
.no-slots h3 { color: var(--pearl); font-weight: 500; margin-bottom: 6px; font-size: 17px; }
.no-slots p { color: var(--platinum); font-size: 13px; margin-bottom: 18px; }

.resumen-card {
  background: rgba(184,192,204,0.04);
  border: 0.5px solid rgba(220,226,234,0.10);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
}
.resumen-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  color: var(--platinum);
}
.resumen-row b { color: var(--pearl); font-weight: 500; }
.resumen-row.total {
  border-top: 0.5px solid rgba(220,226,234,0.10);
  margin-top: 4px;
  padding-top: 12px;
  font-size: 14px;
}
.resumen-row.total b { color: var(--ice-300); font-size: 17px; }

.form-fields { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label {
  font-size: 11px;
  color: var(--steel);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 500;
}
.input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  background: rgba(184,192,204,0.05);
  border: 0.5px solid rgba(220,226,234,0.15);
  border-radius: 10px;
  color: var(--pearl);
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.input::placeholder { color: var(--steel); }
.input:focus { border-color: var(--ice-500); background: rgba(184,192,204,0.08); }
.form-err {
  display: none;
  background: rgba(226,160,160,0.12);
  border: 0.5px solid rgba(226,160,160,0.30);
  color: var(--danger);
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 8px;
}
.form-err.show { display: block; }
#f-submit { margin-top: 6px; width: 100%; }
.form-note {
  font-size: 11px;
  color: var(--steel);
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}

.confirm-body {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 18px 80px;
}
.confirm-check {
  width: 72px;
  height: 72px;
  background: rgba(111,138,176,0.18);
  border: 0.5px solid rgba(180,196,219,0.30);
  color: var(--ice-300);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.confirm-title {
  font-size: 26px;
  font-weight: 500;
  color: var(--pearl);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.confirm-sub {
  font-size: 13px;
  color: var(--platinum);
  margin-bottom: 24px;
}
.confirm-sub b { color: var(--ice-300); font-weight: 500; }
.confirm-card {
  width: 100%;
  max-width: 380px;
  background: rgba(184,192,204,0.04);
  border: 0.5px solid rgba(220,226,234,0.10);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 22px;
  text-align: left;
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--platinum);
}
.confirm-row b { color: var(--pearl); font-weight: 500; }
.confirm-row.big { font-size: 18px; color: var(--pearl); justify-content: center; }
.confirm-row.hora { font-size: 32px; color: var(--ice-300); font-weight: 500; justify-content: center; padding-bottom: 12px; }
.confirm-divider { height: 0.5px; background: rgba(220,226,234,0.10); margin: 8px 0; }
.confirm-row.total {
  border-top: 0.5px solid rgba(220,226,234,0.10);
  margin-top: 6px; padding-top: 12px;
}
.confirm-row.total b { color: var(--ice-300); font-size: 17px; }

.confirm-info {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  text-align: left;
}
.info-item {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(184,192,204,0.03);
  border-radius: 10px;
  font-size: 12px;
  color: var(--platinum);
  align-items: center;
  line-height: 1.5;
}
.info-item svg { color: var(--ice-300); flex-shrink: 0; }
.info-item b { color: var(--pearl); font-weight: 500; }

.confirm-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 380px;
}
.confirm-actions .btn { flex: 1; }

@media (min-width: 600px) {
  .barber-img { width: 120px; height: 140px; }
  .barber-card { grid-template-columns: 120px 1fr; }
}

/* === Invite banner (cuando llega con ?inv=CODE) === */
.invite-banner {
  text-align: center;
  padding: 24px 18px 22px;
  margin-top: 16px;
  background: linear-gradient(180deg, rgba(232,197,71,0.16), rgba(212,175,55,0.04));
  border: 1px solid rgba(232,197,71,0.32);
  border-radius: 18px;
  color: #E8C547;
}
.invite-banner svg {
  display: block;
  margin: 0 auto;
  color: #E8C547;
  filter: drop-shadow(0 2px 8px rgba(232,197,71,0.4));
}
.invite-code-chip {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 14px;
  background: rgba(232,197,71,0.20);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #E8C547;
}
.invite-code-chip b {
  font-family: 'SF Mono', Menlo, monospace;
  letter-spacing: 0.10em;
}

/* === Code input (canjear invitación) === */
.code-input {
  font-family: 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  font-size: 28px;
  text-align: center;
  letter-spacing: 0.18em;
  font-weight: 600;
  text-transform: uppercase;
  padding: 16px 12px;
}
.code-input::placeholder {
  letter-spacing: 0.18em;
  opacity: 0.4;
}

.pin-group .code-input { font-size: 32px; letter-spacing: 0.35em; padding: 18px 12px; }
.label-hint { font-weight: 400; opacity: 0.6; font-size: 11px; margin-left: 4px; }
.btn-ghost { background: transparent; border: none; color: var(--platinum, #ccc); padding: 8px; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.btn-ghost:active { opacity: 0.6; }
