/* Dark mode only, Last.fm accent */
:root {
  --bg: #0b0c0f;           /* near-black background */
  --surface: #121418;      /* card surface */
  --surface-2: #161a1f;    /* input surface */
  --text: #e6e7eb;         /* primary text */
  --muted: #9aa0aa;        /* secondary text */
  --border: #242833;       /* subtle borders */
  --border-strong: #2b303b;
  --accent: #d51007;       /* Last.fm red */
  --accent-press: #b40f07; /* pressed */
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

.page {
  min-height: 100%;
  padding: 32px 16px;
  display: grid;
  place-items: center;
}

.card {
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card__header {
  margin-bottom: 12px;
}

.title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 16px;
}

.step {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
}

.step__title {
  margin: 0 0 8px;
  font-size: 16px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 680px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.input-group input::placeholder {
  color: #6d7380;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(213, 16, 7, 0.25);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 44px;
}

.icon-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1115;
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover {
  background: #14171d;
}

.btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  transition: transform 0.06s ease, background-color 0.15s ease,
    border-color 0.15s ease, opacity 0.15s ease;
  width: 100%;
}

.btn:hover {
  background: #1a1f26;
}

.btn:active {
  transform: translateY(0.5px);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-accent {
  border-color: #3a0e0c;
  background: #190e0e;
  color: #ffd9d7;
}

.btn-accent:hover {
  background: #210f0e;
  border-color: #511311;
}

.btn-accent:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(213, 16, 7, 0.35);
}

.btn-secondary {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
}

.loading {
  display: none;
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  margin: 0 auto 8px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #3a1313;
  background: #1a0f10;
  color: #ffd9d7;
}

.toast--error {
  border-color: #4b1514;
  background: #201011;
}

.result {
  display: none;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
}

.result__title {
  margin: 0 0 6px;
  font-size: 15px;
  color: #ffd9d7;
}

.code-block {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #0f1115;
  border: 1px dashed var(--border-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
  font-size: 14px;
  color: var(--text);
  overflow-x: auto;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.note {
  margin-top: 8px;
  font-size: 13px;
}

.footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  text-align: center;
}

.link {
  color: #ffb3ad; /* softer red for links */
  text-decoration: none;
  border-bottom: 1px solid #3a0e0c;
}

.link:hover {
  border-bottom-color: #511311;
}

.muted {
  color: var(--muted);
}

.error-text {
  display: block;
  min-height: 16px;
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
}