/* ================================================================
   BioLink — Design System v2
   Theme: Blue / Purple / Clean White
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* ── Core palette ── */
  --bg:       #f0f4ff;
  --surface:  #ffffff;
  --surface2: #f7f9ff;
  --surface3: #eef2ff;
  --border:   #dde3f5;
  --border2:  #c7d2f0;

  /* ── Brand ── */
  --accent:   #4f46e5;          /* indigo */
  --accent-h: #4338ca;          /* hover */
  --accent2:  #7c3aed;          /* purple */
  --accent3:  #0ea5e9;          /* sky */
  --accent-soft: rgba(79,70,229,.1);
  --accent2-soft: rgba(124,58,237,.1);

  /* ── Text ── */
  --text:     #0f172a;
  --text-2:   #334155;
  --muted:    #64748b;
  --muted2:   #94a3b8;

  /* ── Semantic ── */
  --green:    #10b981;
  --green-s:  rgba(16,185,129,.1);
  --red:      #ef4444;
  --red-s:    rgba(239,68,68,.1);
  --orange:   #f59e0b;
  --orange-s: rgba(245,158,11,.1);

  /* ── Glow / shadow ── */
  --glow:     rgba(79,70,229,.2);
  --shadow-sm: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --shadow:    0 4px 12px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.05);
  --shadow-lg: 0 10px 30px rgba(15,23,42,.1), 0 4px 12px rgba(15,23,42,.06);

  /* ── Spacing & shape ── */
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* ── Typography ── */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;
  --transition:   0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; color: var(--text); }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-h); }
p { color: var(--text-2); line-height: 1.65; }

/* ── Layout ── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }

/* ── Gradient bg shapes ── */
.orb { position: fixed; border-radius: 50%; filter: blur(100px); pointer-events: none; z-index: 0; }
.orb-1 { width:600px;height:600px;background:radial-gradient(circle,rgba(79,70,229,.12),transparent 70%);top:-200px;left:-100px;animation:float1 20s ease-in-out infinite; }
.orb-2 { width:500px;height:500px;background:radial-gradient(circle,rgba(124,58,237,.1),transparent 70%);top:40%;right:-150px;animation:float2 24s ease-in-out infinite; }
.orb-3 { width:400px;height:400px;background:radial-gradient(circle,rgba(14,165,233,.08),transparent 70%);bottom:0;left:20%;animation:float3 28s ease-in-out infinite; }

/* ── Navbar ── */
nav.main-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 14px 0;
  border-bottom: 1px solid transparent;
  transition: all .3s;
}
nav.main-nav.scrolled {
  background: rgba(255,255,255,.92);
  border-bottom-color: var(--border);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}
.nav-inner { display:flex; align-items:center; justify-content:space-between; max-width:1180px; margin:0 auto; padding:0 24px; }
.logo { font-family:var(--font-display); font-weight:800; font-size:1.25rem; letter-spacing:-.03em; text-decoration:none; color:var(--text); display:flex; align-items:center; gap:8px; }
.logo-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 3px rgba(79,70,229,.2); }
.nav-links { display:flex; align-items:center; gap:32px; list-style:none; }
.nav-links a { color:var(--muted); font-size:.9rem; font-weight:500; transition:color .2s; }
.nav-links a:hover { color:var(--text); }
.nav-cta { display:flex; align-items:center; gap:10px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 600; font-size: .875rem;
  cursor: pointer; border: none; text-decoration: none;
  transition: all var(--transition); white-space: nowrap; line-height: 1;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 3px rgba(79,70,229,.4), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover { background: var(--accent-h); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.4); transform: translateY(-1px); }

.btn-purple { background: var(--accent2); color: #fff; box-shadow: 0 1px 3px rgba(124,58,237,.4); }
.btn-purple:hover { background: #6d28d9; color: #fff; transform: translateY(-1px); }

.btn-secondary { background: var(--surface); color: var(--text-2); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface2); border-color: var(--border2); color: var(--text); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface3); color: var(--text); }

.btn-danger { background: var(--red-s); color: var(--red); border: 1px solid rgba(239,68,68,.2); }
.btn-danger:hover { background: rgba(239,68,68,.15); }

