/* Login and password setup: Kız Kulesi at dusk behind a glass card. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.auth {
  min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
  font-family: "Instrument Sans", system-ui, -apple-system, sans-serif; color: #f4f1ea;
  background: #070b24; -webkit-font-smoothing: antialiased;
}

.scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
body.auth::after { /* keeps the card readable on bright parts of the sky */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(7, 11, 36, 0.45), rgba(7, 11, 36, 0) 60%);
}

.auth-wrap {
  position: relative; z-index: 1; display: grid; place-items: center;
  min-height: 100vh; min-height: 100dvh; padding: 32px 16px calc(32px + env(safe-area-inset-bottom));
}
.auth-card {
  display: flex; flex-direction: column; width: min(400px, 100%); padding: 32px 28px 22px;
  background: rgba(16, 14, 38, 0.58); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 22px;
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: rise 0.7s cubic-bezier(.2, .8, .2, 1) both;
}
.auth-mark {
  display: grid; place-items: center; align-self: center; width: 52px; height: 52px; margin-bottom: 14px;
  border-radius: 15px; background: #E4002B; color: #fff; font-size: 28px; font-weight: 700; line-height: 1;
  box-shadow: 0 10px 30px -8px rgba(228, 0, 43, 0.8);
}
.auth-card h1 { margin: 0; text-align: center; font-size: 25px; font-weight: 700; letter-spacing: -0.02em; }
.auth-sub { margin: 6px 0 22px; text-align: center; color: rgba(244, 241, 234, 0.66); font-size: 14.5px; }

