/* ============================================
   VisualDent Booking — Design System
   Mobile-First | Bootstrap 5 Override
   ============================================ */

/* --- Google Font import fallback (also in layout <link>) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================
   1. CSS VARIABLES (Design Tokens)
   ============================================ */
:root {
  /* Primary palette */
  --vd-primary: #2563EB;
  --vd-primary-dark: #1D4ED8;
  --vd-primary-light: #DBEAFE;
  --vd-primary-rgb: 37, 99, 235;

  /* Accent */
  --vd-accent: #06B6D4;
  --vd-accent-light: #CFFAFE;

  /* Semantic */
  --vd-success: #10B981;
  --vd-success-light: #D1FAE5;
  --vd-warning: #F59E0B;
  --vd-warning-light: #FEF3C7;
  --vd-danger: #EF4444;
  --vd-danger-light: #FEE2E2;

  /* Surfaces */
  --vd-bg: #F8FAFC;
  --vd-surface: #FFFFFF;
  --vd-surface-raised: #FFFFFF;

  /* Text */
  --vd-text: #1E293B;
  --vd-text-secondary: #475569;
  --vd-text-muted: #94A3B8;

  /* Borders & Lines */
  --vd-border: #E2E8F0;
  --vd-border-focus: var(--vd-primary);

  /* Shadows */
  --vd-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --vd-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --vd-shadow-lg: 0 10px 25px rgba(0,0,0,0.1);

  /* Radius */
  --vd-radius-sm: 8px;
  --vd-radius-md: 12px;
  --vd-radius-lg: 16px;
  --vd-radius-full: 9999px;

  /* Transitions */
  --vd-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Spacing */
  --vd-space-xs: 4px;
  --vd-space-sm: 8px;
  --vd-space-md: 16px;
  --vd-space-lg: 24px;
  --vd-space-xl: 32px;
  --vd-space-2xl: 48px;
}


/* ============================================
   2. BASE / RESET
   ============================================ */
html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--vd-text);
  background-color: var(--vd-bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}


/* ============================================
   2b. CLIENT BRANDING HEADER
   Base styles only — visual theme comes from
   the per-client CSS file (ReservaHoraMain*.css)
   loaded via EstiloCSS parameter.
   ============================================ */
.vd-client-header {
  /* Default fallback if no client CSS loaded */
  background: #F0F6FB;
  padding: 16px 0;
  margin-bottom: 0;
}

.vd-client-logo {
  max-width: 220px;
  max-height: 80px;
  object-fit: contain;
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--vd-text);
  line-height: 1.3;
  margin-bottom: 0.5em;
}

h2 { font-size: 1.5rem; }
h4 { font-size: 1.15rem; }

.vd-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--vd-text);
  margin-bottom: var(--vd-space-xs);
}

.vd-page-subtitle {
  font-size: 0.9rem;
  color: var(--vd-text-muted);
  margin-bottom: var(--vd-space-lg);
}

.vd-section-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--vd-primary);
  margin-bottom: var(--vd-space-xs);
  display: flex;
  align-items: center;
  gap: 6px;
}

.vd-section-hint {
  font-size: 0.82rem;
  color: var(--vd-text-muted);
  margin-bottom: var(--vd-space-md);
  line-height: 1.5;
}


/* ============================================
   4. CARDS
   ============================================ */
.vd-card {
  background: var(--vd-surface);
  border-radius: var(--vd-radius-md);
  border: 1px solid var(--vd-border);
  box-shadow: var(--vd-shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--vd-transition), transform var(--vd-transition);
}

.vd-card:hover {
  box-shadow: var(--vd-shadow-md);
}

.vd-card-body {
  padding: var(--vd-space-lg);
}

@media (min-width: 768px) {
  .vd-card-body {
    padding: var(--vd-space-xl);
  }
}

.vd-card-interactive {
  cursor: pointer;
}
.vd-card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--vd-shadow-md);
}
.vd-card-interactive:active {
  transform: translateY(0);
}


/* ============================================
   5. BUTTONS
   ============================================ */
.vd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  border-radius: var(--vd-radius-sm);
  padding: 12px 24px;
  cursor: pointer;
  transition: all var(--vd-transition);
  text-decoration: none;
  line-height: 1.4;
  min-height: 48px; /* ≥ 44px for touch targets */
  -webkit-tap-highlight-color: transparent;
}

.vd-btn-primary {
  background: var(--vd-primary);
  color: #fff;
  border-color: var(--vd-primary);
}
.vd-btn-primary:hover {
  background: var(--vd-primary-dark);
  border-color: var(--vd-primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--vd-primary-rgb), 0.35);
}
.vd-btn-primary:active {
  transform: scale(0.98);
}

.vd-btn-outline {
  background: transparent;
  color: var(--vd-primary);
  border-color: var(--vd-border);
}
.vd-btn-outline:hover {
  background: var(--vd-primary-light);
  border-color: var(--vd-primary);
  color: var(--vd-primary-dark);
}

