/* LwnaPro web portal — shared styles.
   Mirrors the iOS app's AppTheme.swift: indigo accent (#6366F1) on black,
   Rabar_021 Kurdish font, RTL layout — same visual language as LoginView,
   pushed a bit further for the web (glass cards, ambient glow, motion). */

@font-face {
  font-family: "Rabar";
  src: url("assets/fonts/Rabar_021.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #050508;
  --surface: #161c2e;
  --surface-hi: #232b45;
  --card: rgba(24, 29, 48, 0.66);
  --card-border: rgba(255, 255, 255, 0.09);
  --accent: #6366f1;
  --accent-2: #8b8ff5;
  --accent-3: #4338ca;
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.68);
  --text-3: rgba(255, 255, 255, 0.42);
  --green: #22c55e;
  --orange: #f97316;
  --red: #ef4444;
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 13px;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: "Rabar", "Segoe UI", system-ui, sans-serif;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--st);
  padding-bottom: var(--sb);
  letter-spacing: 0.01em;
}

a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }

/* ── Ambient background: soft indigo/violet blobs drifting behind a near-
   black base, instead of a flat single gradient — same brand hue, more depth. ── */
.glow-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}
.glow-bg::before, .glow-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  animation: drift 22s ease-in-out infinite alternate;
}
.glow-bg::before {
  width: 60vh; height: 60vh;
  top: -18vh; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--accent), transparent 70%);
}
.glow-bg::after {
  width: 46vh; height: 46vh;
  bottom: -14vh; right: -10vh;
  background: radial-gradient(circle, var(--accent-3), transparent 70%);
  animation-delay: -9s;
  opacity: 0.28;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-4%, 4%) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .glow-bg::before, .glow-bg::after { animation: none; }
}

.page {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 56px 20px 48px;
  display: flex;
  flex-direction: column;
}

/* ── Brand header ── */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}
.brand .logo-ring {
  width: 104px; height: 104px;
  border-radius: 30px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(155deg, rgba(99,102,241,0.22), rgba(99,102,241,0.02));
  border: 1px solid rgba(99,102,241,0.28);
  box-shadow: 0 20px 45px -18px rgba(99,102,241,0.55);
}
.brand .logo-ring img { width: 72px; height: 72px; object-fit: contain; }
.brand h1 { font-size: 19px; font-weight: 700; letter-spacing: 0.08em; }
.brand .tagline { font-size: 12.5px; color: var(--text-3); margin-top: -6px; }

.topbar {
  position: sticky;
  top: var(--st);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -56px -20px 28px;
  padding: 18px 20px;
  background: rgba(5, 5, 8, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topbar .brand-inline { display: flex; align-items: center; gap: 10px; }
.topbar .logo-ring { width: 38px; height: 38px; border-radius: 12px; }
.topbar .logo-ring img { width: 24px; height: 24px; }
.topbar h1 { font-size: 14.5px; font-weight: 700; letter-spacing: 0.06em; }

/* ── Cards (glass) ── */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  padding: 22px;
  margin-bottom: 16px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--shadow-lg);
}
.card h2 { font-size: 16.5px; font-weight: 700; margin-bottom: 5px; }
.card .sub { font-size: 13px; color: var(--text-2); line-height: 1.75; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-icon {
  width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(99, 102, 241, 0.14);
}
.card-icon svg { width: 19px; height: 19px; fill: var(--accent-2); }
.card-icon.green { background: rgba(34,197,94,.14); }
.card-icon.green svg { fill: var(--green); }
.card-icon.gold { background: rgba(234,179,8,.14); }
.card-icon.gold svg { fill: #eab308; }

/* ── Fields ── */
.field-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 0 16px;
  height: 54px;
  margin-bottom: 13px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.field-wrap:focus-within {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}
.field-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  text-align: right;
  height: 100%;
}
.field-wrap input::placeholder { color: var(--text-3); }
.field-wrap svg { width: 18px; height: 18px; fill: var(--text-3); flex-shrink: 0; transition: fill 0.2s; }
.field-wrap:focus-within svg { fill: var(--accent-2); }

.field-plain {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 15px 16px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  text-align: right;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 12px;
}
.field-plain:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14); }
.field-plain::placeholder { color: var(--text-3); }

