/* Trade & Treaties: tokens and components from the V0 mockups (day and night themes). */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/assets/barlow-400-47c07709.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/assets/barlow-600-81a96cd2.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("/assets/barlow-condensed-700-74ef7090.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surf: #ffffff;
  --soft: #eef6f9;
  --top: #12324a;
  --topink: #ffffff;
  --ink: #12324a;
  --muted: #4b6576;
  --line: #b4d6e2;
  --acc: #0b7a6b;
  --accink: #ffffff;
  --other: #c8402c;
}

/* Night theme follows the device until the settings screen exists. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #152a35;
    --surf: #1e3a47;
    --soft: #1a3240;
    --top: #0f212b;
    --topink: #eef6f7;
    --ink: #eef6f7;
    --muted: #a9c0c8;
    --line: #3b6274;
    --acc: #46e0c2;
    --accink: #062019;
    --other: #ff6b57;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Barlow, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

h1, h2 { font-family: "Barlow Condensed", Barlow, sans-serif; font-weight: 700; }

a { color: var(--acc); }
a:hover { color: var(--ink); }

.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surf);
}

.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surf);
  color: var(--ink);
  font: 600 14px Barlow, system-ui, sans-serif;
  cursor: pointer;
}
.btn.pri { background: var(--acc); color: var(--accink); border-color: var(--acc); }
.btn.full { width: 100%; min-height: 48px; }

/* Top bar */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 64px;
  padding: 12px 16px;
  background: var(--top);
  color: var(--topink);
}
.top h1 { margin: 0; font-size: 22px; letter-spacing: .01em; }
.top .btn { background: transparent; color: var(--topink); border-color: transparent; }
.top-user { display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* Sign in and sign up (screens 01 and 02) */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-card { width: 100%; max-width: 420px; padding: 32px; gap: 28px; }

.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.brand h1 { margin: 0; font-size: 34px; line-height: 1.05; }
.logo { color: var(--acc); }

.auth { display: flex; flex-direction: column; gap: 14px; }
.auth p { margin: 0; }

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}
.tabs a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.tabs a.on { background: var(--surf); color: var(--ink); box-shadow: 0 0 0 2px var(--acc); }

.fld { display: flex; flex-direction: column; gap: 6px; }
.fld label { font-size: 14px; font-weight: 600; }
.fld input {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surf);
  color: var(--ink);
  font: 16px Barlow, system-ui, sans-serif;
}
.fld input:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }

.alert, .notice { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 14px; background: var(--soft); }
.alert { border: 1px solid var(--other); }
ul.alert { padding-left: 28px; }
.notice { border: 1px solid var(--acc); }

/* Rails wraps invalid fields in this div: keep the field layout unchanged. */
.field_with_errors { display: contents; }
.field_with_errors input { border-color: var(--other); }
