/* Shared theme: colours, type, cards, buttons and toggles (TinyProxy look) */

:root {
  --aurelia-teal: #00837B;
  --aurelia-teal-dark: #006b65;
  --aurelia-teal-light: #00a89d;
  --aurelia-gold: #f9d891;
  --aurelia-gold-light: #fbe4b0;
  --bg-primary: #0a0f14;
  --bg-secondary: #121a21;
  --bg-inset: #0d1419;
  --card-bg: rgba(18, 26, 33, 0.7);
  --card-shadow: rgba(0, 0, 0, 0.3);
  --text-primary: #e8e6e1;
  --text-secondary: #b8b5af;
  --text-muted: #888888;
  --border-color: rgba(0, 131, 123, 0.25);
  --error-color: #e57373;
  --font-family: 'Crimson Text', Georgia, serif;
  --font-mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  color-scheme: dark;
}

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

[hidden] { display: none !important; }

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 24px;
  font-size: 18px;
  line-height: 1.7;
}

.app-container { max-width: 1600px; margin: 0 auto; }

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 20px;
}
.app-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--aurelia-teal);
  font-style: italic;
  letter-spacing: 0.5px;
  line-height: 1.3;
}
.app-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Footer, on every page (the Tendril Terminal footer in this theme) */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-top: 24px;
  font-size: 12px;
  line-height: 1.6;
}
footer.site-footer p { font-size: 12px; color: var(--text-muted); }
.site-footer .footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
}
.site-footer .footer-links a {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-decoration: none;
  transition: color 0.3s ease;
}
.site-footer .footer-links a:hover { color: var(--aurelia-gold); }
.site-footer .aurelia-mark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-style: italic;
  font-size: 16px;
  color: var(--aurelia-gold);
  text-decoration: none;
  transition: filter 0.6s ease;
}
.aurelia-mark:hover { filter: drop-shadow(0 0 12px rgba(249, 216, 145, 0.35)); }
.aurelia-logo {
  height: 44px;
  width: auto;
  display: block;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 18px 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px var(--card-shadow);
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--aurelia-teal-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Buttons — hover turns the outline and text gold, with a gold glow */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  padding: 5px 14px;
  background: transparent;
  color: var(--aurelia-teal-light);
  border: 1px solid var(--aurelia-teal);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.btn:hover:not(:disabled) {
  color: var(--aurelia-gold);
  border-color: var(--aurelia-gold);
  box-shadow: 0 0 14px rgba(249, 216, 145, 0.35);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { font-size: 13px; padding: 2px 10px; }
.btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary {
  background: linear-gradient(135deg, var(--aurelia-teal), var(--aurelia-teal-dark));
  color: #fff;
}

/* Clear keeps a red glow so it never looks like a safe action */
.btn-danger {
  color: var(--error-color);
  border-color: rgba(229, 115, 115, 0.5);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(229, 115, 115, 0.15);
  color: var(--error-color);
  border-color: var(--error-color);
  box-shadow: 0 0 14px rgba(229, 115, 115, 0.35);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.icon-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn:hover {
  color: var(--aurelia-gold);
  background: rgba(249, 216, 145, 0.08);
  box-shadow: 0 0 10px rgba(249, 216, 145, 0.25);
}

:focus-visible {
  outline: 2px solid var(--aurelia-gold);
  outline-offset: 2px;
}

/* Toggle switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: rgba(136, 136, 136, 0.2);
  border: 1px solid rgba(136, 136, 136, 0.4);
  transition: all 0.2s ease;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.2s ease;
}
.toggle-input:checked + .toggle-switch {
  background: rgba(0, 131, 123, 0.35);
  border-color: var(--aurelia-teal);
}
.toggle-input:checked + .toggle-switch::after {
  left: 20px;
  background: var(--aurelia-teal-light);
}
.toggle-input:focus-visible + .toggle-switch {
  outline: 2px solid var(--aurelia-gold);
  outline-offset: 2px;
}

/* Modal (native <dialog>) */
.modal {
  margin: auto;
  width: min(420px, calc(100vw - 32px));
  padding: 22px 24px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal::backdrop {
  background: rgba(5, 8, 11, 0.7);
  backdrop-filter: blur(3px);
}
.modal-text {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}
.field { border: none; margin-top: 16px; }
.field legend,
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--aurelia-teal-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* Segmented choice: radio buttons styled as a row of pills */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.segmented input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.segmented label {
  flex: 1;
  text-align: center;
  font-size: 14px;
  padding: 4px 10px;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.segmented label:hover {
  border-color: var(--aurelia-gold);
  box-shadow: 0 0 10px rgba(249, 216, 145, 0.25);
}
.segmented input:checked + label {
  background: rgba(0, 131, 123, 0.3);
  border-color: var(--aurelia-teal);
  color: #fff;
}
.segmented input:focus-visible + label {
  outline: 2px solid var(--aurelia-gold);
  outline-offset: 2px;
}

/* Dark scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 131, 123, 0.45) transparent;
}
