:root {
  --abyss: #041e29;
  --deep: #072b3a;
  --tide: #0f4457;
  --aqua: #2fe0c0;
  --aqua-deep: #14b79b;
  --amber: #ffb240;
  --shell: #fffcf5;
  --sand: #f3efe5;
  --ink: #0b1f27;
  --muted: #64777e;
  --danger: #e0503f;
  --display: 'Sora', 'Segoe UI', sans-serif;
  --body: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--sand);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input { font: inherit; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(430px, 0.95fr);
}
/* Without this, each track floors at the min-content width of the card
   inside it and the page overflows on a phone. */
.login-shell > * { min-width: 0; }

/* ---------- Left: the story panel ---------- */
.login-story {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 46px 56px 44px;
  color: var(--shell);
  background:
    radial-gradient(circle at 18% 8%, rgba(47, 224, 192, 0.22), transparent 30rem),
    linear-gradient(150deg, var(--tide), var(--abyss) 62%);
}
/* A slow diamond lattice, echoing the mark without repeating it literally. */
.story-net {
  position: absolute;
  inset: -10%;
  opacity: 0.16;
  background-image:
    repeating-linear-gradient(45deg, rgba(47,224,192,.55) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(-45deg, rgba(47,224,192,.55) 0 1px, transparent 1px 46px);
  mask-image: radial-gradient(circle at 40% 45%, #000, transparent 72%);
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  font: 700 23px/1 var(--display);
  letter-spacing: -.05em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 5px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.1);
}

.story-copy { position: relative; margin: auto 0; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  color: var(--aqua);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 0 6px rgba(47, 224, 192, 0.12);
}
.login-story h1 {
  margin: 26px 0 22px;
  font: 700 clamp(56px, 6vw, 92px)/.88 var(--display);
  letter-spacing: -.06em;
}
.login-story h1 em { color: var(--aqua); font-style: normal; }
.story-note {
  max-width: 430px;
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1.85;
}

.story-stats {
  position: relative;
  display: flex;
  gap: 34px;
  margin: 0 0 26px;
}
.story-stats span {
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.story-stats b {
  color: var(--aqua);
  font: 700 30px/1 var(--display);
  letter-spacing: -.05em;
}

.story-footer {
  position: relative;
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  letter-spacing: .06em;
}

/* ---------- Right: the form panel ---------- */
/* Flex, not grid: an auto-sized grid column takes the card's max-content
   width and overflows the phone viewport. A flex item resolves its
   percentage width against the container and shrinks. */
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 46px 40px;
  background: var(--sand);
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 38px 36px 34px;
  border: 1px solid rgba(7, 43, 58, 0.09);
  border-radius: 26px;
  background: var(--shell);
  box-shadow: 0 24px 70px rgba(4, 30, 41, 0.1);
}
.access-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  border-radius: 16px;
  color: var(--deep);
  background: var(--aqua);
}
.access-mark svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.form-kicker {
  margin: 0;
  color: var(--aqua-deep);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.login-card h2 {
  margin: 12px 0 8px;
  font: 650 28px/1.05 var(--display);
  letter-spacing: -.05em;
}
.form-intro { margin: 0 0 26px; color: var(--muted); font-size: 13px; line-height: 1.7; }

.login-card label {
  display: block;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 600;
}
.field-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin-bottom: 18px;
  padding: 0 14px;
  border: 1px solid rgba(7, 43, 58, 0.14);
  border-radius: 15px;
  background: var(--shell);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field-shell:focus-within { border-color: var(--aqua-deep); box-shadow: 0 0 0 3px rgba(47, 224, 192, 0.18); }
.field-shell svg { flex: 0 0 auto; width: 17px; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.field-shell input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
}
.reveal-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.reveal-button:hover { color: var(--ink); background: var(--sand); }
.reveal-button[aria-pressed='true'] { color: var(--aqua-deep); }

.form-message:empty { display: none; }
.form-message {
  display: flex;
  gap: 8px;
  margin: -4px 0 16px;
  padding: 11px 13px;
  border: 1px solid rgba(224, 80, 63, 0.25);
  border-radius: 12px;
  color: var(--danger);
  background: rgba(224, 80, 63, 0.05);
  font-size: 11.5px;
  line-height: 1.55;
}

.submit-button {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 17px;
  color: var(--shell);
  background: var(--deep);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.submit-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.submit-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(7, 43, 58, 0.24); }
.submit-button:disabled { cursor: wait; opacity: .6; }

.security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(7, 43, 58, 0.08);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}
.security-note svg { flex: 0 0 auto; width: 15px; color: var(--aqua-deep); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 940px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { padding: 34px 28px 30px; min-height: 46vh; }
  .login-story h1 { margin: 20px 0 16px; }
  .story-stats { flex-wrap: wrap; gap: 14px 22px; margin-bottom: 20px; }
  .login-panel { padding: 30px 20px 44px; }
}
