:root {
  color-scheme: light dark;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #0f172a;
  color: #e2e8f0;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
}

.login-body {
  align-items: center;
}

.container {
  width: min(900px, 100%);
  background-color: rgba(15, 23, 42, 0.9);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.login-container {
  width: min(420px, 100%);
}

.login-header {
  text-align: center;
}

.login-header h1 {
  margin-bottom: 0.75rem;
}

.login-card {
  margin-top: 1.5rem;
}

header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  color: #f8fafc;
}

header p {
  margin: 0 0 1.5rem 0;
  color: #94a3b8;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.status-box, .actions-box {
  background-color: rgba(30, 41, 59, 0.9);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  background-color: rgba(148, 163, 184, 0.16);
}

.status-indicator.connected {
  color: #22c55e;
  background-color: rgba(34, 197, 94, 0.15);
}

.status-indicator.connecting {
  color: #eab308;
  background-color: rgba(234, 179, 8, 0.15);
}

.status-indicator.disconnected {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.15);
}

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.qr-placeholder {
  width: 240px;
  height: 240px;
  border-radius: 12px;
  background-color: rgba(15, 23, 42, 0.9);
  border: 1px dashed rgba(148, 163, 184, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-align: center;
  padding: 1rem;
}

.qr-box img {
  width: 240px;
  height: 240px;
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.45);
}

button {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.primary {
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  color: #f8fafc;
  box-shadow: 0 12px 24px rgba(14, 117, 218, 0.35);
}

button.secondary {
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5f5;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

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

button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

label {
  font-weight: 600;
  color: #cbd5f5;
}

input, textarea {
  background-color: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 0.75rem;
  color: #e2e8f0;
  font-size: 0.95rem;
  resize: vertical;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0 0.25rem;
  font-weight: 600;
  color: #cbd5f5;
}

.checkbox-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: #38bdf8;
}

textarea[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background-color: rgba(148, 163, 184, 0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.helper-text {
  color: #94a3b8;
  font-size: 0.85rem;
}

.alert {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.85rem 1.2rem;
  border-radius: 12px;
  background-color: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  font-weight: 500;
  border: 1px solid rgba(14, 165, 233, 0.25);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  z-index: 50;
  transition: opacity 0.2s ease;
}

.alert[data-variant='error'] {
  background-color: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.alert[data-variant='success'] {
  background-color: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
}

.footer-note {
  margin-top: 2rem;
  text-align: center;
  color: #64748b;
  font-size: 0.85rem;
}
