@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --sw-blue: #0500ff;
  --sw-text: #1b1b1c;
  --sw-muted: #8b8b97;
  --sw-row: #f3f3f5;
  --sw-row-hover: #e8e8ec;
  --sw-left-bg: linear-gradient(165deg, #eef1ff 0%, #f5f6ff 38%, #fafaff 72%, #ffffff 100%);
  --sw-banner: 44px;
  --sw-left-w: clamp(340px, 34vw, 460px);
}

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

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

body.sw-page {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--sw-text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sw-shell {
  display: grid;
  grid-template-columns: var(--sw-left-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--sw-banner));
  min-height: calc(100dvh - var(--sw-banner));
  width: 100%;
  max-width: 100vw;
}

.sw-left {
  display: flex;
  flex-direction: column;
  padding: 32px 40px 28px;
  background: var(--sw-left-bg);
  min-height: calc(100vh - var(--sw-banner));
  min-height: calc(100dvh - var(--sw-banner));
  position: relative;
}

.sw-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  margin-bottom: clamp(36px, 5vh, 56px);
  width: fit-content;
}

.sw-logo svg {
  width: 28px;
  height: 31px;
  flex-shrink: 0;
}

.sw-logo-text {
  display: flex;
  gap: 6px;
  font-size: 17px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.sw-logo-text strong {
  color: var(--sw-blue);
  font-weight: 800;
}

.sw-logo-text span {
  color: #3d3dff;
  font-weight: 600;
}

.sw-step {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sw-muted);
}

.sw-headline {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(30px, 2.6vw, 40px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111;
}

.sw-visual {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vh, 40px) 0;
  min-height: 0;
}

.sw-visual .sw-hero {
  width: min(240px, 70%);
  max-height: min(280px, 38vh);
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.sw-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  color: var(--sw-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  width: fit-content;
}

.sw-help:hover {
  color: var(--sw-text);
}

.sw-help svg {
  flex-shrink: 0;
}

.sw-right {
  display: flex;
  flex-direction: column;
  padding: 28px clamp(32px, 5vw, 72px) 40px;
  background: #fff;
  min-height: calc(100vh - var(--sw-banner));
  min-height: calc(100dvh - var(--sw-banner));
  min-width: 0;
}

.sw-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sw-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.sw-back:hover {
  color: var(--sw-text);
}

.sw-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-bottom: 28px;
}

.sw-qr-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5b5bf0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.sw-qr-link:hover {
  color: #0500ff;
}

.sw-qr-link[hidden] {
  display: none !important;
}

.sw-main {
  width: min(480px, 100%);
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 4px;
  padding-bottom: clamp(40px, 8vh, 96px);
}

.sw-main[hidden] {
  display: none !important;
}

.sw-right .sw-topbar {
  margin-bottom: 28px;
}

.sw-right.is-password .sw-topbar {
  margin-bottom: 28px;
}

.sw-right.is-wallets .sw-topbar,
.sw-right.is-method .sw-topbar,
.sw-right.is-import .sw-topbar {
  margin-bottom: 28px;
}

.sw-right.is-password .sw-main-password {
  width: min(520px, 100%);
  justify-content: flex-start;
  padding-top: 8px;
  padding-bottom: 40px;
}

