/* iTechmonster Notes — complete stylesheet.
   Self-contained on purpose: this app's security rests on no foreign code
   running on the page that holds the decryption key. No CDN, no web fonts. */

:root {
  --ink:      #0b132b;
  --paper:    #f5f6f8;
  --card:     #ffffff;
  --accent:   #1c4fd8;
  --accent-2: #17409f;
  --muted:    #5b6472;
  --line:     #e2e6ec;
  --danger:   #b42318;
  --warn-bg:  #fff8e6;
  --warn-fg:  #7a4b00;
  --warn-ln:  #f0d089;

  --radius:   12px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.6;
}

.wrap {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- header ---------- */

.topbar {
  background: var(--ink);
  color: #fff;
  padding: 0.9rem 0;
  margin-bottom: 2rem;
}

.brand {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand .sep {
  color: #8f9bb8;
  margin: 0 0.35rem;
  font-weight: 400;
}

/* ---------- card ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 1px 2px rgba(11, 19, 43, 0.04), 0 8px 24px rgba(11, 19, 43, 0.05);
}

h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.25rem;
}

.lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.3em;
}

/* ---------- fields ---------- */

.field { margin-bottom: 1.5rem; }
.field--narrow { max-width: 20rem; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

textarea, input[type="text"], input[type="number"], input[type="password"], select, input:not([type]) {
  width: 100%;
  font: inherit;
  color: inherit;
  background: #fff;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea { resize: vertical; min-height: 8rem; }

.mono { font-family: var(--mono); font-size: 0.92rem; }

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(28, 79, 216, 0.15);
}

.hint {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0.4rem 0 0;
}

.inline {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.inline--fill > input { flex: 1 1 14rem; }

.unit { color: var(--muted); font-size: 0.9rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.btn:hover { background: var(--paper); border-color: #cfd6e0; }
.btn:active { transform: translateY(1px); }

.btn:focus-visible {
  outline: 3px solid rgba(28, 79, 216, 0.35);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn--quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding-left: 0;
}

.btn--quiet:hover { background: transparent; color: var(--ink); }

.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: #99120f; border-color: #99120f; }

.btn:disabled { opacity: 0.55; cursor: default; transform: none; }

/* ---------- status and results ---------- */

.status {
  min-height: 1.4rem;
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.status--error { color: var(--danger); font-weight: 500; }

.result {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.result .inline { margin-top: 0.75rem; }

/* The one loud element in the whole design, and it earns it: this is the
   moment the note stops existing on the server. */
.banner {
  background: var(--warn-bg);
  border: 1px solid var(--warn-ln);
  border-left: 4px solid var(--warn-fg);
  color: var(--warn-fg);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.93rem;
  font-weight: 500;
  margin: 1rem 0;
}

.note {
  font-family: var(--mono);
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  margin: 0 0 1rem;
}

/* ---------- admin ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}

.panel h2 { margin-bottom: 0.5rem; }

.stat { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; }
.stat dt { color: var(--muted); }
.stat dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }

.alert {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.93rem;
  border: 1px solid var(--line);
  background: var(--paper);
}

.alert--error { background: #fef3f2; border-color: #f5c6c2; color: var(--danger); }
.alert--ok    { background: #ecfdf3; border-color: #a9e0be; color: #05603a; }

/* ---------- footer ---------- */

.footer {
  margin-top: auto;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
  text-align: center;
  color: var(--muted);
}

/* ---------- utility ---------- */

.hidden { display: none !important; }

@media (max-width: 30rem) {
  .card { padding: 1.25rem; }
  h1 { font-size: 1.3rem; }
  .btn { width: 100%; text-align: center; }
  .inline--fill > input { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- admin nav ---------- */

.adminnav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
}

.adminnav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.4rem 0.7rem;
  border-radius: 7px;
}

.adminnav a:hover { background: #fff; color: var(--ink); }
.adminnav a.on { background: var(--ink); color: #fff; }
.adminnav a.right { margin-left: auto; font-weight: 500; }

/* ---------- request rows ---------- */

.reqrow {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}

.reqrow__head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.reqrow__label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.reqrow .hint { margin-bottom: 0.6rem; }

.badge {
  flex: none;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid;
}

.badge--ready { background: #ecfdf3; border-color: #a9e0be; color: #05603a; }
.badge--wait  { background: var(--paper); border-color: var(--line); color: var(--muted); }
.badge--done  { background: #eef2ff; border-color: #c7d2fe; color: #3538cd; }
.badge--gone  { background: #fef3f2; border-color: #f5c6c2; color: var(--danger); }

.optional { font-weight: 400; color: var(--muted); }

.fingerprint {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

#reveal { margin-top: 1.5rem; }

@media (max-width: 30rem) {
  .reqrow__head { flex-direction: column; }
  .adminnav a.right { margin-left: 0; }
}
