/* ============================================
   BARBEARIA JS — Client Page Styles
   Mobile-first design for booking flow
   ============================================ */

/* === MAIN CONTAINER === */
.app-container {
  position: relative;
  z-index: var(--z-base);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-4);
  padding-bottom: var(--space-16);
}

/* === HERO SECTION === */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  text-align: center;
  padding: var(--space-8) var(--space-4);
  animation: fadeIn 0.8s ease;
}

.hero-logo-container {
  position: relative;
  margin-bottom: var(--space-6);
}

.hero-logo {
  width: 100%;
  max-width: 440px;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--border-radius-xl);
  animation: fadeInDown 0.8s ease both;
  filter: drop-shadow(0 0 30px rgba(201, 168, 76, 0.3));
}

.hero-logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 320px;
  height: 320px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(201, 168, 76, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite;
  pointer-events: none;
}

.hero h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-2);
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-10);
  animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 320px;
  animation: fadeInUp 0.8s ease 0.5s both;
}

.hero-actions .btn {
  font-size: var(--text-lg);
  padding: var(--space-4) var(--space-6);
}

.hero-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  width: 100%;
  max-width: 320px;
  margin: var(--space-2) 0;
}

.hero-divider::before,
.hero-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* === PROGRESS BAR === */
.progress-container {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  padding: var(--space-4) 0;
  margin-bottom: var(--space-6);
  background: linear-gradient(180deg, var(--bg-primary) 60%, transparent);
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0;
}

.progress-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  transition: all var(--transition-base);
  border: 2px solid var(--border-default);
  color: var(--text-tertiary);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.progress-circle.active {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  border-color: var(--accent-primary);
  box-shadow: var(--accent-glow);
}

.progress-circle.completed {
  background: var(--status-success);
  border-color: var(--status-success);
  color: white;
}

.progress-line {
  width: 60px;
  height: 2px;
  background: var(--border-subtle);
  transition: background var(--transition-base);
  margin: 0 var(--space-2);
}

.progress-line.active {
  background: var(--accent-gradient);
}

.progress-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-align: center;
  margin-top: var(--space-1);
  transition: color var(--transition-base);
}

.progress-step.active .progress-label {
  color: var(--accent-primary);
}

/* === SECTION HEADER === */
.section-header {
  margin-bottom: var(--space-6);
}

.section-header h2 {
  font-size: var(--text-2xl);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.section-header p {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.section-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  background: none;
  border: none;
  padding: var(--space-2) 0;
  margin-bottom: var(--space-4);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.section-back-btn:hover {
  color: var(--accent-primary);
}

/* === STEP 1: SERVICE SELECTION === */
.services-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.service-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 2px solid transparent;
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.service-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-subtle);
  transform: translateX(4px);
}

.service-card.selected {
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-gold);
}

.service-card.selected .service-icon {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
}

.service-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  background: var(--bg-surface-elevated);
  color: var(--accent-primary);
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.service-info {
  flex: 1;
  min-width: 0;
}

.service-name {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.service-duration {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.service-price {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--accent-light);
  flex-shrink: 0;
}

.service-checkbox {
  width: 24px;
  height: 24px;
  border-radius: var(--border-radius-sm);
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.service-card.selected .service-checkbox {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.service-card.selected .service-checkbox::after {
  content: '✓';
  color: var(--text-on-accent);
  font-size: var(--text-sm);
  font-weight: 700;
}

/* === TOTAL BAR === */
.total-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-default);
  padding: var(--space-4);
  transform: translateY(100%);
  transition: transform var(--transition-spring);
}

.total-bar.visible {
  transform: translateY(0);
}

.total-bar-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.total-info {
  display: flex;
  flex-direction: column;
}

.total-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.total-value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent-light);
}

.total-duration {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.total-bar .btn {
  min-width: 140px;
}

/* === STEP 2: CALENDAR === */
.calendar-section {
  margin-bottom: var(--space-6);
}

.calendar-days {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.calendar-days::-webkit-scrollbar {
  display: none;
}

.calendar-day {
  flex: 1;
  min-width: 100px;
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 2px solid transparent;
  border-radius: var(--border-radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  scroll-snap-align: start;
  user-select: none;
}

.calendar-day:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-subtle);
}

.calendar-day.selected {
  background: rgba(201, 168, 76, 0.1);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-gold);
}

.calendar-day-name {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.calendar-day-number {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.calendar-day.selected .calendar-day-number {
  color: var(--accent-light);
}

.calendar-day-month {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.calendar-day.today .calendar-day-name {
  color: var(--accent-primary);
}

.calendar-day.today::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  margin: var(--space-1) auto 0;
}

/* === TIME SLOTS === */
.time-slots-container {
  margin-top: var(--space-6);
}

.time-slots-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.time-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}

.time-slot {
  padding: var(--space-3) var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  user-select: none;
}

.time-slot:hover:not(.disabled) {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.time-slot.selected {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-gold);
  transform: scale(1.05);
}

.time-slot.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

.time-slots-empty {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-tertiary);
  font-size: var(--text-base);
}

