/* Reminess Design Tokens and Base Styles (mapped to uploaded design system) */
:root {
  /* Colors (dark + Reminess Blue accent) */
  --bg: #0A0D14;                 /* near-black with cool tint */
  --bg-panel: #121620;           /* raised panel */
  --bg-raised: #1A1F2B;
  --card: #121620;
  --text: #E0E6F0;               /* soft white */
  --text-inverse: #0A0D14;
  --text-muted: #9BA4B5;
  --border: #2F3747;             /* subtle cool border */
  --border-soft: #222833;
  --brand: #9CB7FF;              /* Reminess Blue (hero periwinkle) */
  --brand-soft: #9CB7FF1A; /* A slightly more subtle soft brand for backgrounds */
  --danger: #ff6b6b;
  --danger-soft: #ff6b6b1A;

  /* Radii */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-pill: 999px;

  /* Spacing scale */
  --sp-4: 12px;
  --sp-6: 16px;

  /* Typography: Inter (variable) or system UI stack; serif only for large heroes */
  --font-body: "Inter var", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-heading: var(--font-body);
  --fs-md: 17px;
  --fs-h5: 18px;

  /* Motion */
  --dur-base: .15s;
  --ease-standard: cubic-bezier(.2,.7,.2,1);
  --focus-ring: 2px solid var(--brand);
  --focus-offset: 2px;

  /* Motion & Animation Tokens */
  --dur-fast: 0.15s;
  --dur-standard: 0.25s;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1); /* A smooth easing for transitions */

  /* Interaction & Depth Tokens */
  --shadow-lift: 0 8px 25px -5px rgba(0,0,0,0.2), 0 4px 10px -6px rgba(0,0,0,0.2);
  --focus-ring-color: #9CB7FF80; /* A semi-transparent brand color for focus rings */

  /* Shadows */
  --shadow: 0 6px 18px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
}

/* Light Theme - Inspired by lovable.dev */
html.light {
  /* Colors (light + calm blue accent) */
  --bg: hsl(0, 0%, 98%);
  --bg-panel: hsl(0, 0%, 100%);
  --bg-raised: hsl(0, 0%, 100%);
  --card: hsl(0, 0%, 100%);
  --text: hsl(220, 15%, 20%);
  --text-inverse: hsl(0, 0%, 100%);
  --text-muted: hsl(220, 10%, 45%);
  --border: hsl(220, 10%, 90%);
  --border-soft: hsl(220, 10%, 93%);
  --brand: hsl(215, 70%, 65%);
  --brand-soft: hsl(215, 70%, 65%, 0.1);
  --danger: hsl(0, 84%, 60%);
  --danger-soft: hsl(0, 84%, 60%, 0.1);

  /* Shadows - softer for light theme */
  --shadow: 0 4px 24px hsl(220 20% 20% / 0.04);
  --shadow-sm: 0 2px 10px hsl(220 20% 20% / 0.03);
  --shadow-md: 0 10px 30px hsl(220 20% 20% / 0.08);
  --shadow-lift: 0 8px 25px -5px hsl(220 20% 20% / 0.12), 0 4px 10px -6px hsl(220 20% 20% / 0.08);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
}

/* Headings (UI/product scale) */
h1, h2, h3, h4 { font-family: var(--font-body); letter-spacing: 0; margin: 0 0 10px; color: var(--text); }
h1 { font-size: clamp(32px, 3.2vw, 40px); line-height: 1.2; font-weight: 700; }
h2 { font-size: clamp(24px, 2.4vw, 28px); line-height: 1.25; font-weight: 600; }
h3 { font-size: clamp(20px, 2.0vw, 22px); line-height: 1.3; font-weight: 600; }
h4 { font-size: 18px; line-height: 1.3; font-weight: 600; }

/* Readability helpers */
.measure { max-width: 70ch; }
@media (max-width: 768px) { .measure { max-width: 45ch; } }
.text-sm { font-size: 14.5px; line-height: 1.5; }
.text-xs { font-size: 12.5px; line-height: 1.45; }

.container { max-width: 1160px; margin: 0 auto; padding: 22px; }
.grid { display: grid; gap: 20px; }
.two-col { grid-template-columns: 1.1fr 1fr; }
.row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition-property: transform, border-color, background-color, box-shadow;
  transition-duration: var(--dur-standard);
  transition-timing-function: var(--ease-out);
}
.card:hover,
.card.is-interactive:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  background-color: var(--brand-soft);
  box-shadow: var(--shadow-lift);
}
.card-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom: var(--sp-4) }
.card-title{ font-family: var(--font-heading); font-size: var(--fs-h5) }
.card-sub{ color: var(--text-muted) }

.text-gradient {
  color: var(--text);
}

/* Dark mode: blue text */
html.dark .text-gradient {
  color: var(--brand);
}

/* Buttons (from components.css) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6ch;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  font-size: 16px;
  transition-property: transform, background-color, border-color;
  transition-duration: var(--dur-fast);
  transition-timing-function: var(--ease-out);
}
.btn:hover {
  background-color: var(--brand-soft);
  border-color: var(--brand);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button Style */
.btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
  color: var(--text-inverse);
  box-shadow: 0 4px 15px -5px rgba(156, 183, 255, 0.4);
}
.btn-primary:hover {
  filter: brightness(1.1);
  background-color: var(--brand);
  box-shadow: 0 6px 20px -5px rgba(156, 183, 255, 0.5);
}
.btn-outline {
  background: transparent;
  color: var(--text);
}
.btn-outline:hover {
  background-color: var(--brand-soft);
}
.btn-ghost {
  background: #00000060;
  color: var(--text);
}
.btn-ghost:hover {
  background: #00000085;
}
.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover {
  background-color: var(--danger-soft);
  border-color: var(--danger);
}

