@import url("https://fonts.googleapis.com/css2?family=Signika:wght@300;400;600;700&display=swap");

:root {
  --brand: #2b78e4;
  --brand-2: #6b9fd8;
  --bg: #000;
  --glass: rgba(255, 255, 255, 0.12);
  --glass-strong: rgba(255, 255, 255, 0.18);
  --text: #eaeaea;
  --muted: #b7c2d1;
  --error: #ff6b6b;
  --ok: #3ad29f;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --pad: 24px;
  --blur: 20px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: light) {
  :root {
    --text: #111;
    --bg: #f8fbff;
    --glass: rgba(0, 0, 0, 0.06);
    --glass-strong: rgba(0, 0, 0, 0.08);
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: "Signika", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

.intro-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.78);
  z-index: 1;
}
.overlay-blur {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2;
}

.auth-wrapper {
  position: relative;
  z-index: 3;
  min-height: 100dvh;
  padding: calc(16px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  display: grid;
  place-items: center;
}

.auth-box {
  width: min(420px, 92vw);
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-box h3 {
  margin: 0 0 18px;
  font-size: clamp(20px, 2.6vw, 26px);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.msg {
  background: var(--glass-strong);
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.form {
  display: none;
}
.form.active {
  display: block;
}

.input-group {
  margin-bottom: 14px;
}

input {
  width: 100%;
  height: 44px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: "Signika", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
input::placeholder {
  color: #cfd8e3;
  opacity: 0.85;
}
input:focus {
  border-color: rgba(43, 120, 228, 0.85);
  box-shadow: 0 0 0 4px rgba(43, 120, 228, 0.2);
  background: rgba(255, 255, 255, 0.12);
}

button {
  width: 100%;
  height: 46px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: "Signika", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(43, 120, 228, 0.35);
}
button:active {
  transform: translateY(0px) scale(0.99);
}
button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.switch {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.switch a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease, text-decoration 0.2s ease;
}

.switch a:hover {
  opacity: 0.85;
}

.form p {
  margin: 0 0 12px;
  font-size: 15px;
}

#overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 99;
  color: #222;
  text-align: center;

  background: radial-gradient(
      1200px 800px at 20% 20%,
      #8bb8e8 0%,
      transparent 55%
    ),
    radial-gradient(1200px 800px at 80% 80%, #98788f 0%, transparent 55%),
    linear-gradient(135deg, #8bb8e8, #98788f);
}
#overlay.show {
  display: grid;
  place-items: center;
  padding: 24px;
}

.overlay-box {
  width: min(680px, 92vw);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: clamp(28px, 5vw, 40px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
#overlay h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 4.5vw, 32px);
  color: #222;
}
#overlay p {
  margin: 0;
  color: #222;
}

.catContainer {
  margin-top: 18px;
  display: grid;
  place-items: center;
}
.catbody {
  width: 120px;
  animation: float 2s ease-in-out infinite alternate;
}
.tail {
  width: 30px;
}
.bigzzz,
.zzz {
  color: #222;
  animation: zzz 2s linear infinite;
}

@keyframes float {
  to {
    transform: translateY(-8px);
  }
}
@keyframes zzz {
  0%,
  100% {
    opacity: 0.1;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 480px) {
  .auth-box {
    width: 100%;
  }
  input,
  button {
    height: 48px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .auth-box {
    width: min(520px, 86vw);
  }
}

@media (min-width: 1280px) {
  .auth-box {
    width: 420px;
  }
}

.is-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.25) !important;
}
.badge-ok {
  color: #0f5132;
  background: #d1fae5;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 700;
}

.form input {
  margin-bottom: 12px;
}
.form button {
  margin-top: 4px;
}

@supports (height: 100dvh) {
  .auth-wrapper {
    min-height: 100dvh;
  }
}

.active {
  display: block;
}
.show {
  display: grid !important;
}

.hint {
  margin-bottom: 8px;
  font-size: 14px;
  color: #cbd5e1;
}

.stack-12 > * + * {
  margin-top: 12px;
}

.select.input-like {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: "Signika", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 40px;
}
.select.input-like:focus {
  border-color: rgba(43, 120, 228, 0.85);
  box-shadow: 0 0 0 4px rgba(43, 120, 228, 0.2);
  background: rgba(255, 255, 255, 0.12);
}
.select.input-like option {
  color: #111;
  background: #fff;
  font-weight: 500;
}

.detail {
  text-align: left;
  margin-top: 16px;
  font-size: 15px;
  color: #f4f4f4;
  line-height: 1.6;
}
.detail code {
  background: rgba(255, 255, 255, 0.25);
  padding: 3px 6px;
  border-radius: 6px;
  color: #fff;
}

.qr-box {
  display: grid;
  place-items: center;
  margin-top: 12px;
}
.qr-box img {
  max-width: 240px;
  border-radius: 10px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.4);
}

@media (max-width: 600px) {
  .qr-box img {
    max-width: 220px;
  }
}

.button {
  display: inline-block;
  width: 100%;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(43, 120, 228, 0.35);
}

.button:active {
  transform: translateY(0px) scale(0.99);
}

body {
  overflow-y: auto;
}

.auth-wrapper {
  min-height: 100dvh;
  display: grid;
  justify-items: center;
  align-content: start;
  padding: calc(16px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  gap: 16px;
}

@media (min-height: 640px) {
  .auth-wrapper {
    align-content: center;
  }
}

.auth-box {
  margin: 0 auto;
}

@media (max-width: 480px) {
  .auth-wrapper {
    padding-bottom: max(32px, calc(24px + var(--safe-bottom)));
  }
}

body {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.auth-wrapper {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.auth-wrapper::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.auth-wrapper.maint-active {
        position: fixed;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.60);
        z-index: 10000;
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        padding: 20px;
    }

    .auth-box.maint-box {
        max-width: 480px;
        width: 100%;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.02));
        border: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
        padding: 28px 26px;
        border-radius: 14px;
        text-align: center;
        color: #ffffff;
    }

    .maint-icon {
        font-size: 48px;
        margin-bottom: 6px;
        display: block
    }

    .maint-title {
        margin-bottom: 6px;
        font-size: 1.9rem;
        font-weight: 700
    }

    .maint-desc {
        margin-bottom: 14px;
        font-size: 1.05rem;
        opacity: 0.95
    }

    .maint-footer {
        font-size: 0.9rem;
        opacity: 0.9
    }

    body.maintenance-mode .auth-wrapper:not(.maint-active) {
        display: none !important
    }

    @media (max-width:420px) {
        .auth-box.maint-box {
            padding: 20px;
            border-radius: 12px
        }

        .maint-title {
            font-size: 1.4rem
        }

        .maint-icon {
            font-size: 40px
        }
    }