/* Shared stylesheet for the Voordeur pages (login, door result, admin). */
:root {
  --bg: #0f172a;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --accent: #0ea5e9;
  --accent-soft: #7dd3fc;
  --accent-ink: #04293a;
  --field-bg: #1e293b;
  --border: #334155;
  --divider: rgba(148, 163, 184, 0.16);
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.page-admin {
  align-items: flex-start;
  justify-content: center;
  padding: 32px 0;
}

body.page-form {
  position: relative;
  align-items: center;
  justify-content: center;
}

.container {
  width: min(920px, 95vw);
  padding: 30px 32px;
  border-radius: 16px;
}

.container.narrow {
  width: min(440px, 90vw);
  padding: 28px 30px;
  background: #0b1220;
  border: 1px solid var(--divider);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

h1 {
  margin: 0 0 26px;
  font-size: 2rem;
  color: var(--text);
}

.container.narrow h1 {
  margin: 0 0 18px;
  font-size: 1.9rem;
}

p {
  color: var(--soft);
  line-height: 1.6;
}

.notice {
  margin: 0 0 26px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--field-bg);
  color: #e2e8f0;
  border-left: 4px solid var(--accent-soft);
}

/* Forms */
label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--soft);
  font-size: 0.95rem;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.form-inner {
  display: grid;
  gap: 18px;
}

input,
button,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--field-bg);
  color: #e2e8f0;
  font-size: 1rem;
}

button {
  background: var(--accent);
  border: none;
  color: var(--accent-ink);
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Admin layout: flat sections separated by dividers. */
.grid {
  display: grid;
  gap: 40px;
}

.panel {
  padding-top: 22px;
  border-top: 2px solid #1f3a5f;
}

.panel h2 {
  margin: 0 0 18px;
  font-size: 1.25rem;
  color: var(--accent-soft);
  letter-spacing: 0.3px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  color: var(--soft);
  margin-top: 12px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--divider);
  text-align: left;
  font-size: 0.9rem;
}

th {
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
}

tbody tr:hover {
  background: rgba(56, 189, 248, 0.07);
}

.small {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Inline action buttons in tables stay compact. */
.action-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-cell form,
.action-cell button {
  width: auto;
}

.copy-btn {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--field-bg);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 0.9rem;
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--accent-soft);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 20px;
}

.link-back {
  display: inline-flex;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--accent-soft);
  text-decoration: none;
  margin-top: 26px;
  font-weight: 600;
}

/* Filters on the recent-actions table. */
.range-form {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.range-form label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.range-form select,
.range-form input,
.range-form button {
  width: auto;
}

/* Door-result page */
.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.16);
  margin: 22px 0;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  animation: fillProgress 1.5s ease forwards;
}

@keyframes fillProgress {
  from { width: 0; }
  to { width: 100%; }
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.actions .action-group {
  display: flex;
  align-items: center;
}

.actions form {
  margin: 0;
  width: auto;
}

.actions .action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.actions .action-btn:hover {
  filter: brightness(1.08);
}

/* UUID confirmation page */
.confirm-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.confirm-form button,
.confirm-form .secondary {
  width: auto;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--accent-soft);
  text-decoration: none;
  font-weight: 600;
}

.secondary:hover {
  filter: brightness(1.08);
}

/* Login page */
.door-button {
  width: 100%;
}

.admin-link {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: var(--accent-soft);
  text-decoration: none;
  font-size: 0.95rem;
}

.admin-link:hover {
  filter: brightness(1.08);
}
