/* ============================================================
   Appointment Flow — Shared Styles
   Mobile-first | Open Sans | Nubank-like clean design
   Brand: #0A6EBD primary, #00C9A7 teal, #1DE9B6 mint
   ============================================================ */

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

:root {
  --af-primary:        #0A6EBD;
  --af-primary-dark:   #074F8A;
  --af-secondary:      #00C9A7;
  --af-secondary-dark: #00A88D;
  --af-accent:         #1DE9B6;
  --af-dark:           #0D1B2A;
  --af-text:           #2E3D4F;
  --af-text-muted:     #5C6E7E;
  --af-light:          #F4F8FB;
  --af-white:          #FFFFFF;
  --af-border:         #DDE6EE;
  --af-error:          #E53935;
  --af-success:        #00C9A7;

  --af-radius-sm:   0.375rem;
  --af-radius-md:   0.75rem;
  --af-radius-lg:   1.25rem;
  --af-radius-full: 9999px;

  --af-shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --af-shadow-md:   0 4px 16px rgba(10,110,189,.12);
  --af-shadow-lg:   0 8px 32px rgba(10,110,189,.18);
  --af-shadow-card: 0 2px 12px rgba(13,27,42,.08);

  --af-transition: 0.25s ease;
  --af-bottom-nav: 64px;
  --af-header-h:   60px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body.af-body {
  font-family: 'Open Sans', sans-serif;
  color: var(--af-text);
  background-color: var(--af-light);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Loading Overlay ── */
.af-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--af-transition);
}
.af-loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.af-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--af-border);
  border-top-color: var(--af-primary);
  border-radius: 50%;
  animation: af-spin 0.75s linear infinite;
}
@keyframes af-spin { to { transform: rotate(360deg); } }

/* ── Header ── */
.af-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--af-white);
  height: var(--af-header-h);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  box-shadow: var(--af-shadow-sm);
  border-bottom: 1px solid var(--af-border);
}
.af-header-logo {
  height: 36px;
  width: auto;
}
.af-header-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--af-dark);
  margin: 0;
  flex: 1;
  text-align: center;
}
.af-back-btn {
  background: none;
  border: none;
  color: var(--af-primary);
  font-size: 1.25rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: var(--af-radius-sm);
  transition: background var(--af-transition);
  line-height: 1;
}
.af-back-btn:hover { background: var(--af-light); }
.af-header-spacer { width: 40px; } /* balances title centering */

/* ── Main Content ── */
.af-main {
  padding: 1.25rem 1rem;
  padding-bottom: calc(var(--af-bottom-nav) + 1.25rem);
  max-width: 480px;
  margin: 0 auto;
}
.af-main--no-bottom-nav {
  padding-bottom: 1.25rem;
}

/* ── Bottom Navigation ── */
.af-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--af-bottom-nav);
  background: var(--af-white);
  border-top: 1px solid var(--af-border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.af-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--af-text-muted);
  text-decoration: none;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color var(--af-transition);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.af-bottom-nav-item i { font-size: 1.25rem; }
.af-bottom-nav-item.active,
.af-bottom-nav-item:hover { color: var(--af-primary); }

/* ── Buttons ── */
.af-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--af-radius-full);
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--af-transition);
  text-decoration: none;
  line-height: 1;
}
.af-btn:active { transform: scale(.97); }
.af-btn-primary {
  background: var(--af-primary);
  color: var(--af-white);
  box-shadow: var(--af-shadow-md);
}
.af-btn-primary:hover { background: var(--af-primary-dark); box-shadow: var(--af-shadow-lg); }
.af-btn-secondary {
  background: transparent;
  color: var(--af-primary);
  border: 2px solid var(--af-primary);
}
.af-btn-secondary:hover { background: rgba(10,110,189,.06); }
.af-btn-teal {
  background: var(--af-secondary);
  color: var(--af-white);
  box-shadow: 0 4px 16px rgba(0,201,167,.25);
}
.af-btn-teal:hover { background: var(--af-secondary-dark); }
.af-btn-google {
  background: var(--af-white);
  color: var(--af-text);
  border: 1.5px solid var(--af-border);
  box-shadow: var(--af-shadow-sm);
}
.af-btn-google:hover { background: var(--af-light); }
.af-btn-disabled,
.af-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Form Elements ── */
.af-form-group {
  margin-bottom: 1rem;
}
.af-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--af-text-muted);
  margin-bottom: 0.375rem;
  letter-spacing: 0.03em;
}
.af-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--af-border);
  border-radius: var(--af-radius-md);
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  color: var(--af-text);
  background: var(--af-white);
  transition: border-color var(--af-transition), box-shadow var(--af-transition);
  outline: none;
  -webkit-appearance: none;
}
.af-input:focus {
  border-color: var(--af-primary);
  box-shadow: 0 0 0 3px rgba(10,110,189,.12);
}
.af-input::placeholder { color: #b0bec5; }
.af-input-group {
  position: relative;
}
.af-input-group .af-input { padding-right: 3rem; }
.af-input-group-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--af-text-muted);
  font-size: 1rem;
  padding: 0;
}

