/* ==========================================================================
   DOCTA APP DEMO - DESIGN SYSTEM & STYLESHEET
   Matching Flutter Theme (docta_theme.dart)
   ========================================================================== */

:root {
  /* Brand Tokens */
  --primary-teal: #0D9488;
  --primary-teal-dark: #0F766E;
  --primary-teal-light: #CCFBF1;
  --secondary-indigo: #4F46E5;
  --accent-cyan: #06B6D4;

  /* Status Colors */
  --success-green: #10B981;
  --success-light: #D1FAE5;
  --warning-amber: #F59E0B;
  --warning-light: #FEF3C7;
  --error-red: #EF4444;
  --error-light: #FEE2E2;

  /* Fonts */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  /* Radii & Transitions */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
body.theme-light {
  --bg-page: #F1F5F9;
  --bg-top-nav: rgba(255, 255, 255, 0.85);
  --app-bg: #F8FAFC;
  --app-surface: #FFFFFF;
  --app-surface-variant: #F1F5F9;
  --app-border: #E2E8F0;
  --app-border-focus: #0D9488;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 24px -4px rgba(13, 148, 136, 0.12), 0 8px 16px -6px rgba(0, 0, 0, 0.06);
  --shadow-mockup: 0 25px 60px -15px rgba(15, 23, 42, 0.22), 0 0 0 12px #1E293B, 0 0 0 14px #334155;
  --modal-bg: #FFFFFF;
  --modal-backdrop: rgba(15, 23, 42, 0.65);
  --token-gradient: linear-gradient(135deg, #ECFDF5 0%, #F0FDFA 100%);
  --token-border: #A7F3D0;
}

/* Dark Theme Variables */
body.theme-dark {
  --bg-page: #060913;
  --bg-top-nav: rgba(11, 19, 43, 0.85);
  --app-bg: #0A0F1D;
  --app-surface: #131B2E;
  --app-surface-variant: #1E293B;
  --app-border: #27354F;
  --app-border-focus: #14B8A6;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 20px rgba(13, 148, 136, 0.15);
  --shadow-mockup: 0 30px 70px -15px rgba(0, 0, 0, 0.8), 0 0 0 12px #0f172a, 0 0 0 14px #1e293b;
  --modal-bg: #131B2E;
  --modal-backdrop: rgba(3, 7, 18, 0.8);
  --token-gradient: linear-gradient(135deg, #064E3B 0%, #0F3934 100%);
  --token-border: #059669;
}

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

html, body {
  min-height: 100%;
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

input {
  font-family: inherit;
  outline: none;
}

/* ==========================================================================
   CONFETTI CANVAS
   ========================================================================== */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}

/* ==========================================================================
   TOP NAVIGATION
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-top-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--app-border);
  padding: 12px 24px;
  transition: background var(--transition-smooth), border-color var(--transition-smooth);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-teal) 0%, var(--secondary-indigo) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary-teal) 0%, var(--secondary-indigo) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(13, 148, 136, 0.12);
  color: var(--primary-teal);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 6px;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* View Mode Switcher */
.view-toggle {
  display: flex;
  background: var(--app-surface-variant);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.view-btn.active {
  background: var(--app-surface);
  color: var(--primary-teal);
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  border-color: var(--primary-teal);
  color: var(--primary-teal);
  transform: translateY(-1px);
}

body.theme-light .moon-icon { display: none; }
body.theme-light .sun-icon { display: block; }
body.theme-dark .sun-icon { display: none; }
body.theme-dark .moon-icon { display: block; }



/* ==========================================================================
   MAIN VIEWPORT & DEVICE FRAME
   ========================================================================== */
.main-viewport {
  padding: 30px 16px 50px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 70px);
}

/* Phone Mockup Wrapper */
.device-frame-wrapper {
  width: 100%;
  max-width: 420px;
  transition: max-width var(--transition-smooth);
}

/* Full Web View Mode */
.device-frame-wrapper.full-web-mode {
  max-width: 780px;
}

.device-frame-wrapper.full-web-mode .iphone-mockup {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--app-border);
  min-height: auto;
}

.device-frame-wrapper.full-web-mode .device-notch,
.device-frame-wrapper.full-web-mode .status-bar,
.device-frame-wrapper.full-web-mode .home-indicator,
.device-frame-wrapper.full-web-mode .app-bottom-bar {
  display: none;
}

.device-frame-wrapper.full-web-mode .app-content-scroll {
  padding-bottom: 30px;
}

/* Phone Mockup Frame */
.iphone-mockup {
  position: relative;
  background: var(--app-bg);
  border-radius: 46px;
  box-shadow: var(--shadow-mockup);
  overflow: hidden;
  transition: all var(--transition-smooth);
  border: 4px solid #1E293B;
}

body.theme-light .iphone-mockup {
  border-color: #CBD5E1;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.18), 0 0 0 10px #F1F5F9, 0 0 0 12px #CBD5E1;
}

body.theme-dark .iphone-mockup {
  border-color: #1E293B;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 10px #0F172A, 0 0 0 12px #334155;
}

/* Dynamic Island Notch */
.device-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 26px;
  background: #000;
  border-radius: var(--radius-full);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  gap: 8px;
}

.notch-camera {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0d1527;
  border: 1px solid #1e293b;
}

.notch-sensor {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0a0e17;
}

/* Status Bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--app-bg);
  position: relative;
  z-index: 10;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Home Indicator */
.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: var(--text-muted);
  border-radius: var(--radius-full);
  opacity: 0.6;
}

