/*
 * Kōza: styles for the server-rendered pages (login and error).
 * Every other page is the React app in static/spa/, styled with Tailwind.
 * Colours follow the Ocean Depths theme used by the React app.
 */

@font-face { font-family: "IBM Plex Sans"; src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/IBMPlexSans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #ffffff;
  --text: #1a2332;
  --text-2: #4d5754;
  --line: rgba(26, 35, 50, 0.10);
  --line-strong: rgba(26, 35, 50, 0.18);
  --accent: #22706f;
  --accent-hover: #1a5a59;
  --accent-soft: #dcefef;
  --navy: #1a2332;
  --navy-text: #c9dcdd;
  --seafoam: #a8dadc;
  --danger: #b23a3a;
  --ok: #2e7a57;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; font: 400 14px/20px var(--sans); color: var(--text); background: var(--bg); }
h1 { font-size: 28px; line-height: 36px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 8px; }
p { margin: 0 0 12px; }
code { font-family: var(--mono); font-size: 13px; background: #eef2f4; padding: 1px 4px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Layout: illustration on navy at the left, form on white at the right */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.login-art {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px; background: var(--navy); color: var(--navy-text);
}
.login-illustration { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.wordmark { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; align-self: flex-start; color: #fff; font-size: 17px; font-weight: 600; background: var(--navy); padding: 4px 8px 4px 0; }
.wordmark svg { color: var(--seafoam); flex: none; }
.login-main { display: grid; place-items: center; min-height: 100vh; padding: 40px 24px; }
.login-wrap .login-main { min-height: 0; }
.login { width: 100%; max-width: 360px; }
.lead { color: var(--text-2); margin-bottom: 24px; }

/* Form */
.login form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--text-2); }
input {
  font: 400 14px/20px var(--sans); color: var(--text); width: 100%; min-height: 40px; padding: 9px 12px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px;
  font: 500 14px/20px var(--sans); border-radius: 8px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--text); text-decoration: none; cursor: pointer;
  transition: background-color 150ms ease, transform 120ms ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.login .btn { width: 100%; }

/* Messages */
.flash { padding: 12px 16px; margin-bottom: 16px; border-radius: 8px; border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.flash-error { border-left-color: var(--danger); }
.flash-info { border-left-color: var(--ok); }

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-art { min-height: 160px; padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
