/* ==========================================================================
   Forsine Capital — Investor Center
   forsine.css  |  v0.1  |  Login / authentication surfaces
   Portable: no framework, no build step. Drop straight into Laravel later.
   ========================================================================== */

:root {
  /* Navy ramp — cool, desaturated, no blue-purple cast */
  --navy-950: #060B14;
  --navy-900: #0A1220;
  --navy-850: #0C1626;
  --navy-800: #101B2E;
  --navy-700: #16233A;
  --navy-600: #1D2C46;

  /* Hairlines */
  --line: #203050;
  --line-soft: rgba(255, 255, 255, 0.055);

  /* Type colours */
  --text: #E9EEF6;
  --text-dim: #A6B4C8;
  --muted: #77879F;

  /* Single accent: muted brass. Used only for the rule, focus, primary action. */
  --brass: #C2A46B;
  --brass-soft: rgba(194, 164, 107, 0.16);
  --brass-dim: #7C6A3E;

  --danger: #E5786D;
  --danger-soft: rgba(229, 120, 109, 0.10);
  --ok: #6FAE8C;

  --radius: 4px;
  --radius-lg: 6px;

  --font-display: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  /* Tells the browser to render scrollbars, checkboxes and native form
     controls in dark. Without it they render light and break the page. */
  color-scheme: dark;
}

html, body { height: 100%; }

::selection {
  background: var(--brass-soft);
  color: var(--text);
}

body {
  margin: 0;
  background: var(--navy-950);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* --------------------------------------------------------------------------
   Identity panel (left) — signature: ruled ledger backdrop
   -------------------------------------------------------------------------- */

.identity {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 5vw, 72px);
  background: var(--navy-900);
  border-right: 1px solid var(--line);
}

/* Accounting-paper rules. Deliberately near-invisible. */
.identity::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 33px,
    var(--line-soft) 33px,
    var(--line-soft) 34px
  );
  pointer-events: none;
}

/* Soft depth so the rules fade toward the edges */
.identity::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 15% 12%, rgba(29, 44, 70, 0.55) 0%, transparent 62%);
  pointer-events: none;
}

.identity > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.wordmark {
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.02;
  letter-spacing: 0.012em;
  color: var(--text);
}

.wordmark em {
  font-style: italic;
  color: var(--brass);
}

.rule {
  width: 52px;
  height: 1px;
  margin: 26px 0 0;
  background: var(--brass);
  border: 0;
}

.identity__lede {
  max-width: 34ch;
  margin: 24px 0 0;
  color: var(--text-dim);
  font-size: 15px;
}

.identity__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.identity__foot span { white-space: nowrap; }

/* --------------------------------------------------------------------------
   Auth panel (right)
   -------------------------------------------------------------------------- */

.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 5vw, 72px) clamp(20px, 4vw, 56px);
  background: var(--navy-950);
}

.card {
  width: 100%;
  max-width: 392px;
}

.card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 27px;
  letter-spacing: 0.005em;
  color: var(--text);
}

.card__sub {
  margin: 8px 0 30px;
  color: var(--muted);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */

.field {
  margin: 0 0 18px;
}

.field__label {
  display: block;
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.input,
.field__wrap {
  width: 100%;
}

.input {
  display: block;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  background: var(--navy-800);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
}

.input::placeholder { color: #5C6C84; }

.input:hover { border-color: #2A3C5C; }

.input:focus-visible,
.input:focus {
  border-color: var(--brass-dim);
  background: var(--navy-700);
  box-shadow: 0 0 0 3px var(--brass-soft);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

/* Chrome/Safari paint autofilled fields near-white, which destroys a dark
   form. There is no way to override background-color directly — the inset
   shadow trick is the only reliable fix. */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--navy-800) inset;
  box-shadow: 0 0 0 1000px var(--navy-800) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

.input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--navy-700) inset, 0 0 0 3px var(--brass-soft);
  box-shadow: 0 0 0 1000px var(--navy-700) inset, 0 0 0 3px var(--brass-soft);
}

/* Password field with reveal control */
.field__wrap {
  position: relative;
}

.field__wrap .input {
  padding-right: 62px;
}

.reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 6px 9px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}

.reveal:hover { color: var(--text-dim); background: var(--navy-700); }

.reveal:focus-visible {
  outline: none;
  color: var(--text);
  box-shadow: 0 0 0 2px var(--brass-soft);
}

/* Row: remember me + forgot */
.form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 26px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--brass);
  cursor: pointer;
}

.check input:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.link {
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}

.link:hover { color: var(--brass); border-bottom-color: var(--brass-dim); }

.link:focus-visible {
  outline: none;
  color: var(--brass);
  box-shadow: 0 2px 0 0 var(--brass);
}

/* Primary action */
.btn {
  display: block;
  width: 100%;
  padding: 13px 18px;
  color: var(--navy-950);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  background: var(--brass);
  border: 1px solid var(--brass);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 140ms var(--ease), transform 90ms var(--ease);
}

.btn:hover { background: #CFB37C; border-color: #CFB37C; }

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

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--navy-950), 0 0 0 5px var(--brass);
}

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

/* --------------------------------------------------------------------------
   Messages
   -------------------------------------------------------------------------- */

.notice {
  margin: 0 0 22px;
  padding: 11px 14px;
  font-size: 13px;
  border: 1px solid;
  border-radius: var(--radius);
}

.notice--error {
  color: #F0A79F;
  background: var(--danger-soft);
  border-color: rgba(229, 120, 109, 0.35);
}

.notice--info {
  color: var(--text-dim);
  background: rgba(194, 164, 107, 0.06);
  border-color: rgba(194, 164, 107, 0.24);
}

/* --------------------------------------------------------------------------
   Card footer
   -------------------------------------------------------------------------- */

