:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg2: #111a33;
  --card: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.11);
  --text: #e8edf7;
  --muted: #9aa7bd;
  --accent: #5b8cff;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 20px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(91, 140, 255, 0.18), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(34, 197, 94, 0.10), transparent 60%),
    linear-gradient(160deg, var(--bg), var(--bg2));
}

.card {
  width: min(100%, 520px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.logo {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(135deg, #5b8cff, #8b5cf6);
  box-shadow: 0 8px 24px rgba(91, 140, 255, 0.35);
}

h1 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.ip-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  color: #fff;
  word-break: break-all;
  text-align: right;
}

.alert {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  border: 1px solid transparent;
}

.alert.error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

.alert.success {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.status {
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
}

.status p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.status strong { color: var(--text); }

.badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status.allowed .badge { color: #bbf7d0; background: rgba(34, 197, 94, 0.16); }
.status.denied .badge { color: #fde68a; background: rgba(245, 158, 11, 0.16); }
.status.static .badge { color: #bfdbfe; background: rgba(91, 140, 255, 0.16); }

.countdown { font-variant-numeric: tabular-nums; }

form {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.35rem;
  letter-spacing: 0.35em;
  text-align: center;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus {
  border-color: rgba(91, 140, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.15);
}

button {
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #5b8cff, #7c5cff);
  box-shadow: 0 10px 30px rgba(91, 140, 255, 0.28);
  transition: transform 0.12s, filter 0.12s;
}

button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.65; cursor: wait; }

.back {
  display: inline-block;
  margin-top: 4px;
  color: #bfdbfe;
  text-decoration: none;
  font-weight: 600;
}

.back:hover { text-decoration: underline; }

footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 420px) {
  .card { padding: 20px; }
  .ip-box { flex-direction: column; align-items: flex-start; }
  .ip { text-align: left; }
}