/* Device Screen */
.device-screen {
  background: var(--app-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 780px;
  overflow: hidden;
}

.device-frame-wrapper.full-web-mode .device-screen {
  height: auto;
  min-height: auto;
  overflow: visible;
}

/* ==========================================================================
   APP HEADER
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-back-btn,
.app-share-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.app-back-btn:hover,
.app-share-btn:hover {
  background: var(--app-surface-variant);
}

.app-header-title {
  text-align: center;
}

.app-header-title h2 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.sub-badge {
  font-size: 11px;
  color: var(--primary-teal);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-teal);
  box-shadow: 0 0 8px var(--primary-teal);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ==========================================================================
   SCROLLABLE APP CONTENT
   ========================================================================== */
.app-content-scroll {
  padding: 16px;
  padding-bottom: 24px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--app-border) transparent;
}

.device-frame-wrapper.full-web-mode .app-content-scroll {
  flex: none;
  padding: 24px 32px;
}

.app-content-scroll::-webkit-scrollbar {
  width: 5px;
}

.app-content-scroll::-webkit-scrollbar-thumb {
  background: var(--app-border);
  border-radius: 10px;
}

/* ==========================================================================
   DOCTOR CARD
   ========================================================================== */
.doctor-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.doc-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.doc-avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid var(--app-surface-variant);
}

.doc-online-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: var(--success-green);
  border: 2px solid var(--app-surface);
  border-radius: 50%;
}

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

.doc-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.doc-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.verified-badge {
  font-size: 11px;
  font-weight: 700;
  color: #0284C7;
  background: rgba(2, 132, 199, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.doc-spec {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  background: var(--app-surface-variant);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rating-pill {
  color: #D97706;
  background: rgba(245, 158, 11, 0.12);
}

/* ==========================================================================
   BOOKING SECTIONS
   ========================================================================== */
.booking-section {
  margin-bottom: 18px;
}

.section-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-header-row .section-label {
  margin-bottom: 0;
}

.slot-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--success-green);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Consultation Mode */
.consultation-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.type-card {
  position: relative;
  background: var(--app-surface);
  border: 1.5px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.type-card input[type="radio"] {
  display: none;
}

.type-card.selected {
  border-color: var(--primary-teal);
  background: rgba(13, 148, 136, 0.05);
}

.type-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--app-surface-variant);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.type-card.selected .type-icon {
  background: var(--primary-teal-light);
  color: var(--primary-teal-dark);
}

.type-details {
  display: flex;
  flex-direction: column;
}

.type-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.type-fee {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-teal);
}

.radio-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
}

