:root {
  --bg: #071014;
  --bg-soft: #0d1a20;
  --panel: #101e25;
  --panel-strong: #14252d;
  --line: #29404a;
  --text: #f2f7f8;
  --muted: #9cb1bb;
  --accent: #62e5ac;
  --accent-strong: #39cc8d;
  --danger: #ff8585;
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 86% -8%, rgba(72, 218, 161, .22), transparent 29rem),
    radial-gradient(circle at 7% 15%, rgba(27, 87, 83, .24), transparent 28rem),
    var(--bg);
  direction: rtl;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 26px 0 54px; }
.topbar { display: flex; direction: rtl; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand strong { display: block; font-size: 22px; line-height: 1; }
.brand small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; letter-spacing: 1.1px; direction: ltr; text-align: right; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--accent); color: #062118; font-weight: 900; font-size: 32px; line-height: 1; }
.connection { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.connection i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #72848c; box-shadow: 0 0 0 4px rgba(115, 134, 143, .14); }
.connection i.ok { background: var(--accent); box-shadow: 0 0 0 4px rgba(98, 229, 172, .13); }
.connection i.error { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 133, 133, .13); }

.auth-layout { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 26px; min-height: calc(100vh - 156px); }
.hero-card, .auth-card, .welcome-card, .stats article, .next-card, .service-card, .service-panel { box-shadow: 0 20px 70px rgba(0, 0, 0, .17); }
.hero-card { align-self: stretch; display: flex; flex-direction: column; justify-content: center; min-height: 500px; padding: clamp(32px, 5vw, 68px); border: 1px solid #1c363d; border-radius: 30px; background: linear-gradient(145deg, rgba(17, 42, 47, .97), rgba(10, 24, 30, .94)); }
.eyebrow { margin: 0 0 11px; color: var(--accent); font-size: 13px; font-weight: 700; }
.hero-card h1, .welcome-card h1 { margin: 0; line-height: 1.24; font-size: clamp(35px, 4.5vw, 58px); letter-spacing: -.9px; }
.hero-card > p:not(.eyebrow) { max-width: 490px; margin: 20px 0 0; color: var(--muted); line-height: 2; font-size: 16px; }
.hero-grid { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.hero-grid span { border: 1px solid #2e4d52; border-radius: 999px; padding: 9px 14px; background: rgba(5, 17, 21, .25); color: #d1e5e3; font-size: 12px; }

.auth-card { padding: 27px; border: 1px solid #243d45; border-radius: 25px; background: rgba(14, 29, 35, .9); }
.tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: #0a151a; }
.tab { border: 0; border-radius: 9px; padding: 11px 8px; color: var(--muted); background: transparent; }
.tab.active { background: #1b3139; color: var(--accent); font-weight: 800; box-shadow: inset 0 0 0 1px #31535c; }
.auth-heading { margin: 29px 0 20px; }
.auth-heading h2 { margin: 0; font-size: 29px; }
.auth-heading p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
form { margin: 0; }
label { display: grid; gap: 8px; color: #cbd9dc; font-size: 13px; font-weight: 600; }
input { width: 100%; min-height: 49px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--text); background: #0d181e; transition: border-color .16s, box-shadow .16s; }
input::placeholder { color: #71848d; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(98, 229, 172, .13); }
.auth-card form { display: grid; gap: 14px; }
.name-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.primary, .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 12px; min-height: 47px; padding: 10px 18px; font-weight: 800; }
.primary { border: 1px solid transparent; color: #062319; background: linear-gradient(135deg, var(--accent), #4bdca3); box-shadow: 0 12px 26px rgba(50, 213, 146, .17); }
.primary:hover { background: linear-gradient(135deg, #77efbb, var(--accent)); }
.ghost { border: 1px solid var(--line); color: #d7e7e6; background: #16262d; }
.ghost:hover { border-color: #588075; color: var(--accent); }
.topbar .ghost { min-height: 38px; padding: 7px 13px; font-size: 13px; }
.form-message, .panel-message { min-height: 20px; margin: 0; color: var(--muted); line-height: 1.75; font-size: 13px; }
.form-message.error, .panel-message.error { color: var(--danger); }
.server-settings { margin-top: 21px; color: var(--muted); font-size: 13px; }
.server-settings summary { cursor: pointer; color: #cfdddd; }
.server-settings[open] { display: grid; gap: 12px; }
.server-settings label { margin-top: 12px; }
.server-settings .ghost { width: max-content; }

.dashboard { display: grid; gap: 22px; }
.welcome-card { display: flex; align-items: center; justify-content: space-between; gap: 25px; min-height: 205px; padding: 32px 36px; border: 1px solid #24454a; border-radius: 25px; background: linear-gradient(128deg, #13352f, #102029 56%, #111e25); }
.welcome-card h1 { font-size: clamp(31px, 4vw, 46px); }
.welcome-card p:not(.eyebrow) { margin: 11px 0 0; color: var(--muted); line-height: 1.9; }
.shield { display: grid; place-items: center; flex: 0 0 auto; width: 70px; height: 70px; border: 1px solid rgba(98, 229, 172, .5); border-radius: 22px; color: var(--accent); background: rgba(98, 229, 172, .1); font-size: 34px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stats article { padding: 17px; border: 1px solid #29434b; border-radius: 17px; background: var(--panel); }
.stats span { display: block; color: var(--muted); font-size: 12px; }
.stats strong { display: block; margin-top: 9px; color: var(--text); font-size: 17px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 8px 0 17px; }
.section-heading h2, .next-card h2 { margin: 0; font-size: 27px; }
.section-heading .muted { max-width: 360px; font-size: 12px; line-height: 1.8; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.service-card { border: 1px solid var(--line); min-height: 143px; padding: 21px; border-radius: 18px; color: var(--text); background: var(--panel); text-align: right; transition: transform .18s, border-color .18s, background .18s; }
.service-card:hover, .service-card:focus { border-color: var(--accent); outline: 0; background: #15282d; transform: translateY(-3px); }
.service-card b { font-size: 17px; }
.service-card p, .next-card p { margin: 10px 0 0; color: var(--muted); line-height: 1.8; font-size: 13px; }
.service-panel { padding: 26px; border: 1px solid #2a5953; border-radius: 22px; background: linear-gradient(135deg, #10262a, #0e1a20); }
.service-panel header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.service-panel h2 { margin: 0; font-size: 24px; }
.service-panel header p { margin: 8px 0 0; color: var(--muted); line-height: 1.8; font-size: 13px; }
.service-panel h3 { margin: 6px 0 0; font-size: 16px; }
.service-form { display: grid; gap: 15px; max-width: 690px; }
.service-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-counts button { min-width: 64px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #1a2b33; }
.quick-counts button:hover { border-color: var(--accent); color: var(--accent); }
.choice-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 9px; }
.choice { min-height: 48px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #0d181e; text-align: right; }
.choice:hover { border-color: #5a887b; }
.choice.selected { border-color: var(--accent); color: var(--accent); background: #16342d; }
.next-card { display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 26px; border: 1px solid #29444a; border-radius: 21px; background: var(--panel); }
.next-card #operation-report { max-width: 520px; margin: 0; }

@media (max-width: 800px) {
  .shell { width: min(100% - 28px, 560px); padding-top: 16px; }
  .topbar { margin-bottom: 17px; }
  .connection { display: none; }
  .auth-layout { grid-template-columns: 1fr; min-height: auto; }
  .hero-card { min-height: 0; padding: 31px 25px; border-radius: 23px; }
  .hero-card h1 { font-size: 36px; }
  .stats, .service-grid { grid-template-columns: 1fr 1fr; }
  .section-heading, .next-card { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
  .shell { width: min(100% - 22px, 480px); }
  .brand strong { font-size: 18px; }
  .brand-mark { width: 42px; height: 42px; border-radius: 13px; font-size: 28px; }
  .auth-card, .service-panel, .next-card { padding: 19px; }
  .welcome-card { min-height: 0; padding: 24px; }
  .shield { display: none; }
  .stats, .service-grid, .name-fields { grid-template-columns: 1fr; }
  .service-panel header { flex-direction: column; }
  .service-panel header .ghost { width: 100%; }
}

/* Polished centred service experience */
body { font-family: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif; }
.hero-card, .auth-card, .welcome-card, .section-heading, .next-card { text-align: center; }
.hero-card { align-items: center; }
.hero-card > p:not(.eyebrow) { margin-inline: auto; }
.hero-grid { justify-content: center; }
.auth-heading, .auth-card form, .server-settings { text-align: center; }
.auth-card label { text-align: center; }
.auth-card input { text-align: center; }
.server-settings[open] { justify-items: center; }
.server-settings label { width: 100%; }
.welcome-card { justify-content: center; min-height: 222px; }
.welcome-card > div { max-width: 670px; }
.shield { position: absolute; inset-inline-end: 38px; opacity: .9; }
.welcome-card { position: relative; overflow: hidden; }
.welcome-card::after { content: ""; position: absolute; width: 320px; height: 320px; border: 1px solid rgba(98, 229, 172, .13); border-radius: 50%; inset-inline-start: -150px; inset-block-start: -160px; }
.stats article, .section-heading, .next-card { text-align: center; }
.section-heading { align-items: center; justify-content: center; flex-direction: column; }
.service-card { display: flex; min-height: 158px; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: linear-gradient(145deg, rgba(20, 39, 47, .98), rgba(13, 27, 33, .98)); }
.service-card b { letter-spacing: -.2px; }
.service-card p { max-width: 230px; }

.service-panel {
  position: relative;
  overflow: hidden;
  padding: 44px clamp(24px, 5vw, 72px) 38px;
  border-color: rgba(98, 229, 172, .28);
  background:
    radial-gradient(circle at 50% -30%, rgba(98, 229, 172, .16), transparent 300px),
    linear-gradient(145deg, rgba(19, 48, 52, .97), rgba(9, 22, 28, .98));
  text-align: center;
}
.service-panel::before, .service-panel::after { content: ""; position: absolute; width: 220px; height: 220px; border: 1px solid rgba(98, 229, 172, .11); border-radius: 50%; pointer-events: none; }
.service-panel::before { inset: -130px auto auto -85px; }
.service-panel::after { inset: auto -100px -150px auto; }
.service-panel header { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; margin: 0 auto 30px; text-align: center; }
.service-panel header > div { max-width: 700px; }
.service-panel header p { max-width: 560px; margin-inline: auto; }
.service-panel header .ghost { position: absolute; inset-inline-start: 0; inset-block-start: 0; min-width: 92px; }
.service-panel h2 { font-size: clamp(27px, 3vw, 36px); }
.service-panel h3 { margin-top: 8px; text-align: center; color: #e9f4f4; }
.service-form { position: relative; z-index: 1; width: min(100%, 760px); margin: 0 auto; text-align: center; }
.service-form label { justify-items: center; text-align: center; color: #dcebea; font-size: 14px; }
.service-form input { text-align: center; min-height: 58px; border-radius: 16px; font-weight: 700; font-size: 15px; background: rgba(6, 20, 26, .72); }
.service-form input[dir="ltr"] { direction: ltr; text-align: center; }
.service-form .primary { min-height: 59px; border-radius: 17px; font-size: 17px; box-shadow: 0 18px 35px rgba(50, 213, 146, .22); }
.service-form .ghost { min-height: 56px; border-radius: 16px; font-size: 16px; background: rgba(28, 50, 59, .72); }
.quick-counts { justify-content: center; margin-top: -3px; }
.quick-counts button { min-width: 76px; min-height: 40px; border-radius: 999px; font-weight: 800; }
.choice-list { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; }
.choice { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 63px; border-radius: 17px; text-align: center; font-size: 18px; font-weight: 700; background: rgba(7, 22, 28, .72); }
.choice .muted { font-size: 14px; }
.choice:hover { transform: translateY(-2px); border-color: var(--accent); background: rgba(29, 66, 61, .7); }
.choice.selected { box-shadow: 0 0 0 3px rgba(98, 229, 172, .12), 0 12px 28px rgba(0, 0, 0, .2); }
.panel-message { text-align: center; font-size: 14px; font-weight: 600; }
.next-card { justify-content: center; flex-direction: column; }
.next-card #operation-report { text-align: center; }

@media (max-width: 600px) {
  .shield { display: none; }
  .service-panel { padding: 31px 18px 24px; border-radius: 20px; }
  .service-panel header { padding-top: 49px; }
  .service-panel header .ghost { inset-inline: 0; width: 100%; }
  .choice-list { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .choice { min-height: 55px; font-size: 16px; }
}
