@font-face {
  font-family: "Alexandria";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/alexandria-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Alexandria";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/alexandria-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body:has(#login-screen:not([hidden])) {
  background: #3f322b;
}

.login-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 48px 20px 32px;
  background: #3f322b;
  color: #f7f2ea;
}

.login-scene { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(234, 235, 226, 0.14);
}

.ring-a { width: 520px; height: 520px; top: -180px; right: -120px; }
.ring-b { width: 680px; height: 680px; bottom: -280px; left: -220px; }

.tri {
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  opacity: 0.55;
}

.tri-a {
  top: 16%;
  left: 11%;
  border-width: 0 22px 38px 22px;
  border-color: transparent transparent rgba(177, 145, 107, 0.28) transparent;
}

.tri-b {
  right: 7%;
  bottom: 14%;
  border-width: 46px 26px 0 26px;
  border-color: rgba(177, 145, 107, 0.22) transparent transparent transparent;
}

.tri-c {
  left: 18%;
  bottom: 9%;
  border-width: 0 16px 28px 16px;
  border-color: transparent transparent rgba(234, 235, 226, 0.12) transparent;
}

.login-frame {
  width: min(440px, 100%);
  animation: login-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-logo {
  display: block;
  width: min(250px, 70vw);
  height: auto;
  margin: 0 auto 28px;
}

.login-card {
  padding: 34px 30px 28px;
  border-radius: 22px;
  background: #f7f2ea;
  color: #5f4b40;
  box-shadow: 0 24px 60px -28px rgba(20, 12, 8, 0.7);
}

.login-card h1 {
  margin: 0 0 26px;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: #3f322b;
}

.login-card h1::after {
  content: "";
  display: block;
  width: 52px;
  height: 3px;
  margin: 10px auto 0;
  border-radius: 99px;
  background: #b1916b;
}

.login-field {
  gap: 8px;
  margin: 0 0 16px;
  color: #5f4b40;
  font-size: 14px;
  font-weight: 600;
}

.login-shell input {
  width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #e3c9a2;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  color: #2a211c;
  font-size: 15px;
  font-weight: 500;
}

.login-shell input:focus-visible {
  outline: none;
  border-color: #b1916b;
  box-shadow: 0 0 0 3px rgba(177, 145, 107, 0.22);
}

.login-password { position: relative; }

.login-password input {
  padding-left: 48px;
  text-align: right;
}

.login-reveal {
  position: absolute;
  top: 50%;
  left: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #987e6f;
  transform: translateY(-50%);
}

.login-reveal:hover { color: #62392b; background: rgba(177, 145, 107, 0.16); }

.login-reveal:focus-visible {
  outline: 2px solid #b1916b;
  outline-offset: 2px;
}

.login-reveal svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-reveal .eye-shut { display: none; }
.login-reveal.is-visible .eye-open { display: none; }
.login-reveal.is-visible .eye-shut { display: block; }

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 8px;
}

.login-remember {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: #5f4b40;
  font-size: 14px;
  font-weight: 500;
}

.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: #62392b;
  border-radius: 4px;
}

.login-forgot {
  color: #5f4b40;
  font-size: 14px;
  font-weight: 500;
}

.login-forgot:hover { color: #62392b; text-decoration: underline; text-underline-offset: 3px; }

.login-forgot:focus-visible,
.login-submit:focus-visible {
  outline: 2px solid #b1916b;
  outline-offset: 3px;
}

.login-recover,
.login-caps,
.login-card .form-error {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.7;
}

.login-recover:not([hidden]) { display: grid; gap: 8px; margin-top: 12px; color: #5f4b40; }
.login-recover p { margin: 0; }
.login-recover .login-submit { margin-top: 4px; height: 46px; }
.login-recover-status { min-height: 1.4em; font-weight: 600; color: #3f322b; }
.login-caps { color: #8a6420; font-weight: 600; }

.login-submit {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  height: 50px;
  margin-top: 18px;
  border-radius: 12px;
  background: #62392b;
  color: #f7f2ea;
  font-size: 16px;
  font-weight: 700;
}

.login-submit:hover { background: #543024; }
a.login-submit { text-decoration: none; box-sizing: border-box; }

.login-card.is-error { box-shadow: 0 0 0 1px #b4384f, 0 24px 60px -28px rgba(20, 12, 8, 0.7); }

.login-frame .notice { margin-top: 16px; }

.login-copy {
  margin: 22px 0 0;
  text-align: center;
  font-size: 12px;
  color: rgba(247, 242, 234, 0.55);
}

@keyframes login-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .login-shell { padding: 32px 16px 24px; }
  .login-card { padding: 28px 18px 22px; }
  .login-card h1 { font-size: 24px; }
  .login-shell input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-frame { animation: none; }
}