.type-card.selected .radio-indicator {
  border-color: var(--primary-teal);
  background: var(--primary-teal);
  box-shadow: inset 0 0 0 2px #fff;
}

/* Day Tabs */
.day-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.day-tab {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all var(--transition-fast);
}

.day-tab .day-name {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.day-tab .day-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.day-tab.active {
  border-color: var(--primary-teal);
  background: var(--primary-teal);
}

.day-tab.active .day-name,
.day-tab.active .day-date {
  color: #fff;
}

/* Time Chips */
.time-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.time-chip {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--transition-fast);
}

.time-chip:hover {
  border-color: var(--primary-teal);
  color: var(--primary-teal);
}

.time-chip.active {
  background: rgba(13, 148, 136, 0.12);
  border-color: var(--primary-teal);
  color: var(--primary-teal);
  font-weight: 700;
}

/* Patient Relation Chips */
.relation-chips {
  margin-bottom: 14px;
}

.relation-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.chip-group {
  display: flex;
  gap: 6px;
}

.relation-chip {
  background: var(--app-surface-variant);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.relation-chip.active {
  background: var(--secondary-indigo);
  color: #fff;
  border-color: var(--secondary-indigo);
}

/* ==========================================================================
   FORM INPUTS & INDIAN PHONE VALIDATION
   ========================================================================== */
.form-group {
  margin-bottom: 14px;
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.input-label .required {
  color: var(--error-red);
}

.input-label .optional {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.phone-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hint-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--app-surface-variant);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--app-surface);
  border: 1.5px solid var(--app-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.input-wrapper:focus-within {
  border-color: var(--app-border-focus);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.input-wrapper.valid {
  border-color: var(--success-green);
}

.input-wrapper.invalid {
  border-color: var(--error-red);
  animation: shake-input 0.35s ease;
}

@keyframes shake-input {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.input-prefix-icon {
  padding-left: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.custom-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 13px 14px;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.custom-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* Phone Wrapper with Flag */
.phone-wrapper {
  display: flex;
  align-items: center;
}

.phone-prefix-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 12px;
  padding-right: 8px;
  user-select: none;
}

.in-flag {
  font-size: 18px;
  line-height: 1;
}

.in-code {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.phone-prefix-badge .divider {
  width: 1px;
  height: 20px;
  background: var(--app-border);
  margin-left: 4px;
}

.phone-input {
  letter-spacing: 0.5px;
  font-weight: 600;
}

.input-validation-status {
  padding-right: 12px;
  display: flex;
  align-items: center;
}

/* Real-Time Phone Validation Feedback Rules Box */
.validation-feedback-box {
  background: var(--app-surface-variant);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--transition-fast);
}

.feedback-rule {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.feedback-rule .rule-icon {
  font-size: 10px;
  width: 14px;
  text-align: center;
}

.feedback-rule.passed {
  color: var(--success-green);
  font-weight: 600;
}

.feedback-rule.passed .rule-icon {
  content: '✓';
  color: var(--success-green);
}

.feedback-rule.failed {
  color: var(--error-red);
}

.error-text {
  display: none;
  font-size: 11px;
  color: var(--error-red);
  margin-top: 4px;
  font-weight: 600;
}

.form-group.has-error .error-text {
  display: block;
}

/* Symptom Quick Chips */
.symptom-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.symptom-chip {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-full);
  padding: 6px 11px;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.symptom-chip.active {
  background: rgba(13, 148, 136, 0.12);
  border-color: var(--primary-teal);
  color: var(--primary-teal);
  font-weight: 600;
}

/* ==========================================================================
   BILL SUMMARY CARD
   ========================================================================== */
.bill-summary-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 16px 0 14px;
}

.bill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.fee-text {
  font-weight: 600;
  color: var(--text-primary);
}

.free-pill {
  font-size: 10px;
  font-weight: 800;
  color: var(--success-green);
  background: rgba(16, 185, 129, 0.15);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.included-text {
  font-size: 11px;
  color: var(--text-muted);
}

.bill-divider {
  height: 1px;
  background: var(--app-border);
  margin: 8px 0;
}

.bill-row.total-row {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.total-amount {
  font-size: 16px;
  font-family: var(--font-heading);
  color: var(--primary-teal);
}

.security-guarantee {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--app-surface-variant);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   PAY CTA BUTTON
   ========================================================================== */
.cta-container {
  margin-top: 10px;
}

.pay-cta-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-teal) 0%, var(--primary-teal-dark) 100%);
  color: #fff;
  padding: 15px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--transition-fast);
}

.pay-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.45);
}

