:root {
  color-scheme: dark;
  --bg: #071118;
  --bg-soft: #0b1820;
  --surface: rgba(11, 24, 32, 0.82);
  --surface-strong: rgba(15, 32, 43, 0.94);
  --line: rgba(235, 243, 248, 0.12);
  --line-strong: rgba(104, 245, 210, 0.32);
  --text: #ebf3f8;
  --muted: #91a2ad;
  --primary: #68f5d2;
  --primary-strong: #25d4ad;
  --warn: #f6c779;
  --danger: #ff7c8d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 8%, rgba(104, 245, 210, 0.14), transparent 34rem),
    radial-gradient(circle at 90% 12%, rgba(246, 199, 121, 0.11), transparent 30rem),
    linear-gradient(135deg, #071118 0%, #09141b 56%, #10171b 100%);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.hero,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  min-height: 210px;
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
  padding: 28px;
  border-radius: 28px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.hero-copy {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.status-row,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(104, 245, 210, 0.1);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.muted {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.panel {
  border-radius: 24px;
  padding: 22px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header.compact {
  align-items: center;
}

.vault-layout {
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
  gap: 18px;
}

.hidden {
  display: none !important;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(104, 245, 210, 0.12);
}

select option {
  background: var(--bg-soft);
  color: var(--text);
}

.button,
.icon-button,
.code-button {
  border: 0;
  border-radius: 14px;
  min-height: 44px;
  padding: 0 15px;
  color: var(--text);
}

.button.primary {
  background: linear-gradient(135deg, var(--primary), var(--warn));
  color: #061216;
  font-weight: 900;
}

.button.ghost,
.icon-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 800;
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-button input {
  display: none;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.two-col,
.three-col {
  display: grid;
  gap: 12px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.divider {
  height: 1px;
  margin: 20px 0;
  background: var(--line);
}

.details {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.nested {
  margin-top: 12px;
}

.accounts-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.account-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-strong);
  padding: 16px;
}

.account-main,
.account-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.account-issuer {
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-label {
  word-break: break-word;
}

.delete-button {
  min-height: 36px;
  color: var(--danger);
}

.code-button {
  width: 100%;
  border: 1px solid rgba(104, 245, 210, 0.28);
  background: rgba(104, 245, 210, 0.08);
  color: var(--text);
}

.totp-code {
  display: block;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(2rem, 8vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.14em;
}

.progress-track {
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--warn));
  transform-origin: left center;
}

.countdown {
  min-width: 42px;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 320px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  width: 70px;
  height: 70px;
  margin-bottom: 14px;
}

.scanner-dialog {
  width: min(760px, calc(100% - 26px));
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0;
}

.scanner-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.scanner-frame {
  padding: 18px;
}

#scanner-video {
  width: 100%;
  min-height: 320px;
  border-radius: 16px;
  background: #000;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 100;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 18, 24, 0.96);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  color: var(--text);
}

.toast.danger {
  border-color: rgba(255, 124, 141, 0.35);
}

@media (max-width: 900px) {
  .vault-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .two-col,
  .three-col {
    grid-template-columns: 1fr;
  }

  .panel,
  .hero {
    padding: 18px;
  }
}

