@import url('/migration-theme.css');

:root {
  --bg: var(--theme-bg);
  --panel: var(--theme-panel);
  --line: var(--theme-line);
  --ink: var(--theme-ink);
  --muted: var(--theme-muted);
  --accent: var(--theme-accent);
  --accent-strong: var(--theme-accent-strong);
  --success: var(--theme-success);
  --danger: var(--theme-danger);
  --shadow: var(--theme-shadow);
  --radius: var(--theme-radius-lg);
  --radius-input: var(--theme-radius-sm);
  --font: var(--theme-font);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, var(--theme-bg-start) 0%, var(--theme-bg-end) 100%);
}

.migrate-shell {
  min-height: 100vh;
  padding: 32px 18px;
  display: grid;
  place-items: center;
}

.migrate-card {
  width: min(680px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  gap: 22px;
}

.migrate-copy {
  display: grid;
  gap: 12px;
}

.migrate-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.migrate-copy h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.migrate-copy p {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

.migrate-note {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--theme-panel-soft);
}

.migrate-note strong {
  font-size: 14px;
  font-weight: 600;
}

.migrate-note span {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.migrate-form {
  display: grid;
  gap: 18px;
}

.migrate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.migrate-field {
  display: grid;
  gap: 8px;
}

.migrate-field-wide {
  grid-column: 1 / -1;
}

.migrate-field label {
  font-size: 14px;
  font-weight: 500;
}

.migrate-field input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.migrate-field input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.migrate-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--theme-accent-soft);
}

.migrate-submit {
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.migrate-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.migrate-status,
.migrate-confirmation {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.migrate-confirmation {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--theme-panel-soft);
}

.migrate-confirmation.is-ready {
  color: var(--muted);
}

.migrate-confirmation.is-already-set {
  border-color: rgba(15, 122, 90, 0.24);
  background: var(--theme-success-soft);
  color: var(--success);
}

.migrate-confirmation.is-closed {
  border-color: var(--theme-accent-soft);
  background: var(--theme-accent-soft);
  color: var(--accent);
}

.migrate-status.error {
  color: var(--danger);
}

.migrate-status.success {
  color: var(--success);
}

.migrate-confirmation a {
  color: var(--accent-strong);
  word-break: break-all;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .migrate-shell { padding: 18px; }
  .migrate-card { padding: 24px 18px; gap: 18px; }
  .migrate-grid { grid-template-columns: 1fr; }
  .migrate-copy p { font-size: 16px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e2126;
    --panel: #282c33;
    --line: rgba(160, 168, 180, 0.14);
    --ink: #edf0f4;
    --muted: #8a96a4;
    --accent: #3b82f6;
    --accent-strong: #60a5fa;
    --success: #22c48a;
    --danger: #f06060;
  }

  body { background: #1e2126; color: #edf0f4; }

  .migrate-card { background: #282c33; border-color: rgba(160, 168, 180, 0.14); }

  .migrate-note { background: #1e2126; border-color: rgba(160, 168, 180, 0.18); }
  .migrate-note strong { color: #edf0f4; }
  .migrate-note span { color: #8a96a4; }

  .migrate-field input {
    background: #1e2126;
    border-color: rgba(160, 168, 180, 0.24);
    color: #edf0f4;
  }

  .migrate-field input::placeholder { color: #8a96a4; opacity: 1; }

  .migrate-field input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
  }

  .migrate-confirmation { background: #1e2126; border-color: rgba(160, 168, 180, 0.14); }
  .migrate-confirmation.is-already-set {
    background: rgba(34, 196, 138, 0.09);
    border-color: rgba(34, 196, 138, 0.24);
    color: #22c48a;
  }
  .migrate-confirmation.is-closed {
    background: rgba(59, 130, 246, 0.09);
    border-color: rgba(59, 130, 246, 0.22);
    color: #60a5fa;
  }
}

html[data-theme="dark"] body { background: #1e2126 !important; color: #edf0f4 !important; }
html[data-theme="dark"] .migrate-card { background: #282c33 !important; border-color: rgba(160, 168, 180, 0.14) !important; }
html[data-theme="dark"] .migrate-note,
html[data-theme="dark"] .migrate-confirmation { background: #1e2126 !important; border-color: rgba(160, 168, 180, 0.18) !important; }
html[data-theme="dark"] .migrate-field input { background: #1e2126 !important; border-color: rgba(160, 168, 180, 0.24) !important; color: #edf0f4 !important; }