.nav-link {
  text-decoration: none; color: var(--text);
  padding: 8px 10px; border-radius: 8px;
}
.nav-link:hover { background: #f0f2f6; }

.pill { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); background: #fff; color: var(--text-muted); }

h1, h2, h3 { margin: 0 0 8px; }
.muted { color: var(--text-muted); }
.spacer-sm { height: 10px; }
.spacer { height: 16px; }
.spacer-lg { height: 24px; }
.section-title { font-weight: 700; font-size: 18px; }

/* Inputs (from components.css) */
.field{ display:flex; flex-direction:column; gap:6px }
.label{ font-weight:600; color: var(--text); font-family: var(--font-body) }
.input, .select, .textarea{
  width:100%; background: var(--bg-panel); color: var(--text);
  border:1px solid var(--border); border-radius: var(--r-lg);
  padding: 10px 12px; font: inherit; min-height: 44px; font-size: 16px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.textarea{ min-height: 120px; resize: vertical }
.input::placeholder, .textarea::placeholder{ color: #ffffff66 }
.input:focus, .select:focus, .textarea:focus{
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring-color);
}

/* Table (from components.css) */
.table{ width:100%; border-collapse: collapse; font-size: var(--fs-md) }
.table th, .table td{ padding: 12px 14px; border-bottom:1px solid var(--border-soft) }
.table th{ text-align:left; font-weight:600; color:var(--text); font-family: var(--font-body) }
.table tr:hover td{ background:#ffffff08 }
.table.zebra tr:nth-child(even) td{ background:#ffffff06 }

/* Sticky header (matches nav partial) */
.rn-nav { position: sticky; top: 0; z-index: 1000; background: rgba(10,13,20,0.85); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.rn-nav-inner { max-width: 1160px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; min-height: 68px; box-sizing: border-box; }
.rn-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); text-decoration: none; font-family: var(--font-heading); font-weight: 700; font-size: 22px; transition: filter var(--dur-fast) var(--ease-out); }
.rn-brand:hover { filter: brightness(1.1); }
.rn-nav-links { display: flex; align-items: center; gap: 12px; }
.rn-link { color: var(--text); text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: var(--r-pill); transition: background-color var(--dur-fast) var(--ease-out); }
.rn-link:hover { background: var(--brand-soft); }
.rn-user { position: relative; }
.rn-user-btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--border); color: var(--text); padding: 8px 16px; border-radius: var(--r-pill); cursor: pointer; font-weight: 500; transition: background-color var(--dur-fast) var(--ease-out); }
.rn-user-btn:hover { background: var(--brand-soft); }
.rn-dd { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lift); display: none; overflow: hidden; padding: 6px; }
.rn-dd.open { display: block; }
.rn-dd a { display: block; padding: 10px 14px; color: var(--text); text-decoration: none; border-radius: var(--r-sm); font-weight: 500; }
.rn-dd a:hover { background: var(--brand-soft); }

/* Toast (from components.css) */
#toast { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 9999; }
.toast{ background: var(--bg-raised); border:1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding:12px 16px; }
.toast.success{ border-color: #5dd39e66 }
.toast.warn{ border-color: #f0c67466 }
.toast.error{ border-color: #ff6b6b66 }

/* Banners and flash */
.banner{ padding:12px 16px; border-radius: var(--r-md); border:1px solid var(--border) }
.banner.info{ background:#8ecae61a; border-color:#8ecae666 }
.banner.warn{ background:#f0c6741a; border-color:#f0c67466 }
.banner.error{ background:#ff6b6b1a; border-color:#ff6b6b66 }
.flash-messages { margin: 12px 0; }
.flash-message { padding: 12px; border-radius: var(--r-lg); margin-bottom: 8px; border: 1px solid var(--border); background: var(--bg-panel); }
.flash-success { border-color: #5dd39e66; }
.flash-error { border-color: #ff6b6b66; }
.flash-info { border-color: #8ecae666; }

/* Responsive */
@media (max-width: 940px) {
  .two-col { grid-template-columns: 1fr; }
  .nav-link.desktop-only { display: none; }
}

/* Landing cards layout: equal height and aligned actions */
.cards-landing { }
.cards-landing .card { display:flex; flex-direction:column; min-height: 420px; }
.cards-landing .card > .card-actions { margin-top: auto; }
.cards-landing .card ul { padding-left: 18px; }

/* Feed layout to mirror design system */
.feed{ display:grid; grid-template-columns:2fr 1fr; gap:24px; margin-top: 16px }
@media (max-width: 960px){ .feed{ grid-template-columns:1fr } }
.surface{ background: var(--bg-panel); border:1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow) }

/* Home actions: consistent button sizing */
.home-actions .btn { min-width: 200px; justify-content: center; }

/* Utility layout classes to support dashboard/onboarding design */
.stack { display: grid; gap: 12px; }
.cluster { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card-lg { padding: 20px; }

/* Full-bleed helper */
.full-bleed { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

/* CTA pill (fallback if rem.css not loaded first) */
a.cta { display:inline-block; padding:12px 18px; border-radius:999px; background: var(--brand); color: var(--text-inverse); text-decoration:none; font-weight:700 }
a.cta:hover{ filter: brightness(1.05) }

