@import url("https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cinzel:wght@500;600;700&display=swap");

body.auth-page {
  --auth-bg: #091517;
  --auth-panel: #101d1f;
  --auth-ink: #f1e7d3;
  --auth-muted: #aab9b4;
  --auth-gold: #dabb7f;
  --auth-red: #96392e;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--auth-ink);
  background:
    radial-gradient(circle at 13% 80%, #203336 0, transparent 30%),
    radial-gradient(circle at 88% 10%, #3b262030 0, transparent 24%),
    var(--auth-bg);
  font-family: "Amiri", Georgia, serif;
}

.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.26;
  background-image: repeating-linear-gradient(90deg, transparent 0 79px, #dabb7f12 80px);
}

.auth-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
  padding: 0 clamp(24px, 4vw, 76px);
  border-bottom: 1px solid #dabb7f29;
}

.auth-header .brand {
  color: var(--auth-ink);
}

.auth-header .brand small {
  color: var(--auth-muted);
}

.auth-header .auth-language {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 7px 17px;
  border: 1px solid #dabb7f4a;
  border-radius: 999px;
  color: var(--auth-ink);
  text-decoration: none;
  font-weight: 700;
}

/* LIGHT MODE TOGGLE (removable): shares the pill shape of the language
   link but is self-contained so this rule can be deleted on its own. */
.auth-header .theme-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 7px 17px;
  border: 1px solid #dabb7f4a;
  border-radius: 999px;
  color: var(--auth-ink);
  background: none;
  font: 700 14px "Amiri", Georgia, serif;
}
.auth-header .theme-toggle:hover {
  background: #ffffff10;
}

.auth-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
  min-height: calc(100svh - 82px);
}

.auth-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(44px, 7vw, 112px);
  overflow: hidden;
}

.auth-intro::before,
.auth-intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline-end: 8%;
  top: 50%;
  width: min(44vw, 590px);
  aspect-ratio: 1;
  border: 1px solid #dabb7f24;
  border-radius: 50%;
  transform: translateY(-50%);
}

.auth-intro::after {
  inset-inline-end: calc(8% + 55px);
  width: min(35vw, 470px);
  border-color: #dabb7f14;
}

.auth-overline,
.auth-panel-kicker {
  margin: 0 0 18px;
  color: var(--auth-gold);
  font: 600 12px/1.3 Cinzel, "Amiri", serif;
  letter-spacing: 0.2em;
}

.auth-intro h1 {
  max-width: 780px;
  margin: 0;
  color: var(--auth-ink);
  text-align: start;
  font: 600 clamp(48px, 6.2vw, 92px)/0.98 Cinzel, "Amiri", serif;
  letter-spacing: -0.045em;
}

html[lang="ar"] .auth-intro h1 {
  font-family: "Amiri", serif;
  letter-spacing: 0;
  line-height: 1.05;
}

.auth-lede {
  max-width: 640px;
  margin: 30px 0 0;
  color: var(--auth-muted);
  font-size: clamp(17px, 1.45vw, 22px);
  line-height: 1.75;
}

.auth-chronology {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 650px;
  margin-top: clamp(34px, 6vh, 70px);
  border-top: 1px solid #dabb7f3d;
}

.auth-chronology span {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 16px 0 0;
}

.auth-chronology span::before {
  content: "";
  position: absolute;
  top: -4px;
  inset-inline-start: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--auth-gold);
  box-shadow: 0 0 0 5px #dabb7f16;
}

.auth-chronology bdi {
  color: var(--auth-gold);
  font: 600 13px Cinzel, "Amiri", serif;
}

.auth-chronology small {
  color: var(--auth-ink);
  font-size: 15px;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(38px, 5vw, 76px);
  border-inline-start: 1px solid #dabb7f2b;
  background: #101d1fe8;
  backdrop-filter: blur(16px);
  overflow-y: auto;
}

.auth-panel h2 {
  margin: 0;
  color: var(--auth-ink);
  font: 600 clamp(36px, 4vw, 54px)/1.08 Cinzel, "Amiri", serif;
}

html[lang="ar"] .auth-panel h2 {
  font-family: "Amiri", serif;
}

.auth-panel-copy {
  margin: 12px 0 24px;
  color: var(--auth-muted);
  font-size: 16px;
  line-height: 1.6;
}

.auth-page .auth-tabs {
  gap: 0;
  margin: 0 0 22px;
  border-bottom: 1px solid #dabb7f30;
}

.auth-page .auth-tabs button {
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--auth-muted);
  background: transparent;
  font-size: 16px;
}

.auth-page .auth-tabs button.active {
  border-bottom-color: var(--auth-gold);
  color: var(--auth-ink);
  background: transparent;
}

.auth-page #auth-form {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.auth-page #auth-form::before {
  display: none;
}

.auth-page #auth-form label {
  margin: 8px 0 0;
  color: var(--auth-ink);
  font-size: 15px;
}

.auth-page #auth-form input {
  width: 100%;
  height: 49px;
  padding: 0 14px;
  border: 1px solid #dabb7f3d;
  border-radius: 3px;
  outline: 0;
  color: var(--auth-ink);
  background: #071113aa;
  font: 16px "Amiri", Georgia, serif;
}

