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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #f6f7f8;
  --card:    #ffffff;
  --text:    #0b0c0d;
  --muted:   #6b7280;
  --border:  rgba(15,23,42,.09);
  --shadow:  0 2px 20px rgba(0,0,0,.06);
  --shadow2: 0 8px 40px rgba(0,0,0,.11);
  --blue:    #2563eb;
  --red:     #e11d48;
  --dark:    #111827;
  --r:       18px;
}

html, body { min-height: 100%; }

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  background:
    radial-gradient(900px 600px at 110% -5%,  rgba(37,99,235,.07),  transparent 50%),
    radial-gradient(900px 600px at -10% 110%, rgba(225,29,72,.07),  transparent 50%),
    var(--bg);
}

/* ── Layout ── */
.wrap {
  max-width: 500px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}

/* ── Header ── */
.brand { text-align: center; margin-bottom: 28px; }
.barber-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: 10px;
  background: linear-gradient(135deg, var(--blue), var(--red));
  font-size: 26px; box-shadow: var(--shadow2);
}
.title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.65rem; font-weight: 700; color: var(--dark); letter-spacing: -.3px;
}
.subtitle { color: var(--muted); font-size: .88rem; margin-top: 3px; }

/* ── Auth entrada ── */
.or-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: .8rem;
}
.or-divider::before,
.or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.btn.corporate {
  width: 100%; justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--red));
  color: #fff;
  box-shadow: 0 4px 20px rgba(37,99,235,.25);
  font-size: .95rem;
  padding: 13px 22px;
}
.btn.corporate:hover { opacity: .9; }

.btn.guest {
  width: 100%; justify-content: center;
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  font-size: .88rem;
}
.btn.guest:hover { background: #f3f4f6; color: var(--dark); }

.register-link {
  text-align: center; margin-top: 16px;
  font-size: .84rem; color: var(--muted);
}
.register-link a { color: var(--blue); font-weight: 600; text-decoration: none; }
.register-link a:hover { text-decoration: underline; }

.forgot-link {
  font-size: .8rem; color: var(--muted); text-decoration: none;
}
.forgot-link:hover { color: var(--blue); }

.auth-error {
  font-size: .8rem; color: var(--red);
  text-align: center; padding: 4px 0;
}
.auth-error.hidden { display: none; }

.auth-success {
  font-size: .82rem; color: #16a34a;
  text-align: center; padding: 6px 10px;
  background: #f0fdf4; border-radius: 8px;
  border: 1px solid #bbf7d0;
}
.auth-success.hidden { display: none; }

/* ── Badge usuario logueado ── */
.user-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 14px 5px 6px;
  margin-bottom: 16px; width: fit-content;
  font-size: .84rem; color: var(--dark); font-weight: 500;
}
.user-badge.hidden { display: none; }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--red));
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.badge-logout {
  margin-left: 4px; background: none; border: none;
  font-size: .75rem; color: var(--muted); cursor: pointer;
  font-family: 'DM Sans', sans-serif; padding: 0;
}
.badge-logout:hover { color: var(--red); }
.badge-action {
  margin-left: 4px; font-size: .75rem; color: var(--blue);
  font-weight: 600; text-decoration: none;
}
.badge-action:hover { text-decoration: underline; }

