/* ===================================================================
   VegaResiduals - app-specific styles layered on the Intellivega
   design system (iv-tokens.css + vega.css).
   =================================================================== */

/* Mockup default tweaks: compact table density. */
:root {
  --vr-cell-py: 8px;
  --vr-row-h: 40px;
}

/* Blazor validation */
.valid.modified:not([type="checkbox"]) { outline: 1px solid var(--iv-green-500); }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; font-size: 12px; margin-top: 4px; display: block; }

.blazor-error-boundary {
  background: #2a1215;
  color: #ff8a80;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #5c2b2e;
  margin: 12px 0;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

#blazor-error-ui {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--iv-fg-1);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  z-index: 3000;
  font-size: 13px;
  box-shadow: var(--iv-shadow-paper);
}
#blazor-error-ui .reload { color: #61d89f; margin-left: 10px; }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 10px; }

/* ------------------------------------------------------------------
   Auth / account pages (full-bleed centered panel outside the shell)
   ------------------------------------------------------------------ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 178, 92, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 100%, rgba(195, 51, 130, 0.05) 0%, transparent 50%),
    var(--iv-page-bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--iv-surface-panel);
  border: 1px solid var(--iv-line-2);
  border-radius: 16px;
  box-shadow: var(--iv-shadow-card);
  padding: 32px;
}
.auth-card.wide { max-width: 720px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .vr-mark { width: 40px; height: 40px; border-radius: 11px; }
.auth-brand .vr-mark svg { width: 23px; height: 23px; }
.auth-brand b { font-family: var(--iv-font-display); font-size: 20px; letter-spacing: -0.02em; }
.auth-brand span { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--iv-fg-3); font-weight: 600; }
.auth-card h1 { font-size: 19px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
.auth-card .sub { font-size: 13px; color: var(--iv-fg-3); margin: 0 0 20px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .aux { font-size: 12.5px; color: var(--iv-fg-3); margin-top: 16px; }
.auth-card .aux a { color: var(--iv-green-600); font-weight: 600; text-decoration: none; }
.auth-card .aux a:hover { text-decoration: underline; }
.auth-sep { height: 1px; background: var(--iv-line-1); margin: 18px 0; }

/* Bootstrap-named aliases (used by scaffolded Identity manage pages) mapped
   onto the design system's own .input/.btn styles defined in vega.css. */
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--iv-fg-2); margin-bottom: 5px; }
.form-control {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--iv-bg-1);
  border: 1px solid var(--iv-line-2);
  color: var(--iv-fg-1);
  font: 400 13.5px var(--iv-font-sans);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus { border-color: var(--vr-accent); box-shadow: 0 0 0 3px var(--vr-accent-weak); }
.form-check-input { accent-color: var(--iv-green-500); }
textarea.input { height: auto; padding: 10px 12px; }
.input, .select { width: 100%; }

.w-100 { width: 100%; }
.text-danger { color: #e50000; font-size: 12.5px; }

.btn-secondary, .btn-outline-primary { background: var(--iv-bg-1); border-color: var(--iv-line-2); color: var(--iv-fg-2); }
.btn-secondary:hover, .btn-outline-primary:hover { border-color: var(--iv-line-green-hi); color: var(--iv-green-600); }
.btn-link { background: none; border: none; color: var(--iv-green-600); font-weight: 600; cursor: pointer; padding: 0; }

/* Account-manage sub-navigation inside the wide auth card */
.manage-grid { display: grid; grid-template-columns: 180px 1fr; gap: 26px; align-items: start; }
.manage-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.manage-nav a {
  display: block;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--iv-fg-2);
  text-decoration: none;
  transition: all 0.15s;
}
.manage-nav a:hover { background: var(--iv-bg-2); color: var(--iv-fg-1); }
.manage-nav a.active { background: var(--vr-accent-weak); color: var(--iv-green-600); font-weight: 600; }
.manage-body h3 { font-size: 16px; font-weight: 700; margin: 0 0 14px; }
.manage-body { font-size: 13.5px; }

/* Status messages from Identity pages */
.alert { padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
.alert-danger { background: rgba(246, 97, 81, 0.10); color: #b3261e; border: 1px solid rgba(246, 97, 81, 0.3); }
.alert-success { background: rgba(0, 178, 92, 0.10); color: #0a7a44; border: 1px solid rgba(0, 178, 92, 0.3); }

/* Sidebar nav items rendered as anchors keep the design-system look */
a.vr-nav-item { text-decoration: none; color: var(--iv-fg-2); }
a.vr-nav-item.active { color: var(--iv-green-600); }

/* Tiny remove button used in split rows */
.x-mini {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--iv-bg-2);
  border: 1px solid var(--iv-line-2);
  color: var(--iv-fg-4);
  cursor: pointer;
  flex: none;
}
.x-mini:hover { color: var(--iv-danger); border-color: var(--iv-danger); }

/* Modal (small centered dialogs, e.g. new organization) */
.vr-modal-veil {
  position: fixed;
  inset: 0;
  background: rgba(21, 20, 31, 0.35);
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.vr-modal {
  width: 100%;
  max-width: 440px;
  background: var(--iv-surface-panel);
  border: 1px solid var(--iv-line-2);
  border-radius: 16px;
  box-shadow: var(--iv-shadow-paper);
  padding: 24px;
}
.vr-modal h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.vr-modal .sub { font-size: 12.5px; color: var(--iv-fg-3); margin-bottom: 16px; }