/* ── Checkbox ── */
.af-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--af-text-muted);
  cursor: pointer;
  line-height: 1.5;
}
.af-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  accent-color: var(--af-primary);
  cursor: pointer;
}

/* ── Cards ── */
.af-card {
  background: var(--af-white);
  border-radius: var(--af-radius-lg);
  box-shadow: var(--af-shadow-card);
  padding: 1.25rem;
  border: 1.5px solid var(--af-border);
  transition: box-shadow var(--af-transition), border-color var(--af-transition), transform var(--af-transition);
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}
.af-card:hover, .af-card:focus {
  box-shadow: var(--af-shadow-md);
  border-color: var(--af-primary);
  transform: translateY(-1px);
  outline: none;
  color: inherit;
  text-decoration: none;
}
.af-card.selected {
  border-color: var(--af-primary);
  box-shadow: 0 0 0 3px rgba(10,110,189,.15);
}

/* ── Service Category Grid ── */
.af-service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
}
.af-service-card {
  background: var(--af-white);
  border-radius: var(--af-radius-lg);
  box-shadow: var(--af-shadow-card);
  padding: 1.25rem 0.875rem;
  border: 1.5px solid var(--af-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--af-transition);
  text-decoration: none;
  color: var(--af-text);
}
.af-service-card:hover, .af-service-card:focus {
  border-color: var(--af-primary);
  box-shadow: var(--af-shadow-md);
  transform: translateY(-2px);
  outline: none;
  color: var(--af-text);
  text-decoration: none;
}
.af-service-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--af-radius-md);
  background: linear-gradient(135deg, rgba(10,110,189,.12), rgba(0,201,167,.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--af-primary);
}
.af-service-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--af-text);
  line-height: 1.3;
}

/* ── Professional Card (Search Results) ── */
.af-prof-card {
  background: var(--af-white);
  border-radius: var(--af-radius-lg);
  box-shadow: var(--af-shadow-card);
  padding: 1rem;
  border: 1.5px solid var(--af-border);
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  cursor: pointer;
  transition: all var(--af-transition);
  text-decoration: none;
  color: inherit;
  margin-bottom: 0.875rem;
}
.af-prof-card:hover {
  border-color: var(--af-primary);
  box-shadow: var(--af-shadow-md);
  transform: translateY(-1px);
  color: inherit;
  text-decoration: none;
}
.af-prof-avatar {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--af-light);
}
.af-prof-info { flex: 1; min-width: 0; }
.af-prof-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--af-dark);
  margin-bottom: 0.125rem;
}
.af-prof-service {
  font-size: 0.8125rem;
  color: var(--af-text-muted);
  margin-bottom: 0.375rem;
}
.af-prof-price {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--af-primary);
  margin-bottom: 0.25rem;
}
.af-stars { color: #FFC107; font-size: 0.8125rem; }

/* ── Summary Detail Row ── */
.af-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--af-border);
  gap: 0.5rem;
}
.af-detail-row:last-child { border-bottom: none; }
.af-detail-label {
  font-size: 0.8125rem;
  color: var(--af-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.af-detail-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--af-dark);
  text-align: right;
}

