/* Sign-in page — deliberately standalone.
   app.css describes the editor's full-screen layout (flex chrome, locked scrolling,
   `main { display:flex }`), none of which suits a single centred card. Sharing it
   once already broke this page, so the tokens are repeated here and nothing else
   is inherited. */

:root {
  --bg: #0e1116;
  --bg-2: #151a22;
  --bg-3: #1c232e;
  --line: #2a3341;
  --fg: #dfe6ef;
  --fg-dim: #8b97a8;
  --accent: #26c281;
  --danger: #e5534b;
  font-synthesis: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Any `display` declaration outranks the UA sheet's [hidden] rule, so state it
   once here rather than remembering it at every element that can be hidden. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 "Segoe UI", "Noto Sans Thai", system-ui, sans-serif;
}

body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
  background:
    radial-gradient(820px 520px at 50% -8%, #1a2a38 0%, transparent 70%),
    var(--bg);
}

.card {
  width: 100%;
  max-width: 372px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 30px 24px;
  box-shadow: 0 24px 64px #00000080;
}

/* ------------------------------------------------------------------ header */

.mark {
  width: 46px; height: 46px;
  border-radius: 11px;
  background: linear-gradient(150deg, #0d7c4a, #26c281);
  display: grid; place-items: center;
  margin-bottom: 16px;
  box-shadow: 0 6px 18px #26c28133;
}
.mark svg { display: block; }

h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .2px;
  margin: 0;
}
.sub {
  color: var(--fg-dim);
  font-size: 12.5px;
  margin: 5px 0 24px;
}

/* ------------------------------------------------------------------- form */

label {
  display: block;
  font-size: 12px;
  color: var(--fg-dim);
  margin-bottom: 5px;
}

.field { margin-bottom: 16px; }

input[type=text], input[type=password] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder { color: #5d6b7d; }
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #26c28126;
}

/* The reveal button sits inside the field, so leave room for it. */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-toggle {
  position: absolute; top: 0; right: 0;
  height: 100%; width: 38px;
  display: grid; place-items: center;
  background: none; border: 0; padding: 0;
  color: var(--fg-dim); font-size: 15px;
  cursor: pointer; border-radius: 0 8px 8px 0;
}
.pw-toggle:hover { color: var(--fg); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

button.submit {
  width: 100%;
  margin-top: 4px;
  padding: 11px;
  background: var(--accent);
  color: #06210f;
  border: 0; border-radius: 8px;
  font: inherit; font-weight: 700;
  cursor: pointer;
  transition: filter .12s;
}
button.submit:hover { filter: brightness(1.08); }
button.submit:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
button.submit:disabled { filter: saturate(.35); cursor: progress; }

.error {
  display: flex; gap: 8px; align-items: flex-start;
  background: #e5534b1a;
  border: 1px solid #e5534b4d;
  color: #ffb9b3;
  border-radius: 8px;
  padding: 9px 11px;
  margin: 0 0 16px;
  font-size: 12.5px;
}
.error::before { content: "!"; font-weight: 700; color: var(--danger); flex: 0 0 auto; }

.foot {
  color: var(--fg-dim);
  font-size: 11.5px;
  text-align: center;
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 420px) {
  body { padding: 14px; }
  .card { padding: 26px 20px 20px; }
}
