* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0a;
  --panel: #141414;
  --field: #2a2a2e;
  --border: #3a3a40;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --accent: #e50914;
  --accent-hover: #ff1622;
  --success: #2ecc71;
  --danger: #e74c3c;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
}
.screen.is-hidden {
  display: none;
}

/* ---------- Login ---------- */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 24px;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--muted);
  font-size: 14px;
}

#login-form label,
#dns-form label {
  display: block;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

#login-form input,
#dns-form input[type="text"],
#dns-form input[type="number"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  background: var(--field);
  border: 2px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}

#login-form input:focus,
#dns-form input:focus {
  border-color: var(--accent);
}

.hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: #666;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-weight: 500 !important;
  color: var(--text) !important;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* ---------- Buttons ---------- */
.btn-primary {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-ghost:hover {
  border-color: var(--muted);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-weight: 600;
}

.btn-edit {
  background: #333;
  color: var(--text);
}

.btn-toggle {
  background: #2a3a2a;
  color: var(--success);
}

.btn-toggle.inactive {
  background: #3a2a2a;
  color: var(--danger);
}

.btn-delete {
  background: #3a1a1a;
  color: var(--danger);
}

.error-msg {
  margin-top: 12px;
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.topbar h1 {
  font-size: 20px;
}

/* ---------- Content ---------- */
.content {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 40px;
}

.panel {
  background: var(--panel);
  border-radius: 12px;
  padding: 28px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel-header h2 {
  font-size: 20px;
}

.panel-header .btn-primary {
  width: auto;
  padding: 10px 20px;
}

.panel-desc {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.empty-msg {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-size: 15px;
}

/* ---------- DNS list ---------- */
.dns-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dns-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--field);
  border: 2px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s;
}

.dns-card.inactive {
  opacity: 0.55;
}

.dns-info {
  flex: 1;
}

.dns-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.dns-host {
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}

.dns-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  color: #777;
}

.dns-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.dns-badge.active {
  background: rgba(46, 204, 113, 0.15);
  color: var(--success);
}

.dns-badge.inactive {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
}

.dns-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 16px;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.is-hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  background: var(--panel);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.modal-card h3 {
  font-size: 20px;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.modal-actions .btn-primary {
  flex: 1;
}

.modal-actions .btn-ghost {
  flex: 1;
}

@media (max-width: 640px) {
  .dns-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .dns-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}
