*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface2: #f0ede8;
  --border: #e0ddd6;
  --border2: #c8c5bc;
  --text: #1a1916;
  --text2: #6b6860;
  --text3: #a09d96;
  --accent: #2a5cff;
  --accent-hover: #1e45cc;
  --accent-bg: #eef1ff;
  --accent-bd: #b8c4ff;
  --ok: #0f7b52;
  --ok-hover: #0c6141;
  --ok-bg: #e8f7f1;
  --ok-bd: #6ecfaa;
  --danger: #e74c3c;
  --danger-bg: #fceceb;
  --danger-bd: #f5b7b1;
  --r: 12px;
  --rlg: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
  --transition-fast: 0.15s ease;
  --transition-med: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media(prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --surface: #1c1c1a;
    --surface2: #252523;
    --border: #2e2e2b;
    --border2: #3e3e3a;
    --text: #f0ede8;
    --text2: #9e9b94;
    --text3: #5c5a55;
    --accent: #6b8fff;
    --accent-hover: #8ba6ff;
    --accent-bg: #181f40;
    --accent-bd: #2d3f80;
    --ok: #2ecc8f;
    --ok-hover: #48e5a6;
    --ok-bg: #0d2a1e;
    --ok-bd: #1a6645;
    --danger: #e74c3c;
    --danger-bg: #3a1512;
    --danger-bd: #752923;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

header {
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  z-index: 10;
  position: sticky;
  top: 0;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo em {
  color: var(--accent);
  font-style: normal;
}

.pill {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-bd);
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.shell {
  width: 100%;
  max-width: 580px;
}

.banner {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--ok-bg);
  border: 1px solid var(--ok-bd);
  border-radius: var(--r);
  padding: 12px 16px;
  margin-bottom: 1.5rem;
  font-size: 14px;
  color: var(--ok);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.banner.show {
  display: flex;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rlg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tabs {
  display: flex;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.tab {
  flex: 1;
  padding: 16px 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: "DM Sans", sans-serif;
  color: var(--text2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  position: relative;
}

.tab:hover {
  color: var(--text);
  background: var(--border);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--surface);
}

.tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}

.tab svg {
  width: 16px;
  height: 16px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border2);
  color: var(--surface);
  font-size: 11px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.tab.active .step-num {
  background: var(--accent);
}

.pane-container {
  position: relative;
}

.pane {
  padding: 2rem;
  display: none;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity var(--transition-med), transform var(--transition-med);
}

.pane.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.fg {
  margin-bottom: 1.25rem;
}

.fl {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text2);
  margin-bottom: 8px;
}

input[type=text],
input[type=email],
input[type=number],
input[type=date],
input[type=url],
input[type=tel],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

input.error {
  border-color: var(--danger);
}

input.error:focus {
  box-shadow: 0 0 0 3px var(--danger-bg);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.frow {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 12px;
  margin-bottom: 10px;
  transition: border-color var(--transition-fast);
}

.frow:focus-within {
  border-color: var(--accent);
  background: var(--surface);
}

.frow input {
  flex: 1;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 4px 8px;
  font-size: 15px;
}

.frow input:focus {
  box-shadow: none;
  border: none;
  outline: none;
}

.frow select {
  width: auto;
  padding: 6px 30px 6px 12px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236b6860' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E") no-repeat right 10px center;
  border-color: var(--border2);
  border-radius: 8px;
  cursor: pointer;
}

.frow select:focus {
  box-shadow: none;
  border-color: var(--accent);
}

.delbtn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.delbtn:hover,
.delbtn:focus-visible {
  color: var(--danger);
  background: var(--danger-bg);
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: "DM Sans", sans-serif;
  border-radius: var(--r);
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  transition: all var(--transition-fast);
  min-height: 44px;
}

.btn:hover {
  background: var(--surface2);
  border-color: var(--border);
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-p {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-p:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-s {
  background: var(--ok-bg);
  border-color: var(--ok-bd);
  color: var(--ok);
}

.btn-s:hover {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.btn-w {
  width: 100%;
}

.brow {
  display: flex;
  gap: 12px;
  margin-top: 1.5rem;
}

.brow .btn {
  flex: 1;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.urlbox-wrap {
  position: relative;
  margin-top: 0.5rem;
}

.urlbox {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 16px;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  color: var(--text2);
  word-break: break-all;
  line-height: 1.6;
  min-height: 60px;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  user-select: all;
}

.urlbox:hover {
  border-color: var(--border2);
  background: var(--border);
}

.urlbox:active {
  background: var(--surface2);
}

.urlbox-hint {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.vwrap {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--rlg);
  padding: 1.5rem;
}

.vtitle {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.vfield {
  margin-bottom: 1.25rem;
}

.hint {
  font-size: 13px;
  color: var(--text3);
  margin-top: 8px;
  line-height: 1.5;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text3);
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface2);
  margin-bottom: 16px;
  color: var(--text2);
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 14px;
  max-width: 280px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

.toast-msg {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

footer {
  text-align: center;
  padding: 2rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
}

@media (max-width: 480px) {
  .pane {
    padding: 1.5rem;
  }

  .tab {
    font-size: 13px;
    flex-direction: column;
    gap: 4px;
    padding: 12px 4px;
  }

  .tab svg {
    display: none;
  }

  .step-num {
    margin-bottom: 2px;
  }

  .frow {
    flex-wrap: wrap;
  }

  .frow select {
    flex: 1;
  }
}
