/* ============================================================
   ClinicaRN — shared.css  (place at root alongside HTML files)
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;700;800&family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600&family=Outfit:wght@400;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ══════════════════════════════════════════
   1 · DESIGN TOKENS
   ══════════════════════════════════════════ */

:root {
  /* -- Main palette (green / teal accent) -- */
  --bg:        #06080f;
  --surface:   #0d1220;
  --border:    rgba(255,255,255,.07);
  --accent:    #22c5a0;
  --text:      #f0f4ff;
  --muted:     rgba(240,244,255,.45);

  /* -- Auth palette (indigo accent) -- */
  --auth-bg:       #050507;
  --auth-surface:  #0c0c10;
  --auth-primary:  #6366f1;
  --auth-primary-l:#818cf8;
  --auth-text:     #f4f4f8;
  --auth-muted:    rgba(244,244,248,.45);
  --auth-border:   rgba(255,255,255,.07);
  --auth-error:    #fb7185;
  --auth-input-bg: #0a0a0e;

  /* -- Typography -- */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --font-ui:      'Outfit', sans-serif;
  --font-code:    'JetBrains Mono', monospace;
}

/* ══════════════════════════════════════════
   2 · RESET
   ══════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

html, body {
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════
   3 · KEYFRAMES
   ══════════════════════════════════════════ */

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

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

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(34,197,160,.5); }
  50%       { box-shadow: 0 0 0 7px rgba(34,197,160, 0); }
}

@keyframes breathe {
  0%, 100% { opacity: 1; transform: scale(1);   box-shadow: 0 0 0 0   rgba(99,102,241,.6); }
  50%       { opacity: .8; transform: scale(.9); box-shadow: 0 0 0 6px rgba(99,102,241, 0); }
}

/* ══════════════════════════════════════════
   4 · BACKGROUND GRID UTILITY
   ══════════════════════════════════════════ */

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(34,197,160,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,197,160,.03) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* auth-flavour grid */
.bg-grid-auth,
body.auth-theme::before {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(99,102,241,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.025) 1px, transparent 1px);
  background-size: 48px 48px;
}
body.auth-theme::before { content: ''; }

/* ══════════════════════════════════════════
   5 · NAV  (main theme)
   ══════════════════════════════════════════ */

nav.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(6,8,15,.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

/* brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
.brand-name {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 800;
  color: var(--text);
}
.brand-name span { color: var(--accent); }

/* nav pill button */
.btn-nav {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .08em;
  padding: 6px 14px;
  border: 1px solid rgba(34,197,160,.35);
  border-radius: 50px;
  text-transform: uppercase;
  transition: background .2s, color .2s;
}
.btn-nav:hover {
  background: rgba(34,197,160,.1);
}

/* ══════════════════════════════════════════
   6 · NAV  (auth / header-bar theme)
   ══════════════════════════════════════════ */

.header-bar {
  position: relative;
  z-index: 1;
  padding: 16px 20px;
  border-bottom: 1px solid var(--auth-border);
  background: rgba(5,5,7,.88);
  backdrop-filter: blur(20px);
}

.brand-orb {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(99,102,241,.35), rgba(34,211,238,.15));
  border: 1px solid rgba(99,102,241,.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-orb-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--auth-primary);
  animation: breathe 2.2s ease-in-out infinite;
}

/* ══════════════════════════════════════════
   7 · CARDS
   ══════════════════════════════════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 22px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  animation: fadeInUp .5s ease-out forwards;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34,197,160,.4), transparent);
}

/* staggered animation helpers */
.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(4) { animation-delay: .18s; }
.card:nth-child(5) { animation-delay: .24s; }
.card:nth-child(6) { animation-delay: .30s; }

.card h2 {
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.card p {
  font-size: .92rem;
  color: var(--text);
  line-height: 1.5;
  font-weight: 500;
}

/* auth card variant */
.auth-card {
  width: 100%;
  max-width: 450px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.5);
}

/* ══════════════════════════════════════════
   8 · BUTTONS
   ══════════════════════════════════════════ */

/* primary CTA (auth theme) */
.btn-primary {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--auth-primary), #4f46e5);
  color: #fff;
  box-shadow: 0 8px 24px rgba(99,102,241,.25);
  transition: opacity .2s, transform .1s;
  letter-spacing: -.01em;
}
.btn-primary:active  { transform: scale(.97); opacity: .9; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

/* sky-blue variant (used in auth.html) */
.btn-sky {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  border: none;
  background: #38bdf8;
  color: #0b1120;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-sky:active { opacity: .85; }

/* ══════════════════════════════════════════
   9 · FORM INPUTS
   ══════════════════════════════════════════ */

.input-label {
  font-family: var(--font-code);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--auth-primary-l);
  margin-bottom: 8px;
  display: block;
}

input.field {
  width: 100%;
  height: 52px;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  padding: 0 16px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 16px;
  transition: border-color .2s;
}
input.field:focus { border-color: rgba(99,102,241,.5); }

/* dark minimal variant (auth.html) */
input.field-dark {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  outline: none;
  margin-bottom: 12px;
}
input.field-dark:focus { border-color: #38bdf8; }

/* console / error messages */
.console-msg {
  width: 100%;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--font-code);
  font-size: 12px;
  margin-bottom: 22px;
  display: none;
  animation: fadeIn .25s ease;
}
.console-error { border-left: 3px solid var(--auth-error); color: var(--auth-error); }
.console-info   { border-left: 3px solid var(--auth-primary-l); color: var(--auth-primary-l); }

/* ══════════════════════════════════════════
   10 · HERO SECTION
   ══════════════════════════════════════════ */

.hero {
  position: relative;
  z-index: 10;
  padding: 40px 20px 28px;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--accent);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--accent);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff, rgba(34,197,160,.8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: .95rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 400px;
}

/* ══════════════════════════════════════════
   11 · FOOTER
   ══════════════════════════════════════════ */

footer.main-footer {
  position: relative;
  z-index: 10;
  padding: 28px 20px;
  text-align: center;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: .65rem;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.footer-links {
  margin-top: auto;
  padding: 28px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer-links a {
  color: var(--auth-primary-l);
  text-decoration: none;
  font-weight: 600;
  font-size: .88rem;
}
.footer-links a:hover { color: #fff; }

/* ══════════════════════════════════════════
   12 · PAGE-PUSH UTILITY  (camera / safe area)
   See shared.js  pushOutOfCamera()
   ══════════════════════════════════════════ */

/* Instant version — no JS needed if you just add this class to <body> */
body.push-safe {
  padding-top:    env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left:   env(safe-area-inset-left);
  padding-right:  env(safe-area-inset-right);
}

/* JS-driven version (applied by shared.js) */
.page-frame {
  position: relative;
  transform-origin: top center;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