.sw-choose-title {
  margin: 0 0 20px;
  font-size: clamp(20px, 1.6vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111;
}

.sw-pass-title {
  margin: 0 0 36px;
  font-size: clamp(28px, 2.4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #111;
}

.sw-pass-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
}

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

.sw-field-label {
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.sw-field-control {
  position: relative;
  display: block;
}

.sw-field-control input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 16px;
  border: 1px solid #e2e2e8;
  border-radius: 12px;
  background: #fff;
  color: var(--sw-text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sw-field-control input::placeholder {
  color: #b0b0ba;
}

.sw-field-control input:focus {
  border-color: #b4b0ff;
  box-shadow: 0 0 0 3px rgba(180, 176, 255, 0.25);
}

.sw-eye {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7b73ff;
  cursor: pointer;
}

.sw-eye:hover {
  color: #0500ff;
  background: rgba(123, 115, 255, 0.08);
}

.sw-pass-error {
  margin: -8px 0 0;
  color: #d92d20;
  font-size: 13px;
  font-weight: 500;
}

.sw-pass-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

.sw-continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 48px;
  padding: 12px 28px;
  border: 0;
  border-radius: 999px;
  background: #b4b0ff;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.sw-continue:hover {
  background: #8f87ff;
}

.sw-continue:active {
  transform: scale(0.98);
}

.sw-right.is-wallets .sw-main-wallets {
  width: min(560px, 100%);
  justify-content: flex-start;
  padding-top: 4px;
  padding-bottom: 40px;
}

.sw-wallets-title {
  margin: 0 0 22px;
  font-size: clamp(26px, 2.2vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #111;
}

.sw-wallet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.sw-wallet {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 14px 18px;
  border: 0;
  border-radius: 16px;
  background: var(--sw-row);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sw-wallet:hover {
  background: var(--sw-row-hover);
}

.sw-wallet-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sw-wallet-icon svg {
  display: block;
  width: 32px;
  height: 32px;
}

.sw-wallet-icon-muted {
  color: #8b8b97;
}

.sw-wallet-label {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #111;
}

.sw-wallet-chevron {
  color: #b0b0ba;
  flex-shrink: 0;
  display: inline-flex;
}

.sw-hw-title {
  margin: 28px 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sw-muted);
}

.sw-right.is-method .sw-main-method {
  width: min(560px, 100%);
  justify-content: flex-start;
  padding-top: 4px;
  padding-bottom: 40px;
}

.sw-method-title {
  margin: 0 0 22px;
  font-size: clamp(26px, 2.2vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #111;
}

.sw-method-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.sw-method {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 14px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--sw-row);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sw-method:hover {
  background: var(--sw-row-hover);
}

.sw-method-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e8e8ed;
  color: #6b6b76;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sw-method-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sw-method-label {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #111;
}

.sw-method-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #8484f0;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.sw-method .sw-wallet-chevron {
  color: #b0b0ba;
}

.sw-method:hover .sw-wallet-chevron {
  color: #8484f0;
}

.sw-right.is-import .sw-main-import {
  width: min(560px, 100%);
  justify-content: flex-start;
  padding-top: 4px;
  padding-bottom: 40px;
}

.sw-right.is-import .sw-back {
  color: #5b5bf0;
}

.sw-right.is-import .sw-back:hover {
  color: #0500ff;
}

.sw-import-title {
  margin: 0 0 28px;
  font-size: clamp(24px, 2.1vw, 32px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #111;
}

.sw-import-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
}

.sw-field-hint {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--sw-muted);
}

.sw-clear {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e8e8ed;
  color: #6b6b76;
  cursor: pointer;
}

.sw-clear:hover {
  background: #dcdce3;
  color: #111;
}

.sw-secret-input {
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  border: 1px solid #e2e2e8;
  border-radius: 12px;
  background: #fff;
  color: var(--sw-text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sw-secret-input:focus {
  border-color: #b4b0ff;
  box-shadow: 0 0 0 3px rgba(180, 176, 255, 0.25);
}

.sw-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.sw-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 16px 20px;
  border: 0;
  border-radius: 16px;
  background: var(--sw-row);
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.sw-option:hover {
  background: var(--sw-row-hover);
}

.sw-option:active {
  transform: scale(0.995);
}

.sw-option-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #5c5c66;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.sw-option-label {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #111;
}

.sw-option-chevron {
  color: #b0b0ba;
  flex-shrink: 0;
}

/* Large desktop */
@media (min-width: 1280px) {
  :root {
    --sw-left-w: clamp(380px, 32vw, 480px);
  }

  .sw-left {
    padding: 36px 48px 32px;
  }

  .sw-visual .sw-hero {
    width: min(260px, 58%);
    max-height: min(300px, 36vh);
  }

  .sw-main {
    width: min(520px, 100%);
  }
}

@media (min-width: 1600px) {
  :root {
    --sw-left-w: 480px;
  }

  .sw-headline {
    font-size: 42px;
  }
}

/* Compact desktop height */
@media (min-width: 901px) and (max-height: 720px) {
  .sw-logo {
    margin-bottom: 24px;
  }

  .sw-headline {
    font-size: 28px;
  }

  .sw-visual {
    padding: 8px 0;
  }

  .sw-visual .sw-hero {
    width: min(180px, 50%);
    max-height: 180px;
  }

  .sw-topbar {
    margin-bottom: 32px;
  }

  .sw-main {
    padding-bottom: 32px;
  }
}

@media (max-width: 900px) {
  :root {
    --sw-banner: 44px;
  }

  .sw-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .sw-left {
    min-height: auto;
    padding: 24px 20px 8px;
  }

  .sw-logo {
    margin-bottom: 28px;
  }

  .sw-headline {
    max-width: none;
    font-size: 28px;
  }

  .sw-visual {
    min-height: 180px;
    padding: 12px 0 16px;
  }

  .sw-visual .sw-hero {
    width: min(200px, 52vw);
    max-height: 200px;
  }

  .sw-help {
    display: none;
  }

  .sw-right {
    min-height: auto;
    padding: 8px 20px 40px;
  }

  .sw-topbar {
    margin-bottom: 28px;
  }

  .sw-main {
    width: 100%;
    padding-bottom: 24px;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  :root {
    --sw-banner: 64px;
  }

  .sw-option {
    min-height: 64px;
  }
}