/* ── Buttons ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 54px;
  border: none;
  border-radius: 16px;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.2s, filter 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 60%, var(--accent-3));
  color: #fff;
  box-shadow: 0 14px 30px -10px rgba(99, 102, 241, 0.55);
}
@media (hover: hover) { .btn-primary:hover:not(:disabled) { filter: brightness(1.08); } }
.btn-apple { background: #000; color: #fff; border: 1px solid rgba(255, 255, 255, 0.18); }
@media (hover: hover) { .btn-apple:hover:not(:disabled) { background: #131313; } }
.btn-apple svg { width: 18px; height: 18px; fill: #fff; }
.btn-outline { background: transparent; color: var(--text-2); border: 1px solid rgba(255, 255, 255, 0.14); }
.btn-gold { background: linear-gradient(135deg, #fbbf24, #eab308); color: #1a1305; box-shadow: 0 14px 30px -12px rgba(234, 179, 8, 0.45); }
.btn-ghost { background: rgba(255, 255, 255, 0.05); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.08); }
.btn-sm { height: 46px; font-size: 14px; border-radius: 13px; }

.link-btn {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 6px;
  transition: color 0.15s;
}
.link-btn:hover { color: var(--accent-2); }

/* ── Divider ── */
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.09); }

/* ── Messages ── */
.msg {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 14px;
  animation: fadeUp 0.25s ease;
}
.msg svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.msg-ok { background: rgba(34, 197, 94, 0.12); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.22); }
.msg-err { background: rgba(239, 68, 68, 0.12); color: #ff8a8a; border: 1px solid rgba(239, 68, 68, 0.22); }
.msg-info { background: rgba(99, 102, 241, 0.14); color: var(--accent-2); border: 1px solid rgba(99, 102, 241, 0.28); }
[hidden] { display: none !important; }

/* ── Status rows (account card) ── */
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.row:last-child { border-bottom: none; padding-bottom: 0; }
.row:first-child { padding-top: 0; }
.row .lbl { font-size: 13px; color: var(--text-2); }
.row .val { font-size: 13.5px; font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 13px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-ok { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
.badge-warn { background: rgba(249, 115, 22, 0.16); color: #fb923c; }

/* ── Plan tiers ── */
.tiers { display: flex; gap: 8px; margin: 14px 0 16px; }
.tier {
  flex: 1;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-md);
  padding: 14px 8px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}
.tier.featured {
  border-color: rgba(234, 179, 8, 0.4);
  background: rgba(234, 179, 8, 0.06);
}
.tier .name { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.tier .devices { font-size: 11px; color: var(--text-3); }
.tier .tag { display: inline-block; font-size: 9.5px; font-weight: 700; color: #eab308; margin-top: 4px; }

/* ── Avatar ── */
.avatar {
  width: 54px; height: 54px; border-radius: 17px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff; flex-shrink: 0;
  box-shadow: 0 10px 24px -8px rgba(99, 102, 241, 0.6);
}

/* ── Tabs (sliding pill) ── */
.tabs {
  position: relative;
  display: flex;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 15px;
  padding: 4px;
  margin-bottom: 22px;
}
.tab-indicator {
  position: absolute;
  top: 4px; bottom: 4px;
  width: calc(50% - 4px);
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 6px 16px -4px rgba(99, 102, 241, 0.6);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  transform: translateX(0%);
}
.tabs[data-active="signup"] .tab-indicator { transform: translateX(-100%); }
.tab {
  position: relative;
  z-index: 1;
  flex: 1;
  text-align: center;
  padding: 11px;
  border: none;
  background: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s;
}
.tab.active { color: #fff; }

/* ── Loading ── */
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 55vh; color: var(--text-2); font-size: 13.5px; }
.center-loading .spinner { width: 26px; height: 26px; border-width: 2.5px; }

/* ── Footer ── */
.foot { text-align: center; margin-top: auto; padding-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.foot a { font-size: 12px; color: var(--text-3); transition: color 0.15s; }
.foot a:hover { color: var(--text-2); }

/* Fade-in, staggered by nth card */
.fade-in { animation: fadeUp 0.5s cubic-bezier(.2,.8,.2,1) both; }
.page > *:nth-child(1) { animation-delay: 0.02s; }
.page > *:nth-child(2) { animation-delay: 0.08s; }
.page > *:nth-child(3) { animation-delay: 0.14s; }
.page > *:nth-child(4) { animation-delay: 0.2s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* Focus visibility for keyboard users */
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

@media (max-width: 380px) {
  .page { padding: 40px 16px 36px; }
  .brand .logo-ring { width: 88px; height: 88px; }
  .brand .logo-ring img { width: 60px; height: 60px; }
}
