/* tr8dings - login and account pages.
   Self-contained on purpose: system fonts, no images, nothing fetched from elsewhere (CSP default-src 'self'). */

:root {
  --bg: #0B1A2E;
  --card: #13294B;
  --text: #F5F1E8;
  --gold: #C9A961;
  --cta: #FF9F1C;
  --muted: rgba(245, 241, 232, 0.68);
  --hairline: rgba(201, 169, 97, 0.32);
  --field-line: rgba(245, 241, 232, 0.24);
  --focus-ring: rgba(201, 169, 97, 0.30);
  color-scheme: dark;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* margin:auto centres the column and still lets a tall page scroll from its top on a short screen */
.shell {
  width: 100%;
  max-width: 26rem;
  margin: auto;
  padding: 2rem 1.25rem calc(2rem + env(safe-area-inset-bottom, 0px));
}

/* ---- wordmark ---- */

.brand {
  margin: 0 0 1.75rem;
  text-align: center;
}

.wordmark {
  display: inline-block;
  margin: 0;
  color: var(--gold);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.wordmark::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin: 0.8rem auto 0;
  border-radius: 1px;
  background: var(--gold);
}

a.wordmark:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
  border-radius: 4px;
}

/* ---- card ---- */

.card {
  padding: 1.75rem 1.5rem 1.5rem;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 18px 40px rgba(3, 9, 18, 0.45);
}

.heading {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

.field {
  margin-bottom: 1.1rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="password"] {
  display: block;
  width: 100%;
  height: 3rem;
  padding: 0 0.9rem;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: var(--bg);
  font: inherit; /* 16px keeps iOS from zooming into the field */
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* keep the dark field when the browser fills it in */
input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 100px var(--bg) inset;
}

input:-webkit-autofill:focus {
  box-shadow: 0 0 0 100px var(--bg) inset, 0 0 0 3px var(--focus-ring);
}

.hint {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.reveal {
  position: relative;
}

.reveal input {
  padding-right: 4.75rem;
}

.reveal-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 3rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 10px;
  color: var(--gold);
  background: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.reveal-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -4px;
}

/* ---- buttons ---- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  margin-top: 0.4rem;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #0B1A2E;
  background: var(--cta);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.button:hover {
  filter: brightness(1.07);
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.button:disabled {
  filter: none;
  opacity: 0.6;
  cursor: default;
}

.button-quiet {
  width: auto;
  margin-top: 0;
  border-color: var(--hairline);
  color: var(--text);
  background: transparent;
  font-weight: 600;
}

.button-quiet:hover {
  filter: none;
  border-color: var(--gold);
}

/* ---- messages ---- */

.notice {
  margin: 0 0 1.1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.notice-error {
  border-color: rgba(255, 138, 128, 0.60);
  color: #FFDAD5;
  background: rgba(255, 138, 128, 0.12);
}

.notice-ok {
  border-color: rgba(143, 214, 168, 0.55);
  color: #DBF5E4;
  background: rgba(143, 214, 168, 0.12);
}

.notice-warn {
  background: rgba(201, 169, 97, 0.12);
}

.fineprint {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: center;
}

/* ---- account page ---- */

.who {
  margin-bottom: 1.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--hairline);
}

.who-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.who-meta {
  min-height: 1.3rem;
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

[data-auth-role]:not(:empty)::before {
  content: " · ";
  white-space: pre;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

.link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 22rem) {
  .shell {
    padding-right: 0.9rem;
    padding-left: 0.9rem;
  }

  .card {
    padding: 1.4rem 1.1rem 1.2rem;
  }
}

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