/* ==============================================================================
   MedRegia Public Portal — Base Design System & Core Styles
   Tokens, Typography, Reset, Global Utilities & Layout Wrappers
   ============================================================================== */

:root {
  --bg: #071310;
  --surface-1: #101F1B;
  --surface-2: #162924;
  --surface-glass: rgba(16, 31, 27, 0.94);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #ECEEEC;
  --text-secondary: #9AA39F;
  --text-muted: #69726D;
  --primary: #0F6E56;
  --primary-deep: #04342C;
  --primary-light: rgba(15, 110, 86, 0.25);
  --primary-bright: #5DCAA5;
  --accent-public: #0284C7;
  --accent-business: #C98A3B;
  --accent-alert: #C2185B;
  --accent: #C2185B;
  --accent-light: rgba(194, 24, 91, 0.18);
  --gray-tab: #3D4A45;
  --active-tab: #0F6E56;
  --radius: 12px;
  --highlight: #C2185B;
  --highlight-text: #FFFFFF;

  /* Desktop Portal Tokens */
  --ink: #132420;
  --ink-soft: #3C534C;
  --paper: #F1F3EF;
  --paper-panel: #FFFFFF;
  --teal-deep: #0F3A36;
  --teal-mid: #1F5C55;
  --amber: #C98A3B;
  --amber-soft: #E7C696;
  --line: #DCE3DD;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-x: hidden;
}

p, h1, h2, h3, h4, h5, h6 {
  margin: 0;
}

input, button, textarea, select {
  font-family: inherit;
}

button {
  cursor: pointer;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text, #ECEEEC);
}

.btn-primary {
  background: linear-gradient(135deg, #0F6E56 0%, #0D9488 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(15, 110, 86, 0.35);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #128266 0%, #10A396 100%) !important;
  color: #FFFFFF !important;
}

.btn-primary:active {
  transform: scale(0.98);
}

/* SVG icon standard */
.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Mobile App Viewport Container */
.app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface-2);
  position: relative;
  overflow-x: hidden;
  border-left: 0.5px solid var(--border);
  border-right: 0.5px solid var(--border);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
}

/* View switcher */
.view {
  display: none;
  padding-bottom: 90px;
  animation: fadeInView 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view.active {
  display: block;
}

@keyframes fadeInView {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Generic Utilities */
.card {
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.avail {
  background: rgba(34, 197, 94, 0.15);
  color: #4ADE80;
  border: 0.5px solid rgba(74, 222, 128, 0.3);
}

.badge.busy {
  background: rgba(244, 63, 94, 0.15);
  color: #FB7185;
  border: 0.5px solid rgba(251, 113, 133, 0.3);
}

.avatar {
  border-radius: 50%;
  flex-shrink: 0;
}
