/* ==========================================================================
   Dexiem — login prototype
   Flat, white, underline-only fields, pure brand blue.
   ========================================================================== */

:root {
  --brand: #0000ff;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --logo-font: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6b6f76;
  --line: #d6d8dc;
  --accent: #0000ff;
  --accent-hover: #0000cc;
  --accent-fg: #ffffff;
  --error: #c8102e;
  --notice-bg: #f2f3f5;
  --focus: #0000ff;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.auth-pending body { visibility: hidden; }

/* ---------- logo ---------- */
.logo {
  font-family: var(--logo-font);
  font-weight: 700;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--fg);
  user-select: none;
}
.logo .x { color: var(--brand); }
.logo-sm { font-size: 26px; }

/* ---------- layout ---------- */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 16px;
}
.brand { text-align: center; margin-bottom: 44px; }
.tagline {
  margin: 14px 0 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel { width: 100%; max-width: 360px; }

/* ---------- form ---------- */
.card { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input {
  width: 100%;
  height: 40px;
  padding: 0;
  background: transparent;
  color: var(--fg);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:hover { border-color: var(--muted); }
.field input:focus { border-color: var(--focus); box-shadow: 0 1px 0 0 var(--focus); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field input[aria-invalid="true"]:focus { box-shadow: 0 1px 0 0 var(--error); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 56px; }
.reveal {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  height: 32px; padding: 0 0 0 10px;
  background: none; border: 0; cursor: pointer;
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.reveal:hover { color: var(--fg); }
.reveal:focus-visible { outline: 1px solid var(--focus); }

.hint { margin: 0; font-size: 12px; color: var(--muted); }
.notice {
  margin: 0; padding: 10px 12px;
  background: var(--notice-bg);
  border-left: 2px solid var(--accent);
  font-size: 13px;
}
.form-error {
  margin: -6px 0 0;
  font-size: 13px;
  color: var(--error);
}

.submit {
  height: 46px;
  margin-top: 4px;
  background: var(--accent);
  color: var(--accent-fg);
  border: 0;
  border-radius: 0;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color .15s ease;
}
.submit:hover:not(:disabled) { background: var(--accent-hover); }
.submit:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.submit:disabled { opacity: .55; cursor: not-allowed; }
.submit[aria-busy="true"] { opacity: .8; cursor: progress; }

.legal {
  margin: 36px 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ==========================================================================
   Authenticated app shell
   ========================================================================== */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px; padding: 0 24px;
  border-bottom: 1px solid var(--line);
}
.topbar-right { display: flex; align-items: center; gap: 16px; min-width: 0; }
.who { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-ghost {
  height: 34px; padding: 0 14px;
  background: transparent; border: 1px solid var(--line); border-radius: 0;
  font-size: 13px; cursor: pointer; flex-shrink: 0;
}
.btn-ghost:hover { border-color: var(--fg); }
.app-main { max-width: 880px; margin: 0 auto; padding: 72px 24px 120px; }
.eyebrow {
  margin: 0 0 12px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted);
}
.app-title { margin: 0; font-size: 36px; font-weight: 600; letter-spacing: -0.02em; }
.app-sub { margin: 8px 0 40px; color: var(--muted); }
.session-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 0; border: 1px solid var(--line);
  background: var(--line); gap: 1px;
}
.session-grid div { background: var(--bg); padding: 18px 20px; }
.session-grid dt {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.session-grid dd { margin: 0; font-family: var(--mono); font-size: 15px; }
@media (max-width: 520px) {
  .who { display: none; }
  .app-title { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