.auth-card label { margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: rgba(244, 241, 234, 0.8); }
.auth-card label .hint { font-weight: 400; color: rgba(244, 241, 234, 0.5); }
.auth-card input {
  width: 100%; min-height: 48px; padding: 0 14px; font: inherit; font-size: 16px; color: #fff;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 12px;
  outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
.auth-card input:focus { border-color: #ff8a5c; background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 3px rgba(255, 138, 92, 0.25); }
.auth-card input[readonly] { color: rgba(255, 255, 255, 0.7); }
.pw { position: relative; }
.pw input { padding-right: 76px; }
.pw-eye {
  position: absolute; top: 6px; right: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 9px;
  font: inherit; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.75); background: rgba(255, 255, 255, 0.08); cursor: pointer;
}
.pw-eye:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

.auth-error {
  margin-top: 14px; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  color: #ffd9d9; background: rgba(228, 0, 43, 0.22); border: 1px solid rgba(255, 90, 110, 0.4);
}
.auth-btn {
  display: grid; place-items: center; min-height: 50px; margin-top: 20px; border: 0; border-radius: 12px;
  font: inherit; font-size: 16px; font-weight: 700; color: #fff; text-decoration: none; cursor: pointer;
  background: linear-gradient(180deg, #f0173f, #c90026); box-shadow: 0 12px 28px -10px rgba(228, 0, 43, 0.9);
  transition: transform .12s, filter .12s;
}
.auth-btn:hover { filter: brightness(1.08); }
.auth-btn:active { transform: translateY(1px); }

.auth-forgot { margin-top: 16px; text-align: center; font-size: 14px; }
.auth-forgot summary { display: inline; cursor: pointer; color: rgba(244, 241, 234, 0.72); text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.auth-forgot summary::-webkit-details-marker { display: none; }
.auth-forgot p { margin: 10px 0 0; color: rgba(244, 241, 234, 0.62); font-size: 13.5px; line-height: 1.45; }
.auth-foot {
  display: flex; justify-content: center; gap: 8px; margin-top: 20px; padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; color: rgba(244, 241, 234, 0.5);
}
.auth-foot .dot { color: #ff8a5c; }

@media (max-width: 420px) {
  .auth-card { padding: 26px 20px 18px; border-radius: 20px; }
  .auth-card h1 { font-size: 22px; }
}

/* ---- the scene ---- */
.stars circle { animation: twinkle 4.5s ease-in-out infinite; }
.city-lights circle { animation: twinkle 3.2s ease-in-out infinite; }
.win rect { animation: flicker 7s ease-in-out infinite; }
.win rect:nth-child(3n) { animation-delay: -2.4s; }
.win rect:nth-child(4n) { animation-delay: -4.1s; }
.sun-glow { transform-box: fill-box; transform-origin: center; animation: breathe 9s ease-in-out infinite; }
.lamp { transform-box: fill-box; transform-origin: center; animation: beacon 3s ease-in-out infinite; }
.lantern { animation: lantern 3s ease-in-out infinite; }
.glints rect { animation: glint 2.6s ease-in-out infinite; }
.lamp-glints rect { animation: glint 2s ease-in-out infinite; }
.waves path { animation: drift linear infinite; }
.w1 { animation-duration: 38s !important; }
.w2 { animation-duration: 26s !important; animation-direction: reverse !important; }
.w3 { animation-duration: 17s !important; }
.flag { transform-box: fill-box; transform-origin: left center; animation: wave-flag 1.6s ease-in-out infinite; }
.foam { animation: foam 4s ease-in-out infinite; }
.cloud { animation: cloud linear infinite; }
.c1 { animation-duration: 140s; animation-delay: -30s; }
.c2 { animation-duration: 190s; animation-delay: -120s; }
.c3 { animation-duration: 110s; animation-delay: -70s; }
.cloud.c1 { --y: 300px; opacity: .22; }
.cloud.c2 { --y: 380px; opacity: .3; }
.cloud.c3 { --y: 250px; opacity: .16; }
.gull { animation: fly linear infinite; }
.g0 { --y: 300px; --s: 1;   animation-duration: 34s; animation-delay: -4s; }
.g1 { --y: 330px; --s: .8;  animation-duration: 38s; animation-delay: -9s; }
.g2 { --y: 270px; --s: .65; animation-duration: 44s; animation-delay: -22s; }
.g3 { --y: 360px; --s: .9;  animation-duration: 36s; animation-delay: -27s; }
.g4 { --y: 240px; --s: .55; animation-duration: 50s; animation-delay: -12s; }
.flap { animation: flap .9s ease-in-out infinite; transform-origin: 0 0; }

@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes twinkle { 0%, 100% { opacity: .9; } 50% { opacity: .2; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 45% { opacity: .75; } 50% { opacity: .95; } 70% { opacity: .6; } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes beacon { 0%, 100% { transform: scale(.75); opacity: .55; } 50% { transform: scale(1.25); opacity: 1; } }
@keyframes lantern { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes glint { 0%, 100% { opacity: .15; transform: translateX(0); } 50% { opacity: .85; transform: translateX(6px); } }
@keyframes drift { to { transform: translateX(-1600px); } }
@keyframes wave-flag { 0%, 100% { transform: skewY(0) scaleX(1); } 50% { transform: skewY(-6deg) scaleX(.9); } }
@keyframes foam { 0%, 100% { opacity: .25; } 50% { opacity: .6; } }
@keyframes cloud { from { transform: translate(-300px, var(--y)); } to { transform: translate(1900px, var(--y)); } }
@keyframes fly {
  0% { transform: translate(-60px, var(--y)) scale(var(--s)); }
  50% { transform: translate(800px, calc(var(--y) - 40px)) scale(var(--s)); }
  100% { transform: translate(1680px, var(--y)) scale(var(--s)); }
}
@keyframes flap { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(-.5); } }

@media (prefers-reduced-motion: reduce) {
  .scene *, .auth-card { animation: none !important; }
  .cloud.c1 { transform: translate(300px, 300px); }
  .cloud.c2 { transform: translate(1200px, 380px); }
  .cloud.c3 { transform: translate(800px, 250px); }
  .gull { display: none; }
}

.auth-info {
  margin-bottom: 4px; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.4;
  color: #d9f5e4; background: rgba(40, 170, 100, 0.2); border: 1px solid rgba(90, 210, 140, 0.35);
}
.auth-alt { margin: 16px 0 0; text-align: center; font-size: 14px; color: rgba(244, 241, 234, 0.66); }
.auth-alt a { color: #ffb08a; font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.auth-forgot + .auth-alt { margin-top: 8px; }
.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.pw-rules li {
  padding: 4px 9px 4px 22px; border-radius: 999px; position: relative;
  color: rgba(244, 241, 234, 0.6); background: rgba(255, 255, 255, 0.06); transition: color .15s, background .15s;
}
.pw-rules li::before { content: "○"; position: absolute; left: 8px; top: 3px; font-size: 11px; }
.pw-rules li.ok { color: #c9f2d8; background: rgba(40, 170, 100, 0.22); }
.pw-rules li.ok::before { content: "✓"; }

/* Phones (portrait): the scene sits on top with the tower in the middle, the card below it. */
@media (max-aspect-ratio: 4/5) {
  .scene { inset: 0 auto auto calc(50vw - 54vh * 1.1844); width: calc(54vh * 1.7778); height: 54vh; }
  body.auth { background: #05081a; }
  body.auth::after { background: linear-gradient(180deg, rgba(5, 8, 26, 0) 40vh, #05081a 54vh); }
  .auth-wrap { place-items: end center; padding-top: 38vh; }
}

/* Wordmark on the card: Alara & Ammar */
.auth-logo {
  display: inline-flex; align-items: baseline; align-self: center; gap: 4px; margin-bottom: 16px;
  font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: #fff;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.auth-logo i {
  font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; font-size: 1.35em;
  color: #ff3b5c; margin: 0 1px; transform: translateY(0.04em);
  text-shadow: 0 0 22px rgba(228, 0, 43, 0.7);
}
@media (max-width: 420px) { .auth-logo { font-size: 26px; } }
