/* StoryMachine — Login Room styling */

:root {
  --bg: #0c0c0c;
  --bg-panel: #161616;
  --bg-soft: #1c1c1c;
  --line: #2a2a2a;
  --line-2: #3a3a3a;
  --red: #ff0033;
  --red-dim: #b80026;
  --muted: #9a9a9a;
  --faint: #6b6b6b;
  --paper-ink: #ebe4d7;
  --text: #f1f1f1;
  --bad: #e5484d;
  --bad-soft: rgba(229, 72, 77, 0.14);
  --font: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "IBM Plex Mono", "Cascadia Code", ui-monospace, monospace;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--red);
  color-scheme: dark;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #101010 0%, var(--bg) 180px),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.035 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    linear-gradient(180deg, #101010 0%, var(--bg) 220px);
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.login-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--red);
  color: #ffffff;
  font-size: 12px;
  border-radius: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.1;
  margin: 0;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.02em;
  margin: 0;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-family: var(--mono);
}

input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="password"]:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: var(--focus);
}

.form-actions {
  display: flex;
  flex-direction: column;
}

.act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 24px;
  background: var(--bg-panel);
  border: 1px solid var(--line-2);
  border-radius: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.act-btn:hover:not(:disabled) {
  background: var(--bg-soft);
  border-color: var(--text);
}

.act-btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.act-btn.primary:hover:not(:disabled) {
  background: var(--red-dim);
  border-color: var(--red-dim);
}

.act-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.act-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.login-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  padding: 0;
  border-radius: 0;
  transition: all 0.15s ease;
}

.login-note.err {
  padding: 8px 12px;
  background: var(--bad-soft);
  border-left: 3px solid var(--bad);
  color: #ff9999;
}
