/* VDR Gate — small custom stylesheet, no external dependencies. */

:root {
  --bg: #f7f6fa;
  --surface: #ffffff;
  --text: #1e1a2e;
  --muted: #5d5871;
  --border: #ddd9e6;
  --accent: #743aee;      /* TAO brand purple */
  --accent-dark: #5b2bc0;
  --accent-soft: #f0eafd;
  --ok: #0e7a3d;
  --ok-bg: #e4f5eb;
  --warn: #b32020;
  --warn-bg: #fdeaea;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  /* Sticky footer: header + main + footer fill the viewport. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container { max-width: 980px; margin: 0 auto; padding: 0 1.25rem; }

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding-top: .7rem;
  padding-bottom: .7rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  letter-spacing: .02em;
}
.brand img { height: 34px; width: auto; }
.login-logo { display: block; height: 76px; width: auto; margin: 0 auto 1rem; }
nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }

main {
  padding: 1.5rem 1.25rem 3rem;
  width: 100%;
  /* Grow to push the footer to the bottom; flex column so a lone auth card
     can center itself vertically with auto margins. */
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
main > * { flex-shrink: 0; }
footer { color: var(--muted); padding-top: .75rem; padding-bottom: 1.25rem; }

/* Standalone cards (sign-in, verification, notices) center vertically. */
.card.narrow { margin-top: auto; margin-bottom: auto; }

h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
a { color: var(--accent); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 0 0 1.5rem;
}
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }

/* Banners */
.banner { padding: .6rem .9rem; border-radius: 6px; margin-bottom: 1rem; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.err { background: var(--warn-bg); color: var(--warn); }

/* Forms */
label { display: block; margin: .8rem 0 .25rem; font-weight: 600; font-size: .92rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
select, textarea {
  width: 100%;
  padding: .5rem .6rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
textarea { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9rem; }
input:focus, select:focus, textarea:focus, button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.checkbox { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; margin-top: 1rem; }
.checkbox input { margin-top: .3rem; }

button, .btn {
  display: inline-block;
  margin-top: 1rem;
  padding: .5rem 1.1rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--accent-dark); }
button:disabled { background: #c3b3ef; border-color: #c3b3ef; cursor: not-allowed; }
button.secondary, .btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
button.secondary:hover, .btn.secondary:hover { background: var(--bg); }
button.danger { background: var(--warn); border-color: var(--warn); }
button.linklike {
  background: none; border: none; color: var(--muted); font-weight: 400;
  padding: 0; margin: 0; cursor: pointer;
}
button.linklike:hover { color: var(--text); background: none; }
form.inline { display: inline; }
.actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1rem; }
.stack .checkbox { margin-top: .6rem; }
.narrow-form { max-width: 480px; }
.filter { margin-bottom: 1rem; display: flex; align-items: end; gap: .5rem; }
.filter label { margin: 0; }
.filter select { width: auto; }
.filter button { margin-top: 0; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1.5rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.row-actions form button { margin-top: 0; }
.row-actions .btn { margin-top: 0; }

/* Status tags */
.tag {
  display: inline-block;
  padding: .05rem .5rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.tag.provisioned, .tag.published { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tag.failed, .tag.revoked { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag.accepted, .tag.verified { background: var(--accent-soft); color: var(--accent-dark); border-color: transparent; }
.tag.new { background: var(--accent); color: #fff; border-color: transparent; }

/* Row jumped to via a #file-N anchor after an action gets a brief highlight. */
tr:target { background: var(--accent-soft); }
tr:target td { border-bottom-color: var(--accent); }

/* Dashboard activity panels */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.panel { margin: 0; padding: 1rem 1.25rem; }
.panel h3 { margin: 0 0 .6rem; font-size: 1rem; }
.panel table { margin-bottom: 0; border: none; }
.panel.wide { grid-column: 1 / -1; }
.num-col { text-align: right; }
.count-badge {
  display: inline-block; min-width: 1.6em; text-align: center;
  padding: 0 .45em; border-radius: 99px; font-size: .8rem;
  background: var(--accent-soft); color: var(--accent-dark);
}

/* Dashboard stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: .9rem 1rem; text-decoration: none; color: var(--muted);
  display: flex; flex-direction: column;
}
.stat .num { font-size: 1.7rem; font-weight: 700; color: var(--text); }
.stat.warn .num { color: var(--warn); }
.stat.ok .num { color: var(--ok); }

/* Agreement page */
.agreement-head h2 { margin: 0 0 .3rem; }
.agreement-body {
  max-height: 55vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  background: var(--surface);
}
.agreement-body h1 { font-size: 1.3rem; }
code.hash { word-break: break-all; font-size: .78rem; }

/* Evidence detail */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .6rem 1.2rem; margin-bottom: 1rem; }
.detail-grid dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.detail-grid dd { margin: 0; }
.detail-grid .span-all { grid-column: 1 / -1; }
.error-text { color: var(--warn); word-break: break-word; }

details summary { cursor: pointer; color: var(--accent); }
details form { margin-top: .6rem; min-width: 260px; }

@media print {
  header, footer, .no-print, nav { display: none !important; }
  body { background: #fff; }
  .card { border: none; padding: 0; }
}
