/* Openprovider MCP — brand design system.
   Palette + type lifted from openprovider.com: crimson primary #D90D32,
   blue links #1468B8, navy ink #1B2331, blue-tinted neutrals, navy
   gradient #173863→#084463, Instrument Sans headings + Inter body. */

:root {
  --op-crimson: #d90d32;
  --op-crimson-dark: #b80b2a;
  --op-crimson-tint: #fdeef1;
  --op-blue: #1468b8;
  --op-blue-bright: #3a95e9;
  --op-blue-dark: #0c4f97;
  --op-navy: #1b2331;
  --op-navy-2: #2a364c;
  --op-grad-a: #173863;
  --op-grad-b: #084463;
  --op-ink: #1b2331;
  --op-slate: #344054;
  --op-muted: #667085;
  --op-border: #dfe6f1;
  --op-border-soft: #eaf0f8;
  --op-surface: #f5f7fc;
  --op-tint: #ebf3fc;
  --op-tint-2: #eff4fb;
  --op-white: #ffffff;
  --op-green: #09b257;
  --op-green-tint: #e9f9ef;
  --op-amber: #fb7538;
  --op-amber-tint: #fff3ec;
  --op-font-head: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --op-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --op-radius: 10px;
  --op-radius-sm: 6px;
  --op-shadow: 0 1px 2px rgba(27, 35, 49, 0.05), 0 4px 16px rgba(27, 35, 49, 0.06);
  --op-shadow-lg: 0 8px 40px rgba(8, 68, 99, 0.28);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--op-font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--op-ink);
  background: var(--op-surface);
}

h1, h2, h3, h4 {
  font-family: var(--op-font-head);
  color: var(--op-navy);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h1 { font-size: 1.75rem; font-weight: 700; margin: 0 0 1.25rem; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.75rem; }

a { color: var(--op-blue); text-decoration: none; }
a:hover { color: var(--op-blue-dark); text-decoration: underline; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
:not(pre) > code {
  background: var(--op-tint-2);
  border: 1px solid var(--op-border-soft);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* ---------- App shell ---------- */

.op-header {
  background: linear-gradient(100deg, var(--op-navy) 0%, var(--op-grad-a) 55%, var(--op-grad-b) 100%);
  color: #fff;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 58px;
  flex-wrap: wrap;
}

.op-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  padding: 0.65rem 0;
}
.op-brand:hover { text-decoration: none; color: #fff; }
.op-brand svg { display: block; }
.op-brand .wordmark {
  font-family: var(--op-font-head);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.op-brand .product {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--op-crimson);
  color: #fff;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  transform: translateY(-1px);
}

.op-nav { display: flex; align-items: center; gap: 0.15rem; flex-wrap: wrap; }
.op-nav a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.op-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.1); text-decoration: none; }
.op-nav a.active { color: #fff; background: var(--op-crimson); }

.op-header form { margin: 0 0 0 auto; }
.op-header .logout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.9);
  padding: 0.32rem 0.9rem;
  border-radius: 999px;
  font: 500 0.85rem var(--op-font-body);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.op-header .logout:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.6); }

main.op-main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 3.5rem; }

/* ---------- Cards & sections ---------- */

.card {
  background: var(--op-white);
  border: 1px solid var(--op-border);
  border-radius: var(--op-radius);
  box-shadow: var(--op-shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card > h2:first-child { margin-top: 0; }

.stat { font-family: var(--op-font-head); font-size: 1.6rem; font-weight: 700; color: var(--op-navy); }
.muted { color: var(--op-muted); }
.small { font-size: 0.875rem; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font: 600 0.9rem var(--op-font-body);
  border-radius: 999px;
  padding: 0.5rem 1.3rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--op-crimson); color: #fff; }
.btn-primary:hover { background: var(--op-crimson-dark); color: #fff; text-decoration: none; }
.btn-secondary { background: var(--op-white); color: var(--op-navy-2); border-color: var(--op-border); }
.btn-secondary:hover { border-color: var(--op-blue); color: var(--op-blue); text-decoration: none; }
.btn-danger-outline { background: transparent; color: var(--op-crimson); border-color: var(--op-crimson); }
.btn-danger-outline:hover { background: var(--op-crimson-tint); }
.btn-sm { padding: 0.28rem 0.85rem; font-size: 0.82rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Forms ---------- */

label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--op-slate); margin-bottom: 0.3rem; }

input[type='text'], input[type='email'], input[type='password'], select, textarea {
  font: 0.95rem var(--op-font-body);
  color: var(--op-ink);
  background: var(--op-white);
  border: 1px solid var(--op-border);
  border-radius: var(--op-radius-sm);
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--op-blue);
  box-shadow: 0 0 0 3px rgba(20, 104, 184, 0.15);
}
textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88rem; line-height: 1.5; }

.field { margin-bottom: 1rem; }
.form-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: flex-end; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
table.op-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.op-table thead th {
  text-align: left;
  font: 600 0.78rem var(--op-font-head);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--op-muted);
  background: var(--op-tint-2);
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--op-border);
}
.op-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--op-border-soft); vertical-align: top; }
.op-table tbody tr:hover { background: var(--op-surface); }

/* ---------- Badges & alerts ---------- */

.badge {
  display: inline-block;
  font: 600 0.72rem var(--op-font-body);
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
}
.badge-green { background: var(--op-green-tint); color: var(--op-green); }
.badge-red { background: var(--op-crimson-tint); color: var(--op-crimson); }
.badge-blue { background: var(--op-tint); color: var(--op-blue); }

.alert {
  border-radius: var(--op-radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  border: 1px solid;
}
.alert-ok { background: var(--op-green-tint); border-color: #b5e8c9; color: #0b7a40; }
.alert-error { background: var(--op-crimson-tint); border-color: #f5c2cc; color: var(--op-crimson-dark); }
.alert-warn { background: var(--op-amber-tint); border-color: #fed7bd; color: #c2510f; }

.reveal-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  background: var(--op-white);
  border: 1px dashed var(--op-blue);
  border-radius: var(--op-radius-sm);
  padding: 0.75rem 1rem;
  word-break: break-all;
  margin: 0.5rem 0;
}

/* ---------- Auth pages ---------- */

body.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(58, 149, 233, 0.28), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(217, 13, 50, 0.18), transparent 55%),
    linear-gradient(135deg, var(--op-navy) 0%, var(--op-grad-a) 55%, var(--op-grad-b) 100%);
}

.auth-card {
  background: var(--op-white);
  border-radius: 14px;
  box-shadow: var(--op-shadow-lg);
  padding: 2.25rem 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  animation: auth-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes auth-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: none; }
}

.auth-brand { display: flex; align-items: center; justify-content: center; gap: 0.55rem; margin-bottom: 1.5rem; }
.auth-brand .wordmark { font-family: var(--op-font-head); font-weight: 700; font-size: 1.05rem; color: var(--op-navy); }
.auth-brand .product {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em;
  background: var(--op-crimson); color: #fff; border-radius: 4px; padding: 0.1rem 0.4rem;
}
.auth-card h1 { font-size: 1.3rem; text-align: center; margin: 0 0 1.25rem; }
.auth-card input { width: 100%; margin-bottom: 1rem; }
.auth-footer { text-align: center; margin-top: 1.1rem; font-size: 0.875rem; color: var(--op-muted); }