.card__foot {
  margin: 28px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.card__foot p { margin: 0 0 6px; }
.card__foot p:last-child { margin-bottom: 0; }

.stamp {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: #5F708A;
}

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .identity {
    padding: 34px 26px 30px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .identity__lede { display: none; }

  .identity__foot { margin-top: 22px; }

  .wordmark { font-size: 30px; margin-top: 16px; }

  .rule { margin-top: 18px; }

  .auth {
    align-items: flex-start;
    padding: 34px 26px 56px;
  }

  .card { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   v0.2 — Application shell (admin / account pages)
   The login uses the split .shell layout. Everything behind the login uses
   this: a fixed topbar and a single measured column.
   ========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(20px, 4vw, 44px);
  height: 62px;
  background: var(--navy-900);
  border-bottom: 1px solid var(--line);
}

.topbar__brand {
  display: flex;
  align-items: baseline;
  gap: 11px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.topbar__brand em { font-style: italic; color: var(--brass); }

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar__nav::-webkit-scrollbar { display: none; }

.navlink {
  padding: 7px 12px;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius);
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}

.navlink:hover { color: var(--text); background: var(--navy-700); }

.navlink:focus-visible {
  outline: none;
  color: var(--text);
  box-shadow: 0 0 0 2px var(--brass);
}

.navlink[aria-current="page"] {
  color: var(--text);
  background: var(--navy-700);
  box-shadow: inset 0 -2px 0 0 var(--brass);
}

.page {
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 46px) clamp(20px, 4vw, 44px) 80px;
}

.page__head {
  margin: 0 0 26px;
}

.page__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.005em;
  color: var(--text);
}

.page__sub {
  margin: 7px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 14px;
}

/* Panel — a bordered block inside .page */
.panel {
  margin: 0 0 24px;
  background: var(--navy-850);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.panel__head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.panel__title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.panel__body { padding: 20px; }

.panel__body > :first-child { margin-top: 0; }
.panel__body > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Table
   -------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 12px 20px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  background: var(--navy-900);
}

.table tbody tr:last-child td { border-bottom: 0; }

.table tbody tr:hover td { background: rgba(255, 255, 255, 0.018); }

.table .col-actions { text-align: right; white-space: nowrap; }

.cell-name { color: var(--text); }

.cell-id {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid;
  border-radius: 2px;
}

.badge--role   { color: var(--text-dim); background: var(--navy-700); border-color: var(--line); }
.badge--active { color: var(--ok);     background: rgba(111, 174, 140, 0.09); border-color: rgba(111, 174, 140, 0.32); }
.badge--held   { color: var(--danger); background: var(--danger-soft);        border-color: rgba(229, 120, 109, 0.32); }
.badge--must   { color: var(--brass);  background: rgba(194, 164, 107, 0.09); border-color: rgba(194, 164, 107, 0.32); }

/* --------------------------------------------------------------------------
   Button variants
   -------------------------------------------------------------------------- */

.btn--sm {
  display: inline-block;
  width: auto;
  padding: 7px 13px;
  font-size: 11px;
  letter-spacing: 0.09em;
}

.btn--ghost {
  color: var(--text-dim);
  background: transparent;
  border-color: var(--line);
}

.btn--ghost:hover {
  color: var(--text);
  background: var(--navy-700);
  border-color: #2A3C5C;
}

.btn--danger {
  color: #FFF2F0;
  background: transparent;
  border-color: rgba(229, 120, 109, 0.45);
}

.btn--danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* --------------------------------------------------------------------------
   One-time secret display
   -------------------------------------------------------------------------- */

.secret {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 14px 0 0;
  padding: 14px 16px;
  background: var(--navy-950);
  border: 1px dashed var(--brass-dim);
  border-radius: var(--radius);
}

.secret__value {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--brass);
  user-select: all;
  overflow-wrap: anywhere;
}

.secret__note {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */

.stack-sm > * + * { margin-top: 14px; }

.text-break { overflow-wrap: anywhere; }

.card__foot .btn-row { margin-top: 14px; }

.hint {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.notice ul { margin: 8px 0 0; padding-left: 18px; }
.notice li { margin: 3px 0; }

@media (max-width: 620px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .topbar__nav { margin-left: 0; width: 100%; }
  .table th, .table td { padding: 11px 14px; }
}

/* Utility classes replacing inline style attributes — the CSP sets
   style-src 'self' with no 'unsafe-inline', so style="" is blocked. */
.btn-row--end   { justify-content: flex-end; }
.btn-row--tight { gap: 8px; }
.cell-plain     { font-family: var(--font-ui); font-size: 13px; color: var(--text-dim); white-space: nowrap; }

.input--inline {
  width: 150px;
  padding: 7px 10px;
  font-size: 12px;
}

.card__foot .link-row { margin-top: 14px; }

@media (max-width: 620px) {
  .input--inline { width: 100%; }
  .btn-row--end  { justify-content: flex-start; }
  .table .col-actions { text-align: left; }
}

/* Sign-out is a POST form, so the control is a <button> that must look and
   behave exactly like the surrounding nav links. */
.navlink-form { display: inline-flex; margin: 0; }

.navlink--button {
  font-family: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  line-height: inherit;
}

/* Inline code — file names, config keys, paths. Used in install guidance. */
code {
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--brass);
  background: var(--navy-950);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow-wrap: anywhere;
}

.notice code { border-color: transparent; }

/* Native select styled to match .input — the browser arrow is left in place
   on purpose so the control still reads as a dropdown. */
select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

select.input option { background: var(--navy-800); color: var(--text); }

.field__label .hint { display: inline; margin: 0; text-transform: none; letter-spacing: 0; }

.page-actions { margin: 0 0 20px; }
