* { box-sizing: border-box; }
:root {
  --bg: #0b1220;
  --card: #131a2a;
  --text: #e6edf3;
  --muted: #9fb0c3;
  --accent: #4f8cff;
  --accent-2: #29c488;
  --danger: #ff5c80;
  --border: #233048;
  --glow: rgba(79,140,255,0.25);
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 20% -10%, #1b2540 0%, var(--bg) 60%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  min-height: 100vh;
}

.container {
  max-width: 680px;
  margin: 72px auto;
  padding: 0 16px;
}

h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: 0.2px;
  background: linear-gradient(90deg, #dbe8ff, #8bb6ff 50%, #4f8cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.notice { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(800px 200px at 10% -10%, var(--glow), transparent 50%),
              radial-gradient(600px 120px at 80% -20%, rgba(41,196,136,0.18), transparent 40%);
  filter: blur(10px);
  z-index: -1;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px; /* border size */
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(108,151,255,0.4), rgba(108,151,255,0.08));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.result::after {
  inset: 0;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(108,151,255,0.35), 0 10px 30px rgba(108,151,255,0.18) inset;
}

.field { margin-bottom: 14px; }
.field label { display:block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  background: #0f1626;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}
.field input::placeholder { color: #6b7ea0; }
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,140,255,0.15);
}
/* highlight wrapper when input focus */
.input-with-icon:focus-within input {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,140,255,0.15);
}
.radio-group { display: flex; gap: 18px; }
.radio-group label { display:flex; align-items:center; gap:8px; color: var(--text); }

/* Segmented control */
.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  background: #0f1626;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  width: fit-content;
}
.segmented input { display: none; }
.segmented label {
  padding: 8px 14px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  color: #b8c8e0;
  user-select: none;
  transition: transform 80ms ease, background 160ms ease, box-shadow 160ms ease;
}
.segmented input:checked + label {
  background: linear-gradient(90deg, #4f8cff, #6aa5ff);
  color: #fff;
  box-shadow: 0 8px 18px rgba(79,140,255,0.25);
}

/* Inputs with icons */
.input-with-icon { position: relative; }
.input-with-icon .icon {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  opacity: 0.8;
  pointer-events: none;
}
.input-with-icon input { padding-left: 40px; }

.actions { display:flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 80ms ease, box-shadow 120ms ease, filter 120ms ease;
  border: 1px solid rgba(255,255,255,0.06);
}
button.secondary { background: #223149; color: var(--text); }
button:hover { filter: brightness(1.05); }
button:active { transform: translateY(1px); }
button.loading { opacity: 0.9; pointer-events: none; position: relative; }
button.loading::after {
  content: "";
  display: inline-block;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  margin-left: 8px;
  vertical-align: -3px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Message status */
.message {
  margin-top: 12px;
  background: linear-gradient(180deg, rgba(79,140,255,0.10), rgba(79,140,255,0.08));
  border: 1px solid rgba(79,140,255,0.35);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
}
.message:empty { display: none; }

/* Result box */
.result {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-top: 12px;
  position: relative;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.result.show { opacity: 1; transform: translateY(0); }
.result.show::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(108,151,255,0.35), 0 10px 30px rgba(108,151,255,0.18) inset;
}
.kv { display:flex; gap: 10px; align-items:center; margin: 6px 0; }
.k { width: 72px; color: var(--muted); font-size: 13px; }
.v { color: var(--text); font-weight: 600; }
.wrap { word-break: break-all; overflow-wrap: anywhere; }
.result-actions { margin-top: 10px; }
button.success { background: linear-gradient(90deg, var(--accent-2), #20d3a0); box-shadow: 0 8px 20px rgba(41,196,136,0.18); }
#loginBtn { background: linear-gradient(90deg, #4f8cff, #6aa5ff); box-shadow: 0 8px 20px rgba(79,140,255,0.18); }
button:hover { filter: brightness(1.05); box-shadow: 0 10px 26px rgba(0,0,0,0.35); }

/* Copy row */
.copy-row { display: flex; gap: 10px; align-items: center; width: 100%; }
.pair {
  flex: 1;
  background: #0f1626;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  outline: none;
}
.pair:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,140,255,0.15); }

/* Result header */
.result-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: #8fe0bd;
  font-weight: 700;
}
.result-head .ok { filter: drop-shadow(0 2px 10px rgba(41,196,136,0.35)); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(24, 35, 56, 0.9);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

footer { margin-top: 14px; color: var(--muted); }
