﻿/* ============================================================
   FitPlat â€” Shared Design System
   White-background, Inter font, indigo primary.
   Covers: auth pages, dashboard pages, tables, charts, cards.
   ============================================================ */

:root {
  --bg:          #ffffff;
  --surface:     #ffffff;
  --soft:        #f8fafc;
  --border:      #e5e7eb;
  --primary:     #4f46e5;
  --primary-h:   #4338ca;
  --primary-s:   #eef2ff;
  --accent:      #06b6d4;
  --success:     #10b981;
  --warn:        #f59e0b;
  --danger:      #ef4444;
  --text:        #0f172a;
  --muted:       #64748b;
  --radius:      14px;
  --radius-sm:   9px;
  --shadow:      0 1px 3px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.05);
  --shadow-lg:   0 8px 32px -8px rgba(79,70,229,.18);
  --font:        'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --trans:       .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

/* ---- Typography ---- */
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; font-weight: 700; }

/* ---- Links ---- */
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-h); }

/* ============================================================
   AUTH PAGES  â€” login, signup, forgot-pwd, reset-pwd, resend
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
@media (max-width: 800px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

/* Left branding panel */
.auth-brand {
  background: linear-gradient(145deg, #4f46e5 0%, #06b6d4 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  color: #fff;
  gap: 20px;
}
.auth-brand .brand-logo {
  width: 68px; height: 68px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 10px;
}
.auth-brand .brand-logo img {
  width: 48px; height: 48px;
  object-fit: cover;
  display: block;
}
.auth-brand h1 { font-size: 2.4rem; color: #fff; text-align: center; }
.auth-brand p  { color: rgba(255,255,255,.82); text-align: center; max-width: 300px; font-size: 1.05rem; }
.auth-brand .brand-pills {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-top: 12px;
}
.auth-brand .pill {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .875rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
}
.auth-brand .brand-footer {
  margin-top: auto;
  font-size: .8rem;
  color: rgba(255,255,255,.55);
  text-align: center;
}

/* Right form panel */
.auth-form-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  min-height: 100vh;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.auth-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.15rem; color: var(--text);
}
.auth-logo-mark {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 6px;
}
.auth-logo-mark img {
  width: 24px; height: 24px;
  object-fit: cover;
  display: block;
}
.auth-lang {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .85rem; font-weight: 600; color: var(--muted);
  background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
  transition: background var(--trans);
}
.auth-lang:hover { background: var(--soft); }
.auth-lang-menu {
  position: absolute; right: 0; top: 110%;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 6px; min-width: 130px; z-index: 60; display: none;
}
.auth-lang-menu.open { display: block; }
.auth-lang-menu button {
  display: block; width: 100%; text-align: left; background: none;
  border: 0; padding: 9px 12px; border-radius: 7px;
  font-size: .95rem; font-weight: 500; cursor: pointer; color: var(--text);
}
.auth-lang-menu button:hover { background: var(--soft); }
.auth-lang-menu button.active { background: var(--primary-s); color: var(--primary); }

.auth-heading { font-size: 1.6rem; margin-bottom: 6px; }
.auth-sub      { color: var(--muted); margin: 0 0 24px; font-size: .95rem; }

/* Alerts */
.alert { border-radius: var(--radius-sm); padding: 12px 14px; font-size: .93rem; margin-bottom: 16px; border: none; }
.alert-danger  { background: #fee2e2; color: #b91c1c; }
.alert-success { background: #ecfdf5; color: #065f46; }

/* Form */
.form-field { margin-bottom: 16px; }
.form-label {
  display: block; font-size: .9rem; font-weight: 600;
  margin-bottom: 6px; color: var(--text);
}
.form-inp {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .97rem; font-family: var(--font);
  background: #fff; color: var(--text); outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.form-inp:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-inp::placeholder { color: #94a3b8; }
.form-inp.is-invalid { border-color: var(--danger); }

.form-control {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .97rem; font-family: var(--font);
  background: #fff; color: var(--text); outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(79,70,229,.12) !important;
  outline: none;
}

.radio-group { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 2px; }
.radio-item {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: .95rem;
}
.radio-item input { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }

/* Buttons */
.btn-submit {
  width: 100%; padding: 13px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: 1rem;
  font-weight: 700; font-family: var(--font); cursor: pointer;
  transition: background var(--trans), transform var(--trans), box-shadow var(--trans);
  margin-top: 4px;
}
.btn-submit:hover { background: var(--primary-h); transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* Generic action buttons used across inner pages */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px;
  font-weight: 600; font-size: .93rem; font-family: var(--font);
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--trans); text-decoration: none;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-h); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-ghost    { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover    { background: var(--soft); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover   { background: #dc2626; color: #fff; }

/* Form links row */
.form-links {
  display: flex; justify-content: space-between;
  align-items: center; margin-top: 18px;
  font-size: .9rem; flex-wrap: wrap; gap: 8px;
}
.form-links a { color: var(--primary); font-weight: 500; }

/* OLD class kept for back-compat (login-button is still referenced by i18n-value) */
.login-button {
  width: 100%; padding: 13px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: 1rem;
  font-weight: 700; font-family: var(--font); cursor: pointer; display: block;
  transition: background var(--trans);
}
.login-button:hover { background: var(--primary-h); }

/* ============================================================
   INNER PAGE  â€” pages with top-bar (body-data, 3d-body, etc.)
   ============================================================ */
.page-body {
  background: var(--bg);
  padding-top: 64px; /* clear top-bar */
  min-height: 100vh;
}
.page-wrap { max-width: 1080px; margin: 0 auto; padding: 32px 20px 80px; }
.page-heading {
  font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em;
  display: flex; align-items: center; gap: 10px; margin: 0 0 6px;
}
.page-lead { color: var(--muted); margin: 0 0 28px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  transition: box-shadow var(--trans);
}
.card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; }
.card-sub   { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }

/* Two-column grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* Badge / eyebrow */
.badge-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--primary); background: var(--primary-s);
  padding: 4px 10px; border-radius: 999px;
}
.badge-new { background: #ecfdf5; color: var(--success); }

/* ---- Tables ---- */
.tbl {
  width: 100%; border-collapse: collapse; background: var(--surface);
  font-size: .93rem;
}
.tbl th {
  background: var(--soft); color: var(--muted); font-weight: 600;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--soft); }

/* Bootstrap table override */
.table { background: var(--surface); }
.table thead th {
  background: var(--soft); color: var(--muted);
  font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; border-bottom: 1px solid var(--border);
}
.table td, .table th { border-color: var(--border); }
.table-striped > tbody > tr:nth-of-type(odd) > td { background: var(--soft); }
.table-hover > tbody > tr:hover > td { background: #f1f5f9; }

/* Modern input inside tables */
.modern-input {
  border: 1px solid var(--border); border-radius: 7px;
  padding: 7px 10px; font-size: .95rem; width: 90%;
  font-family: var(--font); background: #fff;
}
.modern-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,70,229,.1); }

/* Edit / Save / Back buttons */
.button-container { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 0 12px; }
.edit-btn, .save-btn, .back-btn {
  padding: 10px 20px; border: none; border-radius: 999px;
  font-weight: 700; font-size: .93rem; cursor: pointer; font-family: var(--font);
  transition: all var(--trans);
}
.edit-btn { background: var(--primary); color: #fff; }
.edit-btn:hover { background: var(--primary-h); }
.save-btn { background: var(--success); color: #fff; }
.save-btn:hover { background: #059669; }
.back-btn { background: var(--soft); color: var(--text); border: 1px solid var(--border); }
.back-btn:hover { background: var(--border); }

/* Zoom buttons for 3D viewer */
.zoom-button {
  padding: 10px 18px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--primary); font-size: 1rem; cursor: pointer;
  transition: all var(--trans);
}
.zoom-button:hover { background: var(--primary-s); border-color: var(--primary); }

/* Chart containers */
.chart-container { margin: 24px 0; }
.chart-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }

/* Dataframe (exercise/meal tables) */
.dataframe { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dataframe th {
  background: var(--soft); color: var(--muted);
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.dataframe td { padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dataframe .main-row:hover td { background: var(--soft); cursor: pointer; }
.dataframe .additional-row td { background: #fafbff; white-space: normal; }
.highlight { background: #fef9c3 !important; }

/* Camera / QR scan page */
.camera-container { padding: 24px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.camera-button {
  padding: 12px 22px; background: var(--primary); color: #fff;
  border: none; border-radius: 999px; font-size: .97rem; font-weight: 600;
  cursor: pointer; font-family: var(--font); transition: all var(--trans);
  display: inline-flex; align-items: center; gap: 8px;
}
.camera-button:hover { background: var(--primary-h); }
#camera-preview { width: 100%; max-width: 500px; border-radius: var(--radius); border: 1px solid var(--border); }
#photo-container { width: 100%; max-width: 500px; }
#photo-container img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
#warning-container {
  display: none; background: #fee2e2; color: #b91c1c;
  padding: 12px 16px; border-radius: var(--radius-sm); margin-top: 6px; font-weight: 600;
}

/* Profile QR */
.qr-code { display: flex; justify-content: center; align-items: center; margin-top: 24px; }

/* Error page */
.error-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
.error-card {
  max-width: 420px; width: 100%; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 40px 32px; text-align: center;
}
.error-icon { font-size: 3rem; color: var(--danger); margin-bottom: 14px; }
.error-heading { font-size: 1.5rem; margin-bottom: 10px; }
.error-message { color: var(--muted); margin-bottom: 22px; }
.error-button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; background: var(--primary); color: #fff;
  border-radius: 999px; font-weight: 700; font-size: .97rem;
  transition: all var(--trans); text-decoration: none;
}
.error-button:hover { background: var(--primary-h); color: #fff; }

/* Eye-toggle password input wrapper */
.inp-eye-wrap { position: relative; }
.inp-eye-wrap .form-inp { padding-right: 44px; }
.inp-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: .95rem; padding: 4px; transition: color var(--trans);
  display: flex; align-items: center;
}
.inp-eye:hover { color: var(--primary); }

/* Responsive utils */
@media (max-width: 600px) {
  .page-wrap { padding: 20px 14px 60px; }
  .card { padding: 16px; }
  .auth-form-wrap { padding: 24px 16px; }
}

/* ============================================================
   SUBSCRIPTION / PRICING COMPONENTS
   ============================================================ */

/* Subscription plan badge in nav/topbar */
.plan-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; text-decoration: none;
  transition: opacity .15s;
}
.plan-pill:hover { opacity: .8; }
.plan-pill.free  { background: #f1f5f9; color: #475569; }
.plan-pill.pro   { background: var(--primary-s); color: var(--primary); }
.plan-pill.elite { background: #1e293b; color: #f8fafc; }

/* Feature comparison highlights */
.feat-highlight {
  background: linear-gradient(135deg,#f5f3ff,#ecfeff);
  border: 1px solid #c7d2fe; border-radius: 12px;
  padding: 18px 20px; display: flex; gap: 12px; align-items: flex-start;
  margin-bottom: 12px;
}
.feat-highlight-icon { font-size: 1.4rem; flex-shrink: 0; }
.feat-highlight h4 { margin: 0 0 4px; font-size: .97rem; }
.feat-highlight p  { margin: 0; font-size: .88rem; color: var(--muted); }

/* Stat cards (used on dashboard + admin) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; box-shadow: var(--shadow);
}
.stat-card .stat-val { font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; }
.stat-card .stat-lbl { color: var(--muted); font-size: .82rem; margin-top: 3px; }
.stat-card .stat-trend { font-size: .8rem; font-weight: 600; margin-top: 6px; }
.stat-card .stat-trend.up   { color: var(--success); }
.stat-card .stat-trend.down { color: var(--danger); }

/* Toast / snackbar (global) */
.g-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 13px 18px; border-radius: 12px; font-size: .92rem; font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,.14); display: none;
  align-items: center; gap: 10px; max-width: 360px;
}
.g-toast.show { display: flex; }
.g-toast.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.g-toast.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.g-toast.info    { background: var(--primary-s); color: var(--primary); border: 1px solid #c7d2fe; }

/* Loading spinner overlay */
.spinner-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,.7);
  z-index: 9000; display: none; align-items: center; justify-content: center;
}
.spinner-overlay.show { display: flex; }
.spinner {
  width: 42px; height: 42px; border: 4px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Progress / onboarding steps */
.steps { display: flex; gap: 0; counter-reset: step; margin-bottom: 28px; }
.step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 6px; text-align: center; position: relative;
}
.step::before {
  counter-increment: step; content: counter(step);
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--soft); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: var(--muted);
}
.step.active::before { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.done::before   { background: var(--success); border-color: var(--success); color: #fff; content: '✓'; }
.step-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.step.active .step-label { color: var(--primary); font-weight: 600; }
.step:not(:last-child)::after {
  content: ''; position: absolute; top: 15px; left: calc(50% + 16px);
  width: calc(100% - 32px); height: 2px; background: var(--border);
}
.step.done:not(:last-child)::after { background: var(--success); }

/* ── Skeleton loading shimmer ────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -800px 0; }
  100% { background-position:  800px 0; }
}
.skeleton {
  background: linear-gradient(90deg,#f0f0f0 25%,#e8e8e8 50%,#f0f0f0 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-text  { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-title { height: 22px; width: 55%; margin-bottom: 12px; border-radius: 4px; }
.skeleton-card  { height: 120px; border-radius: 14px; }
.skeleton-avatar{ width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; }

/* ── Focus-visible ring (keyboard accessibility) ─────────────────── */
:focus-visible {
  outline: 2.5px solid var(--primary, #4f46e5);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Reduced-motion overrides ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

