@font-face { font-family: Vazirmatn; font-weight: 400; font-display: swap; src: url(/fonts/vazirmatn-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Vazirmatn; font-weight: 700; font-display: swap; src: url(/fonts/vazirmatn-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Vazirmatn; font-weight: 400; font-display: swap; src: url(/fonts/vazirmatn-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }
@font-face { font-family: Vazirmatn; font-weight: 700; font-display: swap; src: url(/fonts/vazirmatn-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }

/* iOS 27-style: soft tinted wash behind frosted "liquid glass" surfaces,
   darker glass edges + bright top highlight, capsule buttons, 44pt+ touch targets. */
:root {
  --wash-1: #d9ece9;
  --wash-2: #f4ede2;
  --wash-3: #e7eef6;
  --ink: #0d1717;
  --ink-2: rgba(13, 23, 23, .62);
  --ink-3: rgba(13, 23, 23, .38);
  --tint: #0b7a74;          /* app accent (teal) */
  --tint-ink: #ffffff;
  --tint-soft: rgba(11, 122, 116, .14);
  --green: #30c35f;
  --red: #ff3b30;
  --orange: #ff9f0a;
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-edge: rgba(0, 0, 0, .10);
  --glass-hi: rgba(255, 255, 255, .95);
  --sep: rgba(60, 60, 67, .16);
  --shadow: 0 1px 1px rgba(0,0,0,.04), 0 10px 30px -12px rgba(16, 40, 40, .22);
  --blur: saturate(180%) blur(24px);
  --r-card: 26px;
  --font: Vazirmatn, -apple-system, "SF Pro Text", Tahoma, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --wash-1: #06302e;
    --wash-2: #120f0a;
    --wash-3: #0a1424;
    --ink: #f2f6f6;
    --ink-2: rgba(242, 246, 246, .64);
    --ink-3: rgba(242, 246, 246, .36);
    --tint: #3fd0c5;
    --tint-ink: #032321;
    --tint-soft: rgba(63, 208, 197, .16);
    --glass: rgba(28, 34, 36, .55);
    --glass-strong: rgba(36, 42, 44, .78);
    --glass-edge: rgba(0, 0, 0, .55);
    --glass-hi: rgba(255, 255, 255, .22);
    --sep: rgba(235, 235, 245, .14);
    --shadow: 0 1px 1px rgba(0,0,0,.3), 0 14px 34px -14px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(120% 60% at 100% 0%, var(--wash-1), transparent 60%),
    radial-gradient(90% 50% at 0% 30%, var(--wash-3), transparent 60%),
    var(--wash-2);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; }

/* ---------- glass material ---------- */
.glass-card, .top, .pill, .toast, .pick-grid button {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
}
.glass-card { border-radius: var(--r-card); }

/* ---------- floating top bar ---------- */
.top {
  position: sticky; top: calc(8px + env(safe-area-inset-top)); z-index: 5;
  margin: calc(8px + env(safe-area-inset-top)) auto 0;
  width: min(520px, calc(100% - 24px));
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 6px 8px 6px 16px; border-radius: 999px;
}
.brand { font-weight: 700; font-size: 15px; letter-spacing: .12em; direction: ltr; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
  font-size: 13px; padding: 0 14px; border-radius: 999px; box-shadow: inset 0 1px 0 var(--glass-hi);
}
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.pill-ok::before { background: var(--green); box-shadow: 0 0 0 3px rgba(48,195,95,.2); }
.pill-off::before { background: var(--red); }

main { width: min(520px, 100%); margin: 0 auto; padding: 20px 16px calc(40px + env(safe-area-inset-bottom)); }
.screen { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.screen.center { text-align: center; padding-top: 28px; }

.large-title { font-size: 34px; line-height: 1.25; font-weight: 700; margin: 8px 0 4px; letter-spacing: -.01em; text-wrap: balance; }
.muted { color: var(--ink-2); margin: 0 0 20px; }
.hello { color: var(--ink-2); margin: 0 0 16px; }
.error { color: var(--red); min-height: 1.6em; margin: 12px 0 0; font-size: 15px; }

.app-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 12px 30px -10px rgba(11,60,60,.45); margin-top: 8px; }

/* ---------- login ---------- */
.form { padding: 10px; display: grid; gap: 10px; text-align: start; }
.field {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px;
  border-radius: 18px; background: var(--glass-strong); border: 1px solid var(--glass-edge);
}
.field svg { width: 20px; height: 20px; fill: var(--ink-3); flex: none; }
.field input { flex: 1; min-width: 0; border: 0; background: none; font-size: 18px; padding: 12px 0; outline: none; }
.field:focus-within { border-color: var(--tint); box-shadow: 0 0 0 4px var(--tint-soft); }

/* ---------- buttons (capsules) ---------- */
.btn-primary {
  min-height: 56px; border-radius: 999px; background: var(--tint); color: var(--tint-ink);
  font-weight: 700; font-size: 18px; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 22px -12px var(--tint);
  transition: transform .15s ease;
}
.btn-tinted {
  min-height: 50px; padding: 0 22px; border-radius: 999px; background: var(--tint-soft); color: var(--tint); font-weight: 700;
}
.btn-plain { min-height: 44px; padding: 0 18px; color: var(--ink-2); font-size: 15px; }
.btn-primary:active, .btn-tinted:active, .pick-grid button:active, .call-btn:active, .action:active .disc { transform: scale(.94); }

/* ---------- avatars ---------- */
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -2px 6px rgba(0,0,0,.12);
}
.avatar.big { width: 128px; height: 128px; font-size: 54px; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 20px 50px -18px rgba(0,0,0,.6); }

/* ---------- pick who you are ---------- */
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.pick-grid button {
  border-radius: var(--r-card); min-height: 132px; padding: 18px 8px;
  display: grid; justify-items: center; align-content: center; gap: 10px; font-weight: 700; font-size: 18px;
  transition: transform .15s ease;
}
.pick-grid button:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 6px); }
.pick-grid .avatar { width: 64px; height: 64px; font-size: 26px; }

/* ---------- family list (inset grouped) ---------- */
.members { list-style: none; padding: 0 16px; margin: 0; }
.member { display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 12px 0; }
.member + .member { border-top: 0.5px solid var(--sep); }
.member .info { flex: 1; min-width: 0; }
.member .name { font-weight: 700; font-size: 19px; line-height: 1.3; }
.member .status { font-size: 14px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.member .status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.member .status.on { color: var(--green); }
.member .status.on::before { background: var(--green); }
.call-btn {
  width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--green); color: #fff; transition: transform .15s ease, opacity .2s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 8px 18px -8px rgba(48,195,95,.8);
}
.call-btn svg { width: 24px; height: 24px; fill: currentColor; }
.call-btn:disabled { background: var(--sep); color: var(--ink-3); box-shadow: none; cursor: default; }

.hint { padding: 14px 16px; font-size: 15px; color: var(--ink-2); margin: 16px 0 0; }
.footer-actions { display: grid; gap: 8px; margin-top: 24px; justify-items: center; }

.spinner { width: 34px; height: 34px; margin: 24px auto 12px; border: 3px solid var(--sep); border-top-color: var(--tint); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- call screen ---------- */
.call {
  --peer: #0b7a74;
  position: fixed; inset: 0; z-index: 10; color: #fff; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(56px + env(safe-area-inset-top)) 24px calc(36px + env(safe-area-inset-bottom));
  background: #050909;
}
.call-bg {
  position: absolute; inset: -20%; z-index: -1; filter: blur(60px) saturate(140%);
  background:
    radial-gradient(40% 35% at 50% 22%, var(--peer), transparent 70%),
    radial-gradient(50% 40% at 15% 85%, color-mix(in srgb, var(--peer) 55%, #000), transparent 70%),
    radial-gradient(45% 40% at 90% 70%, color-mix(in srgb, var(--peer) 40%, #1a2a6a), transparent 70%),
    #060b0b;
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(3%, -2%) scale(1.06); } }
.call-top { display: grid; justify-items: center; text-align: center; gap: 4px; }
.call-name { font-size: 34px; font-weight: 700; margin-top: 18px; line-height: 1.3; }
.call-status { color: rgba(255,255,255,.72); font-size: 17px; min-height: 1.6em; }
.call-timer { direction: ltr; font-size: 20px; font-variant-numeric: tabular-nums; min-height: 1.5em; color: rgba(255,255,255,.9); }

.quality {
  display: inline-flex; align-items: flex-end; gap: 3px; height: 32px; padding: 8px 12px; margin-bottom: 18px;
  border-radius: 999px; direction: ltr;
  background: rgba(255,255,255,.12); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid rgba(0,0,0,.25); box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.quality span { width: 4px; background: rgba(255,255,255,.3); border-radius: 2px; }
.quality span:nth-child(1) { height: 6px; } .quality span:nth-child(2) { height: 10px; } .quality span:nth-child(3) { height: 15px; }
.quality em { font-style: normal; font-size: 13px; line-height: 15px; color: rgba(255,255,255,.85); margin-left: 8px; direction: rtl; }
.quality.q3 span { background: #5ff08f; }
.quality.q2 span:nth-child(-n+2) { background: var(--orange); }
.quality.q1 span:nth-child(1) { background: #ff6b60; }

.call-bottom { display: grid; justify-items: center; gap: 28px; }
.call-bottom.incoming { display: flex; justify-content: space-between; padding: 0 12px; }
.controls { display: flex; gap: 40px; justify-content: center; }
.action { display: grid; justify-items: center; gap: 8px; min-width: 84px; }
.action .label { font-size: 14px; color: rgba(255,255,255,.88); }
.disc {
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  transition: transform .15s ease, background .2s ease;
}
.disc svg { width: 32px; height: 32px; fill: currentColor; }
.disc.glass {
  color: #fff;
  background: rgba(255,255,255,.16);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid rgba(0,0,0,.3);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.4), inset 0 -1px 0 rgba(255,255,255,.08), 0 10px 26px -12px rgba(0,0,0,.6);
}
.action.on .disc.glass { background: #fff; color: #0d1717; box-shadow: inset 0 1.5px 0 #fff, 0 10px 26px -10px rgba(255,255,255,.35); }
.disc.end, .disc.accept { color: #fff; border: 1px solid rgba(0,0,0,.25); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.45), 0 14px 30px -12px rgba(0,0,0,.6); }
.disc.end { background: var(--red); }
.disc.accept { background: var(--green); animation: pulse 1.6s infinite; }
svg.hang { transform: rotate(135deg); }
@keyframes pulse { 0%,100% { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.45), 0 0 0 0 rgba(48,195,95,.55); } 50% { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.45), 0 0 0 18px rgba(48,195,95,0); } }

/* ---------- toast (floating glass capsule) ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 20;
  bottom: calc(24px + env(safe-area-inset-bottom));
  padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 700;
  max-width: calc(100% - 32px); text-align: center; background: var(--glass-strong);
  animation: pop .25s ease both;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 10px) scale(.96); } }

/* ---------- accessibility fallbacks ---------- */
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: var(--glass-strong); }
  .glass-card, .top, .pill, .toast, .pick-grid button, .disc.glass, .quality { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --glass-edge: rgba(0,0,0,.45); --ink-2: var(--ink); --ink-3: var(--ink-2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