.vd-btn-success {
  background: var(--vd-success);
  color: #fff;
  border-color: var(--vd-success);
}
.vd-btn-success:hover {
  background: #059669;
  border-color: #059669;
  color: #fff;
}

.vd-btn-ghost {
  background: transparent;
  color: var(--vd-text-secondary);
  border-color: transparent;
  padding: 12px 16px;
}
.vd-btn-ghost:hover {
  background: var(--vd-bg);
  color: var(--vd-text);
}

.vd-btn-block {
  width: 100%;
}

.vd-btn-lg {
  font-size: 1.05rem;
  padding: 14px 28px;
  min-height: 52px;
}


/* ============================================
   6. FORM INPUTS
   ============================================ */
.vd-form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--vd-text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.vd-form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--vd-text);
  background: var(--vd-surface);
  border: 1.5px solid var(--vd-border);
  border-radius: var(--vd-radius-sm);
  transition: border-color var(--vd-transition), box-shadow var(--vd-transition);
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
}

.vd-form-control:focus {
  outline: none;
  border-color: var(--vd-primary);
  box-shadow: 0 0 0 3px rgba(var(--vd-primary-rgb), 0.15);
}

.vd-form-control::placeholder {
  color: var(--vd-text-muted);
}

select.vd-form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 12px;
  padding-right: 40px;
}

.vd-form-group {
  margin-bottom: var(--vd-space-lg);
}

.vd-form-hint {
  font-size: 0.8rem;
  color: var(--vd-text-muted);
  margin-top: 4px;
}


/* ============================================
   7. ALERTS
   ============================================ */
.vd-alert {
  padding: var(--vd-space-md);
  border-radius: var(--vd-radius-sm);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: var(--vd-space-lg);
  line-height: 1.5;
}

.vd-alert-danger {
  background: var(--vd-danger-light);
  color: #991B1B;
  border: 1px solid #FECACA;
}

.vd-alert-info {
  background: var(--vd-primary-light);
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.vd-alert-warning {
  background: var(--vd-warning-light);
  color: #92400E;
  border: 1px solid #FDE68A;
}

.vd-alert-success {
  background: var(--vd-success-light);
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.vd-alert i {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}


/* ============================================
   8. STEPPER
   ============================================ */
.vd-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--vd-space-xl);
  padding: 0 var(--vd-space-sm);
}

.vd-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.vd-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--vd-transition);
  border: 2px solid var(--vd-border);
  background: var(--vd-surface);
  color: var(--vd-text-muted);
}

.vd-step-label {
  display: none;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--vd-text-muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

/* Connector is a standalone sibling between steps */
.vd-step-connector {
  width: 32px;
  height: 2px;
  background: var(--vd-border);
  flex-shrink: 0;
  align-self: center;
  margin: 0 2px;
  transition: background var(--vd-transition);
}

/* Completed connector */
.vd-connector--completed {
  background: var(--vd-primary);
}

/* Step States */
.vd-step--completed .vd-step-circle {
  background: var(--vd-primary);
  border-color: var(--vd-primary);
  color: #fff;
}

.vd-step--active .vd-step-circle {
  background: var(--vd-primary);
  border-color: var(--vd-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(var(--vd-primary-rgb), 0.2);
}

/* On mobile: show label only for active step */
.vd-step--active .vd-step-label {
  display: block;
  color: var(--vd-primary);
  font-weight: 600;
}

/* Desktop: Show all labels, wider connectors */
@media (min-width: 768px) {
  .vd-stepper {
    padding: 0 var(--vd-space-lg);
  }

  .vd-step {
    flex: 0 0 auto;
  }

  .vd-step-label {
    display: block;
  }

  .vd-step-connector {
    width: 48px;
    margin: 0 4px;
    /* Align connector to circle center vertically */
    margin-bottom: 20px; /* offset for the label height */
  }
}


/* ============================================
   9. SLOT GRID (Time Buttons)
   ============================================ */
.vd-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--vd-space-sm);
}

@media (min-width: 768px) {
  .vd-slot-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1024px) {
  .vd-slot-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.vd-slot-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--vd-primary);
  background: var(--vd-surface);
  border: 1.5px solid var(--vd-primary);
  border-radius: var(--vd-radius-full);
  text-decoration: none;
  transition: all var(--vd-transition);
  cursor: pointer;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.vd-slot-btn:hover {
  background: var(--vd-primary);
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(var(--vd-primary-rgb), 0.3);
}

.vd-slot-btn:active {
  transform: scale(0.97);
}


/* ============================================
   10. PROFESSIONAL CARDS
   ============================================ */
.vd-professional-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--vd-space-md);
}

@media (min-width: 576px) {
  .vd-professional-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.vd-professional-card {
  padding: var(--vd-space-lg);
  text-align: center;
}

.vd-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--vd-primary-light);
  color: var(--vd-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto var(--vd-space-md);
}

