/* Partners-site page styles, layered on top of fleetzero.css (the brand base,
   loaded first in base.html).
   fleetzero.css is DARK BY DEFAULT (--fz-surface #101214, --fz-text off-white),
   so every surface here must come from a --fz-* token. Hardcoding var(--fz-white)
   as a background puts off-white text on white and makes the content vanish —
   which is exactly what happened the first time this file was written. */

/* ---------- Login ---------- */
.login-page { min-height: 100vh; background: var(--fz-black); }

.login-overlay {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--fz-surface-alt);
  border: 1px solid var(--fz-border);
  border-radius: var(--fz-radius);
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.brand { text-align: center; margin-bottom: 1.75rem; }
.brand-logo {
  height: 56px;
  width: 56px;
  padding: 6px;
  background: var(--fz-white);
  border-radius: var(--fz-radius);
}
.brand-name {
  font-family: var(--fz-font-heading);
  margin: 0.6rem 0 0;
  font-size: 1.8rem;
  letter-spacing: 0.5px;
}
.brand-tagline {
  margin: 0.3rem 0 0;
  color: var(--fz-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.login-card form { display: flex; flex-direction: column; }

.login-card button[type="submit"] {
  padding: 0.8rem;
  font-family: var(--fz-font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--fz-black);
  background: var(--fz-green);
  border: none;
  border-radius: var(--fz-radius);
  cursor: pointer;
  transition: filter 0.15s ease;
}
.login-card button[type="submit"]:hover { filter: brightness(0.92); }

.login-footer {
  margin-top: 1.5rem;
  color: var(--fz-text-muted);
  font-size: 0.8rem;
  text-align: center;
}

/* ---------- Shared form controls ---------- */
label {
  display: block;
  font-family: var(--fz-font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fz-text-muted);
  margin-bottom: 0.35rem;
}
label.inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  margin: 0 1rem 0 0;
}
input[type="text"], input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--fz-border);
  border-radius: var(--fz-radius);
  font-family: var(--fz-font-body);
  font-size: 0.95rem;
  background: var(--fz-surface);
  color: var(--fz-text);
}
input::placeholder { color: var(--fz-text-muted); }
/* Checkboxes render as light-on-light without this. */
input[type="checkbox"] { accent-color: var(--fz-green); }
.login-card input { margin-bottom: 1.1rem; }
input:focus {
  outline: none;
  border-color: var(--fz-green);
  box-shadow: 0 0 0 3px rgba(163, 214, 105, 0.35);
}

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

/* ---------- Chrome: top bar + tabs ---------- */
.app-page { background: var(--fz-surface); min-height: 100vh; }

.topbar { background: var(--fz-black); color: var(--fz-white); }
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--fz-font-heading);
  font-size: 1.15rem;
  margin: 0;
  color: var(--fz-white);
}
/* The brand mark is black, so it gets a white badge to sit on the black bar. */
.topbar-logo {
  height: 30px; width: 30px;
  padding: 4px;
  background: var(--fz-white);
  border-radius: 5px;
}
.logout-form { display: flex; align-items: center; gap: 0.9rem; }
.topbar-user { color: rgba(255, 255, 255, 0.75); font-size: 0.9rem; }
.badge {
  background: var(--fz-green);
  color: var(--fz-black);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.logout-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--fz-white);
  padding: 0.45rem 0.9rem;
  border-radius: var(--fz-radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.logout-btn:hover { background: rgba(255, 255, 255, 0.12); }

.tabs { background: var(--fz-black); border-top: 1px solid rgba(255, 255, 255, 0.12); }
.tabs-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.25rem;
}
.tab {
  font-family: var(--fz-font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.75rem 1.1rem;
  border-bottom: 3px solid transparent;
}
.tab:hover { color: var(--fz-white); }
.tab--active {
  color: var(--fz-white);
  border-bottom-color: var(--fz-green); /* the 10% accent */
}

/* ---------- Flash messages ---------- */
.flash, .flash-bar {
  background: rgba(224, 108, 108, 0.14);
  border: 1px solid #e06c6c;
  color: #ffc2c2;
  border-radius: var(--fz-radius);
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
}
.flash { margin-bottom: 1.25rem; }
.flash p, .flash-bar p { margin: 0.15rem 0; }
.flash-bar {
  max-width: 1200px;
  margin: 1rem auto 0;
  border-radius: var(--fz-radius);
}

/* ---------- Content ---------- */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  gap: 1.5rem;
}
.panel {
  background: var(--fz-surface-alt);
  border: 1px solid var(--fz-border);
  border-radius: var(--fz-radius);
  padding: 1.25rem 1.5rem;
}
.panel h2 {
  font-size: 1.05rem;
  margin: 0 0 1rem;
  border-bottom: 2px solid var(--fz-green);
  padding-bottom: 0.6rem;
}
.panel--warn { border-left: 4px solid var(--fz-blue); }
.panel--reveal { border-left: 4px solid var(--fz-green); }
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.panel-head h2 { flex: 1; }

.muted { color: var(--fz-text-muted); font-size: 0.88rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }

.reveal-value code {
  font-size: 1.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--fz-green);
  background: var(--fz-surface);
  border: 1px solid var(--fz-green);
  border-radius: var(--fz-radius);
  padding: 0.4rem 0.7rem;
  user-select: all;
}

/* The partner app fills everything under the chrome (64px topbar + 42px tabs)
   and scrolls inside its own frame. */
.app-main--frame { padding: 0; gap: 0; }
.app-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 106px);
  min-height: 480px;
  border: 0;
  background: var(--fz-white);
}

/* ---------- Settings forms ---------- */
.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem 1.2rem;
  align-items: end;
}
.checkbox-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem; }
.form-actions { display: flex; align-items: center; }

.user-card {
  background: var(--fz-surface);
  border: 1px solid var(--fz-border);
  border-radius: var(--fz-radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.9rem;
}
.user-card--inactive { opacity: 0.65; }
.user-card-meta { margin: 0.6rem 0 0.4rem; }
.user-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  border-top: 1px dashed var(--fz-border);
  padding-top: 0.7rem;
}
.inline-form { display: flex; gap: 0.4rem; align-items: center; }
.inline-form input[type="text"] { width: auto; min-width: 190px; }

.fz-button, .btn-quiet, .btn-danger {
  font-family: var(--fz-font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--fz-radius);
  padding: 0.55rem 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-quiet {
  background: var(--fz-surface-alt);
  border-color: var(--fz-border);
  color: var(--fz-text);
}
.btn-quiet:hover:not(:disabled) { background: var(--fz-border); }
.btn-quiet:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-danger { background: transparent; border-color: #e06c6c; color: #ff9b9b; }
.btn-danger:hover { background: rgba(224, 108, 108, 0.15); }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--fz-surface);
  color: var(--fz-text);
  font-size: 0.9rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--fz-border);
  white-space: nowrap;
}
.data-table th {
  font-family: var(--fz-font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fz-text-muted);
  background: var(--fz-surface-alt);
}
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--fz-surface-alt);
  border: 1px solid var(--fz-border);
  color: var(--fz-text);
}
.pill--live { background: var(--fz-green); color: var(--fz-black); }
.pill--muted { background: transparent; border: 1px solid var(--fz-border); color: var(--fz-text-muted); }

details summary { cursor: pointer; margin-bottom: 0.8rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--fz-surface);
  border: 1px solid var(--fz-border);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
}