/* ── Calendar ── */
.af-calendar {
  background: var(--af-white);
  border-radius: var(--af-radius-lg);
  box-shadow: var(--af-shadow-card);
  padding: 1rem;
  border: 1.5px solid var(--af-border);
  margin-bottom: 1.25rem;
}
.af-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.af-cal-nav {
  background: none;
  border: none;
  color: var(--af-primary);
  font-size: 1.125rem;
  cursor: pointer;
  padding: 0.375rem 0.625rem;
  border-radius: var(--af-radius-sm);
  transition: background var(--af-transition);
}
.af-cal-nav:hover { background: var(--af-light); }
.af-cal-month {
  font-size: 1rem;
  font-weight: 700;
  color: var(--af-dark);
}
.af-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.af-cal-day-name {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--af-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0;
}
.af-cal-day {
  text-align: center;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--af-text);
  border-radius: var(--af-radius-sm);
  cursor: pointer;
  transition: all var(--af-transition);
  user-select: none;
  border: 1.5px solid transparent;
}
.af-cal-day:hover:not(.empty):not(.disabled) {
  background: rgba(10,110,189,.08);
  border-color: rgba(10,110,189,.2);
}
.af-cal-day.selected {
  background: var(--af-primary);
  color: var(--af-white);
  font-weight: 700;
}
.af-cal-day.today { font-weight: 800; color: var(--af-primary); }
.af-cal-day.disabled { color: var(--af-border); cursor: not-allowed; }
.af-cal-day.empty { cursor: default; }

/* ── Time Slots ── */
.af-time-section { margin-top: 0.25rem; }
.af-time-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--af-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}
.af-time-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.af-time-chip {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--af-border);
  border-radius: var(--af-radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--af-text);
  background: var(--af-white);
  cursor: pointer;
  transition: all var(--af-transition);
  user-select: none;
}
.af-time-chip:hover { border-color: var(--af-primary); color: var(--af-primary); }
.af-time-chip.selected {
  background: var(--af-primary);
  border-color: var(--af-primary);
  color: var(--af-white);
}

/* ── Payment ── */
.af-payment-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--af-white);
  border: 1.5px solid var(--af-border);
  border-radius: var(--af-radius-lg);
  cursor: pointer;
  transition: all var(--af-transition);
  margin-bottom: 0.75rem;
}
.af-payment-option.selected {
  border-color: var(--af-primary);
  background: rgba(10,110,189,.04);
  box-shadow: 0 0 0 3px rgba(10,110,189,.1);
}
.af-payment-option input[type="radio"] {
  accent-color: var(--af-primary);
  width: 18px;
  height: 18px;
  min-width: 18px;
}
.af-payment-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--af-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.af-payment-icon.pix { background: rgba(0,201,167,.12); color: var(--af-secondary); }
.af-payment-icon.card { background: rgba(10,110,189,.12); color: var(--af-primary); }
.af-payment-label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--af-dark);
  flex: 1;
}
.af-payment-fields {
  display: none;
  padding-top: 0.5rem;
}
.af-payment-fields.visible { display: block; }

/* ── Confirmation Screen ── */
.af-confirm-success {
  text-align: center;
  padding: 2rem 0 1.5rem;
}
.af-confirm-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--af-secondary), var(--af-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2.5rem;
  color: var(--af-white);
  box-shadow: 0 8px 24px rgba(0,201,167,.3);
}
.af-confirm-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--af-dark);
  margin-bottom: 0.375rem;
}
.af-confirm-subtitle {
  font-size: 0.9375rem;
  color: var(--af-text-muted);
}
.af-qr-placeholder {
  width: 160px;
  height: 160px;
  margin: 1.5rem auto;
  border: 2px dashed var(--af-border);
  border-radius: var(--af-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--af-text-muted);
  font-size: 0.8125rem;
  gap: 0.5rem;
}
.af-qr-placeholder i { font-size: 3rem; }

/* ── Safety Seal ── */
.af-safety-seal {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--af-secondary);
  background: rgba(0,201,167,.1);
  padding: 0.25rem 0.625rem;
  border-radius: var(--af-radius-full);
  margin-top: 0.625rem;
}

