:root {
  --bg: #0b1020;
  --panel: #141a2e;
  --text: #e6eaf2;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --accent-2: #38d39f;
  --border: #232a45;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}
.container {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 16px;
}
h1 { font-size: 1.6rem; margin-bottom: 16px; }

form fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
  background: var(--panel);
}
legend { color: var(--muted); padding: 0 6px; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.95rem; }
input[type="text"], input[type="password"], input[type="number"], input:not([type]) {
  background: #0e1427;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.checkbox { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.radio { display: flex; align-items: center; gap: 8px; }
.switch { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 10px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: relative; width: 42px; height: 24px; background: #2a314d; border: 1px solid var(--border); border-radius: 999px; transition: background 150ms; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 50%; transform: translateY(-50%); background: #fff; border-radius: 50%; transition: left 150ms; }
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { left: 21px; }
.switch .switch-text { color: var(--text); font-size: 0.95rem; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #0e1427; }
.segmented input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented label { padding: 8px 10px; color: var(--muted); cursor: pointer; user-select: none; border-right: 1px solid var(--border); }
.segmented label:last-of-type { border-right: 0; }
.segmented input[type="radio"]:checked + label { background: var(--accent); color: #fff; }
.segmented label:hover { color: var(--text); }
.input-with-action { position: relative; display: block; }
.input-with-action input { width: 100%; padding-right: 70px; }
.toggle-visibility { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.toggle-visibility:hover { color: var(--text); border-color: var(--accent); }
.fieldset-actions { margin-top: 8px; display: flex; justify-content: flex-end; }

.actions { margin: 14px 0; }
button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: default; }
button.secondary { background: transparent; color: var(--muted); border: 1px solid var(--border); margin-left: 8px; }

.progress {
  position: relative;
  height: 24px;
  background: #0e1427;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0%;
  transition: width 200ms ease-out;
}
.percent {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  font-weight: 700;
}

.logs { margin-top: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.logs-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.log-output {
  margin: 0;
  padding: 12px;
  max-height: 320px;
  overflow: auto;
  background: #0c1226;
  color: #cfe2ff;
  font-size: 0.9rem;
}

.coffee {
  margin-top: 32px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.hidden { display: none !important; }

.disclaimer {
  margin: 12px 0;
  padding: 10px 12px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid #6b5d2a;
  color: #e8d8a8;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Status indicators for check buttons */
.status-indicator { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); margin-left: 8px; vertical-align: middle; }
.status-indicator.ok { background: #2ecc71; border-color: #25a35b; }
.status-indicator.err { background: #ff6b6b; border-color: #c0392b; }
.status-indicator.pending { background: #9aa3b2; animation: pulse 800ms ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.6; } to { opacity: 1; } }

/* Toast notifications */
.toast { position: fixed; right: 16px; bottom: 16px; background: #141a2e; color: #e6eaf2; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.3); max-width: 360px; z-index: 1000; }
.toast.success { border-color: #25a35b; }
.toast.error { border-color: #c0392b; }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
}