.time-slots-empty-icon {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-3);
  display: block;
}

/* Period labels */
.time-period {
  grid-column: 1 / -1;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-3) 0 var(--space-1);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-1);
}

/* === STEP 3: FORM + CONFIRMATION === */
.form-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-section .input-field {
  padding: var(--space-4);
  font-size: var(--text-lg);
}

.phone-input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 0 var(--space-4);
  transition: all var(--transition-base);
}

.phone-input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.phone-prefix {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.phone-input-wrapper .input-field {
  border: none;
  background: none;
  padding-left: 0;
  box-shadow: none !important;
}

/* === CONFIRMATION CARD === */
.confirmation-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  margin: var(--space-6) 0;
}

.confirmation-header {
  background: var(--accent-gradient);
  padding: var(--space-4) var(--space-5);
  text-align: center;
}

.confirmation-header h3 {
  color: var(--text-on-accent);
  font-size: var(--text-lg);
  font-weight: 700;
}

.confirmation-body {
  padding: var(--space-5);
}

.confirmation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.confirmation-row:last-child {
  border-bottom: none;
}

.confirmation-row-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.confirmation-row-value {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.confirmation-services {
  margin: var(--space-3) 0;
}

.confirmation-service-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.confirmation-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  background: rgba(201, 168, 76, 0.06);
  border-top: 1px solid var(--border-default);
}

.confirmation-total-label {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.confirmation-total-value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--accent-light);
}

/* === SUCCESS SCREEN === */
.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  min-height: 80dvh;
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.success-checkmark {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--status-success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  animation: scaleIn var(--transition-spring) both;
}

.success-checkmark svg {
  width: 50px;
  height: 50px;
}

.success-checkmark .check-path {
  stroke: var(--status-success);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 100;
  animation: checkmark 0.8s ease 0.3s both;
}

.success-screen h2 {
  font-size: var(--text-2xl);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  animation: fadeInUp 0.5s ease 0.5s both;
}

.success-screen p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  animation: fadeInUp 0.5s ease 0.6s both;
}

.success-code {
  display: inline-block;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-md);
  padding: var(--space-3) var(--space-6);
  font-family: monospace;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent-light);
  letter-spacing: 0.15em;
  margin-bottom: var(--space-6);
  animation: fadeInUp 0.5s ease 0.7s both;
}

.success-details {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  padding: var(--space-5);
  width: 100%;
  max-width: 360px;
  text-align: left;
  margin-bottom: var(--space-6);
  animation: fadeInUp 0.5s ease 0.8s both;
}

.success-detail-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
}

.success-detail-label {
  color: var(--text-tertiary);
}

.success-detail-value {
  color: var(--text-primary);
  font-weight: 600;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 360px;
  animation: fadeInUp 0.5s ease 0.9s both;
}

/* === QUEUE CHECK === */
.queue-section {
  min-height: 80vh;
  min-height: 80dvh;
  display: flex;
  flex-direction: column;
  padding-top: var(--space-8);
}

.queue-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.queue-result {
  text-align: center;
  padding: var(--space-8);
  animation: scaleIn var(--transition-spring) both;
}

.queue-position {
  font-family: var(--font-heading);
  font-size: 5rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.queue-position-label {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.queue-time-estimate {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-surface);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--border-radius-full);
  color: var(--accent-light);
  font-weight: 600;
}

.queue-not-found {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-tertiary);
}

.queue-not-found-icon {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-3);
  display: block;
}

/* === NAVIGATION BUTTONS === */
.nav-buttons {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.nav-buttons .btn {
  flex: 1;
}

/* === TOAST NOTIFICATION === */
.toast {
  position: fixed;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: var(--z-toast);
  background: var(--bg-surface-elevated);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-spring);
  max-width: 90vw;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.toast-message {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

/* === LOADING SPINNER === */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

/* === MODAL OVERLAY === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-xl);
  padding: var(--space-6);
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform var(--transition-spring);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* === RESPONSIVE === */
@media (min-width: 640px) {
  .app-container {
    padding: var(--space-6);
  }

  .hero h1 {
    font-size: var(--text-5xl);
  }

  .time-slots-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .hero-actions {
    flex-direction: row;
    max-width: 400px;
  }
}

@media (min-width: 1024px) {
  .app-container {
    max-width: 560px;
  }

  .time-slots-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

a.btn-whatsapp {
  text-decoration: none !important;
  color: white !important;
}