/* ── Progress ── */
.steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 24px;
}
.step-item { display: flex; align-items: center; }
.step-dot  { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step-circle {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: var(--muted);
  transition: all .25s;
}
.step-label { font-size: .65rem; color: var(--muted); white-space: nowrap; font-weight: 500; }
.step-line  { width: 36px; height: 2px; background: var(--border); margin: 0 4px 18px; transition: background .25s; }
.step-item.active .step-circle {
  background: linear-gradient(135deg, var(--blue), var(--red));
  border-color: transparent; color: #fff;
}
.step-item.active .step-label { color: var(--blue); font-weight: 600; }
.step-item.done .step-circle  {
  background: linear-gradient(135deg, var(--blue), var(--red));
  border-color: transparent; color: #fff;
}
.step-item.done + .step-item .step-line {
  background: linear-gradient(90deg, var(--blue), var(--red));
}

/* ── Card ── */
.card {
  background: var(--card); border-radius: var(--r);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head { padding: 20px 20px 0; }
.card-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 700; color: var(--dark);
}
.card-body { padding: 16px 20px; }
.card-foot {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fafafa;
}
.card-foot.end { justify-content: flex-end; }

/* ── Stage ── */
.stage { animation: fadeUp .22s ease; }
.stage.hidden { display: none; }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── Services ── */
.services { display: flex; flex-direction: column; gap: 10px; }
.svc {
  position: relative; border: 1.5px solid var(--border); border-radius: 14px;
  padding: 14px 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  transition: border-color .2s, box-shadow .2s, background .2s;
  background: var(--card);
}
.svc:hover { border-color: rgba(37,99,235,.3); box-shadow: 0 2px 14px rgba(37,99,235,.08); }
.svc input { position: absolute; opacity: 0; pointer-events: none; }
.svc-left   { display: flex; flex-direction: column; gap: 3px; }
.svc-name   { font-weight: 600; font-size: .95rem; }
.svc-meta   { display: flex; gap: 10px; }
.pill       { font-size: .75rem; color: var(--muted); }
.svc-price  { font-weight: 700; font-size: 1rem; color: var(--dark); }
.svc.active {
  border-color: var(--blue);
  background: linear-gradient(135deg, rgba(37,99,235,.04), rgba(225,29,72,.03));
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.svc-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; color: transparent; flex-shrink: 0;
  margin-left: 12px; transition: all .2s;
}
.svc.active .svc-check {
  background: linear-gradient(135deg, var(--blue), var(--red));
  border-color: transparent; color: #fff;
}

/* ── Form fields ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: .78rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.control {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-family: 'DM Sans', sans-serif; font-size: .95rem;
  color: var(--text); background: var(--card); outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-grid { display: flex; flex-direction: column; gap: 12px; }

/* ── Resumen ── */
.confirm-box {
  background: #f8f9fb; border-radius: 12px;
  padding: 14px 16px; margin-top: 14px;
  border: 1px solid var(--border);
}
.confirm-row {
  display: flex; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.confirm-row:last-child { border-bottom: none; padding-bottom: 0; }
.confirm-row span:first-child { color: var(--muted); }
.confirm-row span:last-child  { font-weight: 600; }

/* ── Customer info box (paso 3 logueado) ── */
.customer-info-box {
  background: #f8f9fb; border-radius: 12px;
  padding: 14px 16px; border: 1px solid var(--border);
}
.cinfo-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.cinfo-row:last-child { border-bottom: none; padding-bottom: 0; }
.cinfo-row span { color: var(--muted); }
.cinfo-row strong { font-weight: 600; color: var(--dark); }

/* ── Rueda iOS ── */
.wheel-card {
  background: var(--bg); border-radius: 14px;
  padding: 16px 12px 12px; border: 1px solid var(--border);
}
.wheel-time-display {
  text-align: center;
  font-size: 2rem; font-weight: 700; color: var(--dark);
  letter-spacing: -.5px; line-height: 1;
}
.wheel-time-label {
  text-align: center; font-size: .72rem; color: var(--muted);
  margin-top: 3px; margin-bottom: 14px;
}
.wheel-wrap { position: relative; height: 216px; overflow: hidden; }
.wheel-wrap-single { display: flex; align-items: stretch; }
.wheel-wrap-single .wheel-drum { flex: 1; }
.wheel-wrap::before,
.wheel-wrap::after {
  content: ''; position: absolute; left: 0; right: 0; height: 72px;
  pointer-events: none; z-index: 2;
}
.wheel-wrap::before { top: 0;    background: linear-gradient(to bottom, var(--bg) 20%, transparent); }
.wheel-wrap::after  { bottom: 0; background: linear-gradient(to top,   var(--bg) 20%, transparent); }
.wheel-band {
  position: absolute; left: 6px; right: 6px;
  top: 50%; transform: translateY(-50%);
  height: 72px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(37,99,235,.07), rgba(225,29,72,.05));
  border: 1.5px solid rgba(37,99,235,.15);
  pointer-events: none; z-index: 1;
}
.wheel-drum {
  height: 216px; overflow: hidden; position: relative; cursor: grab;
}
.wheel-drum:active { cursor: grabbing; }
.wheel-drum-inner { will-change: transform; }
.wheel-drum-item {
  height: 72px; display: flex; align-items: center; justify-content: center;
  font-size: 1.65rem; font-weight: 700; color: #c8cdd6; transition: color .12s;
  position: relative; z-index: 3;
}
.wheel-drum-item.center { color: var(--dark); }

/* ── Empty / loading ── */
.empty-slots { text-align: center; padding: 20px; color: var(--muted); font-size: .88rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 22px; border-radius: 12px;
  font-family: 'DM Sans', sans-serif; font-size: .9rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: opacity .15s, transform .1s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--dark), #1f2937);
  color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.btn.primary:hover   { opacity: .88; }
.btn.primary:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn.secondary {
  background: #f3f4f6; color: var(--dark);
  border: 1.5px solid var(--border);
}
.btn.secondary:hover { background: #e9eaec; }

/* ── Success ── */
.success-icon { text-align: center; font-size: 3rem; margin-bottom: 8px; }

/* ── Utils ── */
.mini { font-size: .78rem; color: var(--muted); }
.mt8  { margin-top: 8px; }
.hidden { display: none !important; }

/* ── Citas en perfil ── */
.appt-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  gap: 10px;
}
.appt-row:last-child { border-bottom: none; }
.appt-info { display: flex; flex-direction: column; gap: 3px; }
.appt-service { font-size: .9rem; font-weight: 600; color: var(--dark); }
.appt-date { font-size: .78rem; color: var(--muted); }
.appt-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

.appt-badge {
  font-size: .72rem; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; white-space: nowrap;
}
.appt-badge.confirmed { background: #eff6ff; color: #1d4ed8; }
.appt-badge.cancelled { background: #fef2f2; color: #b91c1c; }
.appt-badge.past      { background: #f3f4f6; color: var(--muted); }

.appt-cancel-btn {
  font-size: .72rem; font-weight: 600; color: var(--red);
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; padding: 0;
  text-decoration: underline;
}
.appt-cancel-btn:hover { opacity: .75; }
@media (max-width: 480px) {
  .wrap { padding: 20px 12px 80px; }
  .title { font-size: 1.4rem; }
  .step-line { width: 22px; }
  .step-label { font-size: .6rem; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 14px 16px; }
  .card-foot { padding: 12px 16px; }
  .btn { padding: 11px 16px; font-size: .88rem; }
}