.btn-lg { padding: 12px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 6px 14px; font-size: .8rem; border-radius: 8px; }
.btn-xs { padding: 4px 10px; font-size: .75rem; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-control {
  width: 100%; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; color: var(--text);
  font-family: var(--font-body); font-size: .875rem; transition: all .2s; outline: none;
}
.form-control::placeholder { color: var(--muted2); }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.form-control:hover:not(:focus) { border-color: var(--border2); }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px;
}
textarea.form-control { resize: vertical; min-height: 90px; }
.form-error { color: var(--red); font-size: .78rem; margin-top: 4px; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: .875rem; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
.alert-error   { background: var(--red-s);    border: 1px solid rgba(239,68,68,.25);   color: #c0392b; }
.alert-success { background: var(--green-s);  border: 1px solid rgba(16,185,129,.25);  color: #065f46; }
.alert-info    { background: var(--accent-soft); border: 1px solid rgba(79,70,229,.2); color: var(--accent); }
.alert-warning { background: var(--orange-s); border: 1px solid rgba(245,158,11,.25);  color: #92400e; }

/* ── Cards ── */
.card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.card:hover { box-shadow: var(--shadow); }
.card-sm { padding: 16px; border-radius: var(--radius); }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 100px; font-size: .72rem; font-weight: 600; letter-spacing: .03em; }
.badge-green  { background: var(--green-s);   color: #065f46; border: 1px solid rgba(16,185,129,.2); }
.badge-blue   { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(79,70,229,.2); }
.badge-purple { background: var(--accent2-soft); color: var(--accent2); border: 1px solid rgba(124,58,237,.2); }
.badge-red    { background: var(--red-s);     color: #b91c1c; border: 1px solid rgba(239,68,68,.2); }
.badge-orange { background: var(--orange-s);  color: #92400e; border: 1px solid rgba(245,158,11,.2); }

/* ── Section labels ── */
.section-tag   { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 10px; }
.section-title { font-size: clamp(1.8rem,3.5vw,2.6rem); font-weight: 800; margin-bottom: 14px; }
.section-sub   { color: var(--muted); font-size: 1rem; max-width: 500px; }
.grad-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1.5px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
table th { background: var(--surface2); padding: 11px 16px; text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1.5px solid var(--border); white-space: nowrap; }
table td { padding: 13px 16px; font-size: .875rem; border-bottom: 1.5px solid var(--border); color: var(--text); vertical-align: middle; }
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: var(--surface2); }

/* ── Skeleton ── */
.skeleton { background: linear-gradient(90deg,var(--surface2) 25%,var(--surface3) 50%,var(--surface2) 75%); background-size:200% 100%; animation:shimmer 1.4s infinite; border-radius:8px; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 60px 20px; background: var(--surface); border: 1.5px dashed var(--border2); border-radius: var(--radius-xl); }
.empty-icon { font-size: 2.8rem; margin-bottom: 14px; }
.empty-state h3 { font-size: 1.15rem; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin-bottom: 22px; font-size: .9rem; max-width: 360px; margin-left: auto; margin-right: auto; }

/* ── Dashboard layout ── */
.dash-layout { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1.5px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  box-shadow: 2px 0 8px rgba(15,23,42,.04);
}
.sidebar-header { display:flex; align-items:center; justify-content:space-between; padding:20px 18px 14px; }
.sidebar-user { display:flex; align-items:center; gap:12px; padding:14px 18px; background:var(--surface2); border-bottom:1.5px solid var(--border); }
.sidebar-avatar {
  width:38px; height:38px; border-radius:10px; flex-shrink:0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:.88rem; color:#fff; letter-spacing:-.02em;
}
.sidebar-nav { flex:1; padding:10px 10px; display:flex; flex-direction:column; gap:1px; }
.sidebar-nav a, .sidebar-nav button {
  display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:9px;
  color:var(--muted); text-decoration:none; font-size:.855rem; font-weight:500;
  transition:all .18s; border:none; background:none; cursor:pointer; width:100%; text-align:left;
}
.sidebar-nav a:hover, .sidebar-nav button:hover { background:var(--surface2); color:var(--text); }
.sidebar-nav a.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar-nav .nav-divider { border-top:1.5px solid var(--border); margin:8px 0; }
.sidebar-plan { padding:14px 18px; border-top:1.5px solid var(--border); display:flex; justify-content:space-between; align-items:center; font-size:.78rem; background:var(--surface2); }
.sidebar-plan span { color:var(--muted); }
.sidebar-plan a { color:var(--accent); font-weight:700; }
.sidebar-close { display:none; background:none; border:none; color:var(--muted); cursor:pointer; font-size:1rem; padding:4px; }

.main-area { display:flex; flex-direction:column; min-width:0; background:var(--bg); }
.topbar {
  background: var(--surface); border-bottom: 1.5px solid var(--border);
  padding: 12px 28px; display:flex; align-items:center; justify-content:space-between;
  position: sticky; top:0; z-index:50; box-shadow: var(--shadow-sm);
}
.main-content { flex:1; padding:28px; max-width:1300px; }

/* ── Page header ── */
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:28px; flex-wrap:wrap; gap:14px; }
.page-header h1 { font-size:1.6rem; font-weight:800; }

/* ── Stats grid ── */
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:28px; }
.stat-card {
  background:var(--surface); border:1.5px solid var(--border); border-radius:var(--radius-lg); padding:22px;
  box-shadow:var(--shadow-sm); transition:all .2s;
}
.stat-card:hover { box-shadow:var(--shadow); transform:translateY(-2px); }
.stat-label { font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-bottom:8px; }
.stat-value { font-family:var(--font-display); font-size:1.9rem; font-weight:800; letter-spacing:-.03em; }
.stat-change { font-size:.75rem; margin-top:6px; display:flex; align-items:center; gap:4px; }
.stat-change.positive { color:var(--green); }
.stat-change.negative { color:var(--red); }

/* ── Auth pages ── */
.auth-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:40px 16px; position:relative; background:var(--bg); }
.auth-card {
  background:var(--surface); border:1.5px solid var(--border); border-radius:var(--radius-xl);
  padding:40px; width:100%; max-width:460px; position:relative; z-index:1;
  box-shadow:var(--shadow-lg); animation:fadeUp .45s ease both;
}
.auth-logo { font-family:var(--font-display); font-weight:800; font-size:1.2rem; color:var(--text); text-decoration:none; display:inline-flex; align-items:center; gap:8px; margin-bottom:28px; }
.auth-logo-dot { width:7px; height:7px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 3px rgba(79,70,229,.2); }
.auth-title { font-size:1.75rem; margin-bottom:6px; }
.auth-subtitle { color:var(--muted); margin-bottom:28px; font-size:.9rem; }
.auth-divider { display:flex; align-items:center; gap:12px; margin:18px 0; }
.auth-divider::before,.auth-divider::after { content:''; flex:1; height:1px; background:var(--border); }
.auth-divider span { font-size:.78rem; color:var(--muted); font-weight:500; }
.auth-switch { text-align:center; margin-top:22px; font-size:.875rem; color:var(--muted); }
.auth-switch a { color:var(--accent); font-weight:600; }
.auth-terms { text-align:center; margin-top:10px; font-size:.75rem; color:var(--muted2); }
.auth-terms a { color:var(--muted); text-decoration:underline; }

/* Social buttons */
.btn-google { background:#fff; color:#374151; border:1.5px solid var(--border); box-shadow:var(--shadow-sm); }
.btn-google:hover { background:var(--surface2); color:#111; }
.btn-whatsapp { background:#25D366; color:#fff; box-shadow:0 2px 8px rgba(37,211,102,.3); }
.btn-whatsapp:hover { background:#22bf5c; color:#fff; transform:translateY(-1px); }

/* Phone + OTP */
.phone-input-wrap { display:flex; }
.phone-prefix { padding:10px 14px; background:var(--surface2); border:1.5px solid var(--border); border-right:none; border-radius:var(--radius) 0 0 var(--radius); color:var(--accent); font-weight:600; font-size:.875rem; white-space:nowrap; display:flex; align-items:center; }
.phone-input-wrap .form-control { border-radius:0 var(--radius) var(--radius) 0; }
.otp-inputs { display:flex; gap:10px; justify-content:center; margin:20px 0; }
.otp-digit {
  width:52px; height:58px; text-align:center; font-size:1.5rem; font-weight:700;
  background:var(--surface); border:2px solid var(--border); border-radius:var(--radius);
  color:var(--text); font-family:var(--font-display); transition:border-color .2s; outline:none;
}
.otp-digit:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(79,70,229,.12); }

/* Spinner */
.spinner { width:17px; height:17px; border:2px solid rgba(255,255,255,.3); border-top-color:#fff; border-radius:50%; animation:spin .65s linear infinite; }
.spinner-dark { border-color:rgba(15,23,42,.15); border-top-color:var(--text); }

/* Scrollbar */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border2); border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:var(--muted2); }

/* ── Animations ── */
@keyframes fadeUp   { from{opacity:0;transform:translateY(18px);}to{opacity:1;transform:translateY(0);} }
@keyframes fadeIn   { from{opacity:0;}to{opacity:1;} }
@keyframes pulse    { 0%,100%{opacity:1;}50%{opacity:.4;} }
@keyframes float1   { 0%,100%{transform:translate(0,0);}50%{transform:translate(40px,60px);} }
@keyframes float2   { 0%,100%{transform:translate(0,0);}50%{transform:translate(-60px,-40px);} }
@keyframes float3   { 0%,100%{transform:translate(0,0);}50%{transform:translate(30px,-50px);} }
@keyframes shimmer  { 0%{background-position:-200% 0;}100%{background-position:200% 0;} }
@keyframes spin     { to{transform:rotate(360deg);} }
@keyframes shake    { 0%,100%{transform:translateX(0);}25%{transform:translateX(-6px);}75%{transform:translateX(6px);} }

/* ── Responsive ── */
@media(max-width:960px) {
  .dash-layout { grid-template-columns:1fr; }
  .sidebar { position:fixed; left:-270px; top:0; bottom:0; width:256px; z-index:200; transition:left .3s; }
  .sidebar.open { left:0; }
  .sidebar-close { display:block; }
  .stats-grid { grid-template-columns:1fr 1fr; }
  .main-content { padding:16px; }
}
@media(max-width:600px) {
  section { padding:70px 0; }
  .stats-grid { grid-template-columns:1fr; }
  .container { padding:0 16px; }
  .auth-card { padding:28px 20px; }
}