/* ── Divider ── */
.af-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--af-text-muted);
  font-size: 0.8125rem;
  margin: 1rem 0;
}
.af-divider::before, .af-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--af-border);
}

/* ── Login Logo Section ── */
.af-login-logo {
  text-align: center;
  padding: 2rem 0 1.5rem;
}
.af-login-logo img {
  height: 48px;
  width: auto;
  display: inline-block;
}

/* ── Alert / Error ── */
.af-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--af-radius-md);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}
.af-alert.show { display: block; }
.af-alert-error {
  background: rgba(229,57,53,.08);
  border: 1px solid rgba(229,57,53,.25);
  color: var(--af-error);
}
.af-alert-success {
  background: rgba(0,201,167,.08);
  border: 1px solid rgba(0,201,167,.3);
  color: var(--af-secondary-dark);
}

/* ── Utility ── */
.af-stack { display: flex; flex-direction: column; gap: 0.75rem; }
.af-text-muted { color: var(--af-text-muted); font-size: 0.875rem; }
.af-text-center { text-align: center; }
.af-fw-bold { font-weight: 700; }
.af-mt-1 { margin-top: 0.5rem; }
.af-mt-2 { margin-top: 1rem; }
.af-mt-3 { margin-top: 1.5rem; }
.af-mb-1 { margin-bottom: 0.5rem; }
.af-mb-2 { margin-bottom: 1rem; }
.af-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--af-text-muted);
  margin-bottom: 0.75rem;
}
.af-page-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--af-dark);
  margin-bottom: 0.375rem;
  font-family: 'Open Sans', sans-serif;
}
.af-page-subtitle {
  font-size: 0.9375rem;
  color: var(--af-text-muted);
  margin-bottom: 1.25rem;
}

/* ── Consultation Summary Profile ── */
.af-prof-profile {
  text-align: center;
  padding: 1.5rem;
  background: var(--af-white);
  border-radius: var(--af-radius-lg);
  box-shadow: var(--af-shadow-card);
  border: 1.5px solid var(--af-border);
  margin-bottom: 1.25rem;
}
.af-prof-profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.875rem;
  display: block;
  border: 3px solid var(--af-border);
}
.af-prof-profile-name {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--af-dark);
  margin-bottom: 0.25rem;
}
.af-prof-profile-service {
  font-size: 0.875rem;
  color: var(--af-text-muted);
  margin-bottom: 0.5rem;
}
.af-prof-profile-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--af-primary);
}

/* ── Institution Card ── */
.af-institution-card {
  background: var(--af-white);
  border-radius: var(--af-radius-lg);
  box-shadow: var(--af-shadow-card);
  padding: 1.25rem;
  border: 1.5px solid var(--af-border);
  margin-bottom: 0.875rem;
  cursor: pointer;
  transition: all var(--af-transition);
  text-decoration: none;
  display: block;
  color: inherit;
}
.af-institution-card:hover, .af-institution-card:focus {
  border-color: var(--af-primary);
  box-shadow: var(--af-shadow-md);
  transform: translateY(-2px);
  outline: none;
  color: inherit;
  text-decoration: none;
}
.af-institution-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--af-dark);
  margin-bottom: 0.375rem;
}
.af-institution-meta {
  font-size: 0.8125rem;
  color: var(--af-text-muted);
  margin-bottom: 0.5rem;
}
.af-institution-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--af-radius-md);
  background: linear-gradient(135deg, rgba(10,110,189,.12), rgba(0,201,167,.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--af-primary);
  margin-bottom: 0.875rem;
}

/* ── Pix Info Box ── */
.af-pix-info {
  background: rgba(0,201,167,.06);
  border: 1.5px solid rgba(0,201,167,.3);
  border-radius: var(--af-radius-lg);
  padding: 1.25rem;
  text-align: center;
  display: none;
}
.af-pix-info.visible { display: block; }
.af-pix-key {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--af-secondary-dark);
  letter-spacing: 0.04em;
  word-break: break-all;
}

/* ── Responsive ── */
@media (min-width: 480px) {
  .af-main {
    padding: 1.5rem 1.25rem;
    padding-bottom: calc(var(--af-bottom-nav) + 1.5rem);
  }
}
