:root {
  --bg-top: #1f7499;
  --bg-bottom: #0d3b52;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.32);
  --text: #f4f9fc;
  --text-muted: rgba(244, 249, 252, 0.62);
  --accent: #3fb0e0;
  --accent-hover: #55c2ef;
  --accent-press: #2b95c4;
  --field-bg: rgba(255, 255, 255, 0.94);
  --field-text: #0d2733;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

input, button, select, textarea { font: inherit; }

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

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(63, 176, 224, 0.35), transparent 60%),
    radial-gradient(900px 600px at 90% 110%, rgba(31, 116, 153, 0.45), transparent 55%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #1f7499);
  box-shadow: 0 6px 16px -6px rgba(63, 176, 224, 0.8);
  flex: 0 0 auto;
}

.brand__logo svg { width: 22px; height: 22px; display: block; }

.brand__text { line-height: 1.2; }
.brand__title { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.brand__subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.field { margin-bottom: 16px; }

.field__label {
  display: block;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.field__label .opt { font-weight: 400; opacity: 0.75; }

.input {
  width: 100%;
  padding: 11px 13px;
  font-size: 14.5px;
  color: var(--field-text);
  background: var(--field-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  outline: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.input::placeholder { color: rgba(13, 39, 51, 0.4); }

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(63, 176, 224, 0.28);
}

.switch {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch__track {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.switch input:checked + .switch__track {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + .switch__track::after { transform: translateX(18px); }

.switch input:focus-visible + .switch__track {
  box-shadow: 0 0 0 3px rgba(63, 176, 224, 0.28);
}

.switch__label { font-size: 13.5px; }

.collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.collapse.open { grid-template-rows: 1fr; }
.collapse__inner { overflow: hidden; }
.collapse.open .collapse__inner { padding-top: 16px; }

.btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #062330;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 10px 22px -12px rgba(63, 176, 224, 0.9);
}

.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(63, 176, 224, 0.4); }

.btn[data-loading="true"] {
  pointer-events: none;
  color: transparent;
  position: relative;
}
.btn[data-loading="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(6, 35, 48, 0.35);
  border-top-color: #062330;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.recent { margin-top: 28px; }

.recent__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.recent__head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.recent__list { display: flex; flex-direction: column; gap: 8px; }

.recent__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
}
.recent__item:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
}
.recent__item:active { transform: translateY(1px); }

.recent__id { font-size: 13.5px; font-weight: 600; }
.recent__label { font-size: 13px; color: var(--text-muted); }
.recent__domain {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-muted);
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--error { background: rgba(154, 32, 32, 0.95); }
