/*
 * ATLET web app -- signed-out screens.
 *
 * The split-screen layout, the fixed 220px photo band on a phone, the
 * absolutely-positioned brand mark and the position of "Coaching without
 * borders." are a design that was reviewed and signed off as it stands.
 * Change those only when asked to.
 *
 * Everything directional is written as start/end rather than left/right, so
 * the Persian and English versions are the same stylesheet rather than two.
 */

:root {
  --atlet-bg: #0A0A0B;
  --atlet-surface: #111318;
  --atlet-surface-raised: #161920;
  --atlet-border: #262A32;
  --atlet-border-strong: #383D47;
  --atlet-red: #DC2626;
  --atlet-red-active: #B71C1C;
  --atlet-red-glow: rgba(220, 38, 38, .16);
  --atlet-text-primary: #F3F4F6;
  --atlet-text-secondary: #9DA6B0;
  --atlet-text-muted: #6B7280;
  --atlet-ok: #18C586;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--atlet-bg);
  color: var(--atlet-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

:lang(fa) body {
  font-family: "Vazirmatn", "IRANSans", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Tahoma, sans-serif;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.brand-panel {
  position: relative;
  overflow: hidden;
  background: #050607;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  min-height: 100vh;
}

.brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(150deg, rgba(5, 6, 7, .55) 0%, rgba(5, 6, 7, .62) 45%, rgba(5, 6, 7, .92) 100%),
    url('../assets/atlet-hero.jpg') center 30% / cover no-repeat;
}

/* The mark and the tags sit above the photo's overlay. */
.brand-mark,
.brand-tags { position: relative; }

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark svg { width: 58px; height: 58px; flex: 0 0 auto; }

.brand-mark strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.brand-mark span {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--atlet-text-secondary);
  letter-spacing: .3px;
}

/* The brand block is English wordmarking in both languages, so it keeps its
   own direction even when the rest of the page is right-to-left. */
.brand-mark,
.brand-tags { direction: ltr; }

.brand-tags {
  display: flex;
  gap: 18px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--atlet-text-muted);
}

.brand-tags span:not(:last-child)::after {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-inline-start: 18px;
  border-radius: 50%;
  background: var(--atlet-text-muted);
  vertical-align: middle;
}

.form-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lang-toggle {
  position: fixed;
  top: 16px;
  inset-inline-end: 16px;
  z-index: 5;
  padding: 6px 13px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(10, 10, 11, .55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--atlet-text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lang-toggle:hover {
  color: var(--atlet-text-primary);
  border-color: var(--atlet-border-strong);
}

.form-card { width: 100%; max-width: 340px; }

.tagline { margin-bottom: 26px; }

/* An English brand line inside a Persian page: kept left-to-right so the
   full stop does not jump to the wrong end of the sentence. */
.tagline h1 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.2px;
  text-wrap: balance;
  direction: ltr;
  text-align: start;
}

.tagline p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--atlet-text-secondary);
  direction: ltr;
  text-align: start;
}

.form-card .eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--atlet-red);
}

.form-card h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
}

.form-card .intro {
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--atlet-text-secondary);
}

/* The login screen has no intro paragraph, so its heading keeps the original
   spacing before the first field. */
.form-card h2 + .form { margin-top: 16px; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--atlet-text-secondary);
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--atlet-border);
  background: var(--atlet-surface);
  color: var(--atlet-text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input::placeholder { color: var(--atlet-text-muted); }

.field input:focus {
  outline: none;
  border-color: var(--atlet-red);
  box-shadow: 0 0 0 3px var(--atlet-red-glow);
}

/* Usernames, emails, phone numbers and access codes are latin-script values
   even when the interface around them is Persian. */
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"],
.field input[autocomplete="username"],
.field input[autocomplete="new-password"],
.code-input {
  direction: ltr;
  text-align: start;
}

.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
}

.hint {
  margin: -6px 0 16px;
  font-size: 11.5px;
  color: var(--atlet-text-muted);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 22px;
  font-size: 12.5px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--atlet-text-secondary);
}

.remember input { accent-color: var(--atlet-red); }

.link-button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--atlet-border-strong);
  border-radius: 0;
  background: none;
  color: var(--atlet-text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.link-button:hover { color: var(--atlet-text-primary); }

.submit {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--atlet-red);
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: .2px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease;
}

.submit:hover { background: var(--atlet-red-active); }

.submit:disabled {
  background: var(--atlet-surface-raised);
  color: var(--atlet-text-muted);
  cursor: default;
}

.secondary {
  width: 100%;
  height: 46px;
  border: 1px solid var(--atlet-border-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--atlet-text-primary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.secondary:hover {
  background: var(--atlet-surface);
  border-color: var(--atlet-red);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0;
  font-size: 11px;
  color: var(--atlet-text-muted);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--atlet-border);
}

.telegram-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 12px 14px;
  border: 1px solid var(--atlet-border);
  border-radius: 12px;
  background: var(--atlet-surface);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--atlet-text-secondary);
}

.telegram-note .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #229ED9;
  flex: 0 0 auto;
}

.summary {
  margin: 4px 0 20px;
  border: 1px solid var(--atlet-border);
  border-radius: 12px;
  background: var(--atlet-surface);
  padding: 2px 13px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--atlet-border);
  font-size: 12.5px;
}

.summary-row:first-child { border-top: 0; }
.summary-row span { color: var(--atlet-text-secondary); }
.summary-row b { font-weight: 700; }

/* Identifiers stay latin-script and left-to-right inside a Persian page. */
.latin {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

.message:empty { display: none; }

.notice {
  margin: 0 0 16px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 12.5px;
  line-height: 1.65;
}

.notice-error {
  border: 1px solid rgba(220, 38, 38, .45);
  background: var(--atlet-red-glow);
  color: #FFB4B4;
}

.notice-info {
  border: 1px solid var(--atlet-border);
  background: var(--atlet-surface);
  color: var(--atlet-text-secondary);
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }

  /* A fixed height, not a minimum: with justify-content: space-between a
     min-height alone let the photo band stretch down the page. */
  .brand-panel {
    height: 220px;
    min-height: 0;
    padding: 22px 24px 6px;
  }

  .brand-mark {
    position: absolute;
    top: 14px;
    inset-inline-start: 16px;
  }

  /* The mark is out of the flex flow, and a single remaining child under
     space-between would otherwise ride to the top. */
  .brand-tags { margin-top: auto; }

  .tagline p { display: none; }

  /* Top-aligned rather than centred once the photo band is above it. A short
     card (the signed-in screen) otherwise floats halfway down with a gap under
     the photo, and a tall one (sign-in) gets centred past the top of its own
     box, which clips the first thing on it. */
  .form-panel {
    align-items: flex-start;
    padding: 28px 24px 48px;
  }
}
