/* CarveWright account portal — modern UI
   Brand system per official style guide:
   colors — blue #26A2FF, black, gold #EEB111, gray #4D4D4D, navy #040F35
   type   — Teko (headings/display), Roboto (UI labels), Open Sans (body) */

:root {
  --blue: #26A2FF;
  --blue-dark: #0F82DB;
  --black: #000000;
  --gold: #EEB111;
  --gold-dark: #C8930A;
  --gray: #4D4D4D;
  --navy: #040F35;
  --navy-2: #0A1642;

  --paper: #fbf9f6;
  --line: #e7e1d6;
  --muted: var(--gray);
  --danger-bg: #fdecec;
  --danger-fg: #9a2020;
  --danger-line: #f2b8b8;
  --success-bg: #eaf6ec;
  --success-fg: #1e6b31;
  --success-line: #b7e0c0;
  --radius: 14px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.45);

  --font-display: "Teko", "Arial Narrow", sans-serif;
  --font-ui: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Open Sans", "Helvetica Neue", Arial, sans-serif;

  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--black);
  background:
    radial-gradient(1100px 600px at 15% -10%, var(--navy-2) 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #081230 0%, transparent 55%),
    var(--navy);
  background-attachment: fixed;
  min-height: 100%;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Header ---------- */
.topbar {
  padding: 28px clamp(20px, 5vw, 56px) 10px;
  text-align: center;
}
.logo-link { display: inline-block; }
.logo {
  height: 44px;
  width: auto;
  display: block;
}

/* ---------- Card layout ---------- */
.card-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 20px clamp(16px, 5vw, 56px) 60px;
}

.card {
  width: 100%;
  max-width: 720px;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  background: var(--navy);
  padding: 8px;
  gap: 6px;
}
.tab {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font: 700 20px/1 var(--font-display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 11px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.tab[aria-selected="true"] {
  background: var(--gold);
  color: var(--navy);
}

/* ---------- Panels ---------- */
.panels { padding: 30px clamp(20px, 4vw, 40px) 36px; }
.panel[hidden] { display: none; }

.panel-intro {
  margin: 0 0 20px;
  color: var(--gray);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
}

/* ---------- Banners ---------- */
.banner {
  border-radius: 10px;
  padding: 12px 16px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.banner[hidden] { display: none; }
.banner.alert {
  background: var(--danger-bg);
  color: var(--danger-fg);
  border-color: var(--danger-line);
}
.banner.info {
  background: var(--success-bg);
  color: var(--success-fg);
  border-color: var(--success-line);
}

/* ---------- Fieldsets ---------- */
fieldset {
  border: none;
  margin: 0 0 22px;
  padding: 0;
}
fieldset legend {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  margin-bottom: 16px;
}
legend .optional {
  font-family: var(--font-ui);
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
  font-size: 13px;
}

.form-narrow { max-width: 380px; }

/* ---------- Fields ---------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.field-row .field { flex: 1 1 180px; }
.field-row .field-sm { flex: 1 1 100px; }

label {
  display: block;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--black);
  margin-bottom: 6px;
}
.req { color: var(--gold-dark); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--black);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(38, 162, 255, 0.22);
}
input.invalid {
  border-color: var(--danger-fg);
  background: var(--danger-bg);
}

.err {
  display: block;
  min-height: 0;
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--danger-fg);
  margin-top: 5px;
  font-weight: 600;
}
.err:empty { display: none; }

/* ---------- Radio / checkbox group (Recover) ---------- */
.radio-group {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.radio-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.radio-option:has(input:checked) {
  border-color: var(--blue);
  color: var(--black);
  background: #eaf5ff;
}
.radio-option input { accent-color: var(--blue); }

/* ---------- Buttons ---------- */
.btn-primary {
  appearance: none;
  border: none;
  width: 100%;
  padding: 12px 18px;
  margin-top: 6px;
  font: 700 22px/1 var(--font-display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--navy);
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
  filter: none;
}

.form-footnote {
  margin: 16px 0 0;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--gray);
  text-align: center;
}
.form-footnote a {
  color: var(--blue-dark);
  font-weight: 600;
  text-decoration: none;
}
.form-footnote a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 18px 20px 26px;
  font-family: var(--font-body);
  color: rgba(255, 255, 255, 0.5);
  font-size: 12.5px;
}
.footer a { color: var(--blue); }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .field-row { flex-direction: column; gap: 0; }
  .field-row .field,
  .field-row .field-sm { flex-basis: auto; }
  .panels { padding: 24px 18px 30px; }
  .tab { font-size: 18px; padding: 10px 6px; }
  .radio-group { flex-direction: column; }
}

/* ===========================================================
   Legacy account dashboard support (body.tpl and its includes)
   Not yet redesigned — see Phase 2. These are close to the
   original site's rules so the dashboard stays usable/visible
   until it gets its own pass.
   =========================================================== */
.hide { display: none; }
.good { font-weight: bold; color: green; }
.bad { font-weight: bold; color: red; }
.small { font-size: small; }
.editable { background-color: lightgrey; }
.unlicensed { background-color: lightpink; }
.error { background: #ffebef; color: #480000; }

#menu {
  height: 48px;
  line-height: 48px;
  background: var(--navy);
  padding: 0 clamp(16px, 5vw, 56px);
}
#menu ul { list-style-type: none; margin: 0; padding: 0; }
#menu ul li {
  display: inline-block;
  padding: 12px 18px;
  margin-right: 2px;
  background: var(--gold);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}
#menu ul li a {
  text-decoration: none;
  font: 700 16px var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--navy);
}
#menu ul li a:hover { opacity: 0.85; }
#menu ul li.active { background: #fff !important; }
#menu ul li.active a { color: var(--black); }
#menu ul li img { margin: 0 -16px 12px -6px; }

.body {
  padding: 1em 1em 3em 1em;
  clear: both;
  background: var(--paper);
  width: auto;
  max-width: 1000px;
  margin: 0 auto;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  overflow: auto;
  height: auto;
  font-family: var(--font-body);
}
.body, .body * { color: var(--black); }
.body div { padding: 5px; }
.body button { margin: 0 auto; display: block; }
.body h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  text-align: center;
  color: var(--gray);
}
.body p { padding-bottom: 20px; color: var(--gray); margin-left: 20px; }

table { border-collapse: collapse; background: #f4f2ee; }
table, th, td { border: 1px solid var(--line); }
th, td { padding: 4px 8px; font-family: var(--font-body); }
.vertical td:nth-child(odd) { background: #e7e1d6; font-weight: 700; text-align: right; }
.horizontal th { background: #e7e1d6; font-weight: 700; }

.Account table { margin: 0 auto; }
.Account table td { white-space: nowrap; height: 25px; }
.Account table table { width: 100%; }
.Account td { min-width: 50%; }
.Account .history {
  background-color: var(--navy);
  text-align: center;
  display: block;
  font-weight: bold;
  margin: 5px 0;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  padding: 6px;
}
.Account form { text-align: center; }
.Account input[readonly] { background-color: #eee; border: none; }

#machines table { width: 100%; }
#machines th { background: #e7e1d6; font-weight: bold; }
#machines div { border: 1px solid var(--line); margin: 0 0 5px; background: #fdf6e8; }
#machines form { text-align: center; }
#machines .history { background-color: #e7e1d6; text-align: center; display: block; font-weight: bold; }
