:root {
  color-scheme: dark;
  --bg: #030711;
  --panel: rgba(10, 18, 32, .82);
  --panel-solid: #0a1220;
  --line: rgba(196, 228, 255, .12);
  --line-strong: rgba(102, 209, 246, .32);
  --muted: #8c9aae;
  --text: #f5f9ff;
  --text-soft: #cbd7e7;
  --ocean: #72d9f7;
  --ocean-strong: #3fb7e7;
  --danger: #ff8299;
  --shadow: 0 34px 100px rgba(0, 0, 0, .48);
  font-family: Vazirmatn, IRANSansX, "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  position: relative;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 88% 8%, rgba(49, 153, 217, .13), transparent 28%),
    radial-gradient(circle at 12% 92%, rgba(54, 213, 218, .07), transparent 26%),
    linear-gradient(145deg, #07101d 0%, #030711 48%, #060c17 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .78), transparent 82%);
  content: "";
}

button,
input { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .14;
  pointer-events: none;
}

.ambient-one { top: -21rem; right: -11rem; background: #258ed2; }
.ambient-two { bottom: -23rem; left: -12rem; background: #2dc7c9; }

.noise {
  position: fixed;
  inset: 0;
  opacity: .018;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.72'/%3E%3C/svg%3E");
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
  align-items: center;
  gap: clamp(64px, 9vw, 140px);
  padding: 48px 0;
}

.brand,
.mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
  text-decoration: none;
  direction: ltr;
  text-align: left;
}

.brand-mark {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  color: #e7fbff;
  background: linear-gradient(145deg, rgba(87, 204, 241, .2), rgba(19, 42, 67, .54));
  box-shadow: inset 0 1px rgba(255, 255, 255, .14), 0 16px 42px rgba(36, 159, 209, .14);
  font: 850 13px/1 Arial, sans-serif;
  letter-spacing: -.04em;
}

.brand-mark::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .18), transparent 42%);
  content: "";
}

.brand strong,
.brand small,
.mobile-brand strong,
.mobile-brand small { display: block; }

.brand strong,
.mobile-brand strong {
  font: 850 16px/1.1 Arial, sans-serif;
  letter-spacing: .11em;
}

.brand small,
.mobile-brand small {
  margin-top: 5px;
  color: #728198;
  font: 650 9px/1 Arial, sans-serif;
  letter-spacing: .18em;
}

.intro {
  align-self: stretch;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 0;
}

.intro-copy {
  position: relative;
  margin: auto 0;
  padding: 80px 0;
}

.intro-copy::before {
  position: absolute;
  top: 42px;
  right: 0;
  width: 88px;
  height: 1px;
  background: linear-gradient(90deg, var(--ocean), transparent);
  content: "";
}

.eyebrow {
  color: var(--ocean);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .025em;
}

.intro h1 {
  max-width: 680px;
  margin: 22px 0 24px;
  font-size: clamp(48px, 5.5vw, 78px);
  line-height: 1.14;
  letter-spacing: -.055em;
}

.intro h1 em {
  color: transparent;
  font-style: normal;
  background: linear-gradient(90deg, #edf9ff 0%, #8bdcff 55%, #d6f5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.intro-copy > p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 2.05;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  color: #acb9ca;
  font-size: 13px;
}

.trust-list span { display: flex; align-items: center; gap: 9px; }

.trust-list i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ocean);
  box-shadow: 0 0 16px rgba(114, 217, 247, .58);
}

.login-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .055), transparent 35%),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .07);
  backdrop-filter: blur(30px) saturate(120%);
  -webkit-backdrop-filter: blur(30px) saturate(120%);
}

.login-card::after {
  position: absolute;
  inset: auto -70px -100px auto;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(114, 217, 247, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(114, 217, 247, .018), 0 0 0 68px rgba(114, 217, 247, .012);
  pointer-events: none;
  content: "";
}

.card-glow {
  position: absolute;
  inset: -1px 12% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(130, 225, 255, .72), transparent);
}

.mobile-brand { display: none; margin-bottom: 38px; }
.login-card header { position: relative; z-index: 1; margin-bottom: 32px; }

.login-card h2 {
  margin: 10px 0 9px;
  font-size: 34px;
  line-height: 1.35;
  letter-spacing: -.035em;
}

.login-card header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

#login-form { position: relative; z-index: 1; }

form > label,
.label-row label {
  display: block;
  margin: 0 3px 10px;
  color: #d8e2ef;
  font-size: 13px;
  font-weight: 700;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
}

.label-row span { color: #718097; font-size: 11px; }

.field {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 16px;
  border: 1px solid rgba(199, 227, 255, .11);
  border-radius: 16px;
  background: rgba(2, 7, 15, .54);
  transition: border-color .24s ease, box-shadow .24s ease, background .24s ease, transform .24s ease;
}

.field:focus-within {
  border-color: rgba(92, 199, 239, .58);
  background: rgba(3, 10, 20, .82);
  box-shadow: 0 0 0 4px rgba(68, 179, 226, .09), 0 15px 34px rgba(0, 0, 0, .16);
}

.field-icon {
  width: 21px;
  flex: none;
  color: #718198;
  direction: ltr;
  font: 500 17px/1 Arial, sans-serif;
  text-align: center;
}

.field-icon.lock {
  position: relative;
  width: 14px;
  height: 12px;
  margin: 4px;
  border: 1.5px solid #718198;
  border-radius: 4px;
}

.field-icon.lock::before {
  position: absolute;
  width: 7px;
  height: 7px;
  right: 1.8px;
  top: -7px;
  border: 1.5px solid #718198;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  content: "";
}

input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 15px;
}

input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px #07101c inset;
}

.reveal {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  padding: 7px 3px;
  color: #82cfef;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.error {
  min-height: 26px;
  margin: 12px 3px 5px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.9;
}

.submit {
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(167, 231, 255, .42);
  border-radius: 16px;
  color: #03111b;
  background: linear-gradient(120deg, #a8e8ff, #70d0f2 58%, #8fdcf4);
  box-shadow: 0 16px 38px rgba(48, 163, 211, .2), inset 0 1px rgba(255, 255, 255, .42);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  transition: transform .24s ease, box-shadow .24s ease, filter .24s ease;
}

.submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(48, 163, 211, .28);
  filter: brightness(1.04);
}

.submit:disabled { cursor: wait; opacity: .7; transform: none; }

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(4, 16, 26, .24);
  border-top-color: #04101a;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.submit.loading .spinner { display: block; }

.login-card footer {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 27px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.login-card footer p {
  margin: 0;
  color: #74839a;
  font-size: 11px;
  line-height: 1.9;
}

.shield {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid rgba(114, 217, 247, .25);
  border-radius: 8px;
  color: var(--ocean);
  background: rgba(114, 217, 247, .07);
  font-size: 11px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .login-shell {
    width: min(480px, calc(100% - 28px));
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: max(22px, env(safe-area-inset-top)) 0 max(22px, env(safe-area-inset-bottom));
  }

  .intro { display: none; }
  .mobile-brand { display: inline-flex; }
  .login-card { width: 100%; padding: 30px 24px; border-radius: 26px; }
  .login-card h2 { font-size: 30px; }
}

@media (max-width: 380px) {
  .login-shell { width: calc(100% - 20px); }
  .login-card { padding: 26px 18px; border-radius: 22px; }
  .mobile-brand { margin-bottom: 31px; }
  .brand-mark { width: 44px; height: 44px; }
  .login-card h2 { font-size: 27px; }
  .field, .submit { height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