.auth-page #auth-form input:focus {
  border-color: var(--auth-gold);
  box-shadow: 0 0 0 3px #dabb7f18;
}

.auth-page #auth-submit {
  min-height: 50px;
  margin-top: 15px;
  border: 1px solid #e4c98f;
  color: #172022;
  background: var(--auth-gold);
  font-weight: 700;
}

.auth-page #auth-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.auth-page #auth-message {
  min-height: 24px;
  margin: 13px 0 0;
  color: #e88877;
  text-align: center;
}

.auth-home {
  width: max-content;
  margin: 6px auto 0;
  color: var(--auth-muted);
  text-underline-offset: 4px;
}

@media (min-width: 901px) and (max-height: 800px) {
  .auth-panel {
    padding-block: 22px;
  }

  .auth-panel-kicker {
    margin-bottom: 8px;
  }

  .auth-panel h2 {
    font-size: 39px;
  }

  .auth-panel-copy {
    margin: 6px 0 12px;
  }

  .auth-page .auth-tabs {
    margin-bottom: 10px;
  }

  .auth-page #auth-form {
    gap: 3px;
  }

  .auth-page #auth-form label {
    margin-top: 4px;
  }

  .auth-page #auth-form input {
    height: 43px;
  }

  .auth-page #auth-submit {
    min-height: 44px;
    margin-top: 9px;
  }

  .auth-page #auth-message {
    margin-top: 7px;
  }
}

@media (max-width: 900px) {
  body.auth-page {
    overflow-y: auto;
  }

  .auth-header {
    height: 72px;
    padding: 0 18px;
  }

  .auth-stage {
    display: block;
    min-height: calc(100svh - 72px);
  }

  .auth-intro {
    min-height: 320px;
    padding: 48px 24px 42px;
  }

  .auth-intro h1 {
    font-size: clamp(44px, 13vw, 66px);
  }

  .auth-lede {
    margin-top: 20px;
  }

  .auth-chronology {
    margin-top: 32px;
  }

  .auth-panel {
    min-height: 590px;
    padding: 44px 24px 56px;
    border-top: 1px solid #dabb7f2b;
    border-inline-start: 0;
  }
}

@media (max-width: 480px) {
  .auth-header .brand small {
    display: none;
  }

  .auth-chronology small {
    font-size: 13px;
  }
}

/* ===================================================================
   LIGHT MODE (removable)
   Toggled by #theme-toggle (see auth.js). Shares the "atlas_theme"
   localStorage key with cinema.js, so a theme choice made on the main
   app or here carries over between them. Same palette family as the
   light mode in cinema.css (warm parchment background, dark ink, a
   darker/more saturated gold for contrast) for visual consistency
   across the whole app. Most of this file already reads its colors
   through the --auth-* custom properties, so redefining those here
   re-themes most of the page automatically — the rules below only
   handle the handful of hardcoded (non-variable) colors that don't.
   To remove: delete this block, the ".auth-header .theme-toggle" rule
   above, the #theme-toggle button markup in auth.html/auth-en.html,
   and the matching block in auth.js. */
body.auth-page.light-mode {
  --auth-bg: #f7f3ea;
  --auth-panel: #fffdf8;
  --auth-ink: #241f18;
  --auth-muted: #6b6558;
  --auth-gold: #97722f;
  --auth-red: #8a3226;
  background:
    radial-gradient(circle at 13% 80%, #dabb7f22 0, transparent 30%),
    radial-gradient(circle at 88% 10%, #c9ad7818 0, transparent 24%),
    var(--auth-bg);
}
body.auth-page.light-mode::before {
  background-image: repeating-linear-gradient(90deg, transparent 0 79px, #00000010 80px);
}
body.auth-page.light-mode .auth-header {
  border-bottom-color: #00000018;
}
body.auth-page.light-mode .auth-header .auth-language,
body.auth-page.light-mode .auth-header .theme-toggle {
  border-color: #97722f4a;
}
body.auth-page.light-mode .auth-header .theme-toggle:hover {
  background: #00000008;
}
body.auth-page.light-mode .auth-intro::before {
  border-color: #97722f30;
}
body.auth-page.light-mode .auth-intro::after {
  border-color: #97722f1c;
}
body.auth-page.light-mode .auth-chronology {
  border-top-color: #00000022;
}
body.auth-page.light-mode .auth-chronology span::before {
  box-shadow: 0 0 0 5px #97722f1e;
}
body.auth-page.light-mode .auth-panel {
  border-inline-start-color: #00000018;
  background: #fffdf8ea;
}
body.auth-page.light-mode .auth-tabs {
  border-bottom-color: #00000022;
}
body.auth-page.light-mode #auth-form input {
  border-color: #00000026;
  background: #ffffffb3;
}
body.auth-page.light-mode #auth-form input:focus {
  box-shadow: 0 0 0 3px #97722f1c;
}
body.auth-page.light-mode #auth-submit {
  border-color: #7a5d24;
}
body.auth-page.light-mode #auth-message {
  color: var(--auth-red);
}
@media (max-width: 900px) {
  body.auth-page.light-mode .auth-panel {
    border-top-color: #00000018;
  }
}
