/* Eternem — Neo-Skeuomorphic Black Metal auth-action handler.
   Tokens mirror docs/design-system-v2/eternem_design.md. Accent (#81D8D0)
   is used as LIGHT (glow / edge / text), never as a fill. */

:root {
  --bg-0: #0B0B0C;
  --bg-1: #0F0F10;
  --bg-2: #121214;
  --panel-hi: #1C1C1F;
  --panel-lo: #151517;
  --card-2: #202024;
  --input: #101012;
  --border: #2A2A2E;
  --accent: #81D8D0;
  --accent-dim: rgba(129, 216, 208, 0.16);
  --accent-line: rgba(129, 216, 208, 0.55);
  --text: #EDEDED;
  --text-dim: #9A9A9A;
  --danger: #E5675E;
  --ok: #81D8D0;
  --radius: 18px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "Noto Sans Hebrew", "Noto Sans Arabic", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(120% 90% at 50% -10%, #17171A 0%, var(--bg-1) 42%, var(--bg-0) 100%);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.stage {
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.brand { display: flex; justify-content: center; }
.brand img {
  width: 220px;
  max-width: 66%;
  height: auto;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.55));
  user-select: none;
  -webkit-user-drag: none;
}

/* ---- Metal panel ------------------------------------------------------- */
.card {
  width: 100%;
  background: linear-gradient(160deg, var(--panel-hi) 0%, var(--panel-lo) 58%, #131315 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px 32px;
  box-shadow:
    0 26px 60px -20px rgba(0, 0, 0, 0.85),
    0 2px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 -18px 40px -30px rgba(0, 0, 0, 0.9) inset;
  position: relative;
  overflow: hidden;
}
/* top edge catch-light */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.10), transparent);
}

h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text);
}
.subtitle {
  margin: 0 0 22px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-dim);
}
[dir="rtl"] h1, [dir="rtl"] .subtitle { text-align: right; }

/* ---- Inset input ------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}
.input-wrap { position: relative; display: flex; align-items: center; }
input[type="password"], input[type="text"] {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 46px 14px 14px;
  outline: none;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.65), inset 0 -1px 0 rgba(255, 255, 255, 0.02);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
[dir="rtl"] input { padding: 14px 14px 14px 46px; }
input::placeholder { color: #5c5c62; }
input:focus {
  border-color: var(--accent-line);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.65), 0 0 0 3px var(--accent-dim);
}
.toggle {
  position: absolute;
  right: 8px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer;
  color: var(--text-dim);
  border-radius: 8px;
}
[dir="rtl"] .toggle { right: auto; left: 8px; }
.toggle:hover { color: var(--text); }
.toggle svg { width: 20px; height: 20px; }

/* ---- Requirement checklist -------------------------------------------- */
.reqs { margin: 18px 0 6px; }
.reqs .reqs-title {
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px;
}
.reqs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.reqs li {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--text-dim);
  transition: color 0.16s ease;
}
.reqs li .dot {
  width: 16px; height: 16px; flex: 0 0 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--input);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s ease;
}
.reqs li .dot svg { width: 10px; height: 10px; opacity: 0; transform: scale(0.6); transition: all 0.18s ease; color: #0B0B0C; }
.reqs li.met { color: var(--text); }
.reqs li.met .dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-dim);
}
.reqs li.met .dot svg { opacity: 1; transform: scale(1); }

/* ---- Primary button (lit metal) --------------------------------------- */
.btn {
  width: 100%;
  margin-top: 20px;
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: 0.3px;
  color: var(--accent);
  background: linear-gradient(180deg, var(--card-2), #17171A);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 0 22px -6px var(--accent-dim);
  transition: box-shadow 0.18s ease, transform 0.06s ease, color 0.18s ease, opacity 0.18s ease;
}
.btn:hover:not(:disabled) {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 0 30px -4px rgba(129, 216, 208, 0.4);
  color: #A6E7E1;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; color: var(--text-dim); border-color: var(--border); box-shadow: none; }

.linkline { margin-top: 18px; text-align: center; font-size: 13.5px; color: var(--text-dim); }
.linkline a { color: var(--accent); text-decoration: none; font-weight: 600; }
.linkline a:hover { text-decoration: underline; }

/* ---- Status (spinner / success / error) ------------------------------- */
.status { text-align: center; padding: 6px 0 2px; }
.status .glyph {
  width: 64px; height: 64px; margin: 4px auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.spinner {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(129, 216, 208, 0.15);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.glyph.ok, .glyph.err {
  border: 1px solid var(--border);
  background: radial-gradient(circle at 50% 35%, #1D1D20, #131315);
}
.glyph.ok { box-shadow: 0 0 26px -6px var(--accent-dim); }
.glyph.ok svg { width: 30px; height: 30px; color: var(--accent); }
.glyph.err svg { width: 30px; height: 30px; color: var(--danger); }
.status h1 { text-align: center; }
.status .subtitle { text-align: center; }

.hint { margin-top: 14px; font-size: 12.5px; color: #6f6f76; text-align: center; line-height: 1.5; }

.form-err { color: var(--danger); font-size: 13.5px; line-height: 1.45; margin: 12px 0 0; text-align: center; }

.hidden { display: none !important; }

/* entrance */
.card, .brand { animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.brand { animation-delay: 0.02s; }
.card { animation-delay: 0.08s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .card, .brand { animation: none; }
  .spinner { animation-duration: 1.6s; }
}

@media (max-width: 420px) {
  .card { padding: 26px 20px 28px; }
  .brand img { width: 180px; }
}