.pay-cta-btn:active {
  transform: translateY(0);
}

.btn-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lock-icon {
  display: flex;
  align-items: center;
}

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.pay-cta-btn.loading .btn-text {
  display: none;
}

.pay-cta-btn.loading .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.cta-subtext {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* ==========================================================================
   BOTTOM APP BAR
   ========================================================================== */
.app-bottom-bar {
  display: flex;
  justify-content: space-around;
  padding: 8px 12px 18px;
  background: var(--app-surface);
  border-top: 1px solid var(--app-border);
  margin-top: auto;
}

.bot-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.bot-nav-item.active {
  color: var(--primary-teal);
}

/* ==========================================================================
   MODAL - PAYMENT SUCCESS & APPOINTMENT CONFIRMATION
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--modal-backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-container {
  background: var(--modal-bg);
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--app-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  padding: 28px 24px 24px;
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-backdrop.open .modal-container {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--app-surface-variant);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--app-border);
  color: var(--text-primary);
}

/* Success Icon & Pulse Animation */
.success-animation-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  animation: ripple 2s infinite ease-out;
}

.pulse-2 {
  animation-delay: 0.6s;
}

@keyframes ripple {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.success-icon-badge {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.check-svg {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: draw-check 0.6s cubic-bezier(0.65, 0, 0.45, 1) 0.2s forwards;
}

@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}

.modal-header-text {
  text-align: center;
  margin-bottom: 20px;
}

.success-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.success-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Random Appointment Highlight Card */
.appointment-highlight-card {
  background: var(--token-gradient);
  border: 1.5px dashed var(--token-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 18px;
  text-align: center;
  position: relative;
}

.appt-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.appt-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary-teal);
}

.status-live-chip {
  font-size: 10px;
  font-weight: 800;
  background: var(--success-green);
  color: #fff;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.appt-number-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 6px 0;
}

.random-number {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-primary);
}

.copy-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-teal);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.copy-pill-btn:hover {
  background: var(--primary-teal);
  color: #fff;
}

.appt-note {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Receipt Details Card */
.receipt-card {
  background: var(--app-surface-variant);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin-bottom: 8px;
}

.receipt-label {
  color: var(--text-secondary);
}

.receipt-val {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.highlight-val {
  color: var(--primary-teal);
  font-weight: 700;
}

.receipt-divider {
  height: 1px;
  border-bottom: 1px dashed var(--app-border);
  margin: 10px 0;
}

.total-receipt-row {
  margin-bottom: 0;
  font-size: 14px;
}

.total-receipt-row .receipt-label {
  font-weight: 700;
  color: var(--text-primary);
}

.total-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--success-green);
}

/* Modal Actions */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-btn {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.primary-action {
  background: var(--secondary-indigo);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.45);
}

.secondary-action {
  background: var(--app-surface-variant);
  color: var(--text-secondary);
  border: 1px solid var(--app-border);
}

.secondary-action:hover {
  color: var(--text-primary);
  background: var(--app-border);
}

/* ==========================================================================
   TOAST POPUP
   ========================================================================== */
.toast-popup {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #0F172A;
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .top-nav {
    padding: 10px 14px;
  }
  .main-viewport {
    padding: 12px 8px 30px;
  }
  .iphone-mockup {
    border-radius: 28px;
    border-width: 2px;
  }
}