.vd-professional-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--vd-text);
  margin-bottom: var(--vd-space-md);
}


/* ============================================
   11. ACTION CARDS (Welcome Page)
   ============================================ */
.vd-action-card {
  display: flex;
  align-items: center;
  gap: var(--vd-space-md);
  padding: var(--vd-space-lg);
  text-decoration: none;
  color: var(--vd-text);
  transition: all var(--vd-transition);
}

.vd-action-card:hover {
  color: var(--vd-text);
  transform: translateY(-2px);
}

.vd-action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--vd-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.vd-action-icon--primary {
  background: var(--vd-primary-light);
  color: var(--vd-primary);
}

.vd-action-icon--secondary {
  background: #F1F5F9;
  color: var(--vd-text-secondary);
}

.vd-action-text h5 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 2px;
}

.vd-action-text p {
  font-size: 0.8rem;
  color: var(--vd-text-muted);
  margin: 0;
}


/* ============================================
   12. REGISTRATION FORM CARD
   ============================================ */
.vd-registration-header {
  background: linear-gradient(135deg, var(--vd-primary), var(--vd-primary-dark));
  color: #fff;
  padding: var(--vd-space-md) var(--vd-space-lg);
  font-weight: 600;
  font-size: 0.95rem;
}

.vd-registration-body {
  padding: var(--vd-space-lg);
}

.vd-row {
  display: grid;
  gap: var(--vd-space-md);
}

@media (min-width: 576px) {
  .vd-row--2col {
    grid-template-columns: 1fr 1fr;
  }
}


/* ============================================
   13. HEADER (Standalone)
   ============================================ */
.vd-header {
  background: linear-gradient(135deg, var(--vd-primary), #3B82F6);
  padding: var(--vd-space-md) 0;
  box-shadow: var(--vd-shadow-sm);
}

.vd-header-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vd-header-brand:hover {
  color: #fff;
  opacity: 0.9;
}

.vd-header-brand i {
  font-size: 1.3rem;
}


/* ============================================
   14. FOOTER (Standalone)
   ============================================ */
.vd-footer {
  background: var(--vd-surface);
  border-top: 1px solid var(--vd-border);
  padding: var(--vd-space-md) 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--vd-text-muted);
  margin-top: auto;
}


/* ============================================
   15. PAGE WRAPPER
   ============================================ */
.vd-page {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--vd-space-md);
}

@media (min-width: 768px) {
  .vd-page {
    padding: var(--vd-space-xl) var(--vd-space-md);
  }
}

.vd-page-header {
  text-align: center;
  margin-bottom: var(--vd-space-lg);
}


/* ============================================
   16. UTILITIES
   ============================================ */
.vd-mt-sm { margin-top: var(--vd-space-sm); }
.vd-mt-md { margin-top: var(--vd-space-md); }
.vd-mt-lg { margin-top: var(--vd-space-lg); }
.vd-mt-xl { margin-top: var(--vd-space-xl); }
.vd-mb-sm { margin-bottom: var(--vd-space-sm); }
.vd-mb-md { margin-bottom: var(--vd-space-md); }
.vd-mb-lg { margin-bottom: var(--vd-space-lg); }
.vd-mb-xl { margin-bottom: var(--vd-space-xl); }

.vd-text-center { text-align: center; }
.vd-text-muted { color: var(--vd-text-muted); }

.vd-gap-sm { gap: var(--vd-space-sm); }
.vd-gap-md { gap: var(--vd-space-md); }

.vd-stack {
  display: flex;
  flex-direction: column;
}

.vd-divider {
  border: 0;
  border-top: 1px solid var(--vd-border);
  margin: var(--vd-space-lg) 0;
}


/* ============================================
   17. ANIMATIONS
   ============================================ */
@keyframes vd-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vd-animate-in {
  animation: vd-fade-in 0.3s ease-out both;
}

/* Stagger children */
.vd-stagger > * {
  animation: vd-fade-in 0.3s ease-out both;
}
.vd-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.vd-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.vd-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.vd-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.vd-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.vd-stagger > *:nth-child(6) { animation-delay: 0.3s; }


/* ============================================
   18. BOOTSTRAP OVERRIDES
   ============================================ */
/* Override Bootstrap focus ring */
.btn:focus, .btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(var(--vd-primary-rgb), 0.2);
}

/* Make Bootstrap form selects match our design */
.form-select, .form-control {
  border-radius: var(--vd-radius-sm);
  border-color: var(--vd-border);
  min-height: 48px;
  font-family: 'Inter', sans-serif;
}

.form-select:focus, .form-control:focus {
  border-color: var(--vd-primary);
  box-shadow: 0 0 0 3px rgba(var(--vd-primary-rgb), 0.15);
}

/* Date input styling */
input[type="date"].vd-form-control {
  padding: 10px 16px;
}