:root {
  color-scheme: dark;
  --bg: #14181F;
  --card: #1C2128;
  --title: #FAFAFA;
  --subtitle: #898FA0;
  --yellow: #FAC02E;
  --on-yellow: #14181F;
  --secondary: #2C2F3A;
  --footer-muted: #585C66;
  --border: rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--title);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  flex: 0 0 auto;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}
.header img { display: block; height: 40px; width: auto; }

/* Main content area — vertically centered */
.main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Footer */
.footer {
  flex: 0 0 auto;
  padding: 24px 16px 40px;
  text-align: center;
}
.footer .powered {
  margin: 0 0 4px;
  color: var(--footer-muted);
  font-size: 14px;
  font-weight: 400;
}
.footer .links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.footer a {
  color: var(--yellow);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}
.footer a:hover { text-decoration: underline; }
.footer a .arrow { display: inline-block; margin-left: 4px; }

/* State machine: only the active section is shown */
.state { display: none; width: 100%; }
.page[data-state="loading"] .state-loading,
.page[data-state="success"] .state-success,
.page[data-state="error"]   .state-error { display: block; }

/* Centered content block (success/error) */
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.icon-badge { margin-bottom: 24px; }
.title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 42px;
  color: var(--title);
}
.subtitle {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 25px;
  color: var(--subtitle);
}

/* Buttons */
.actions {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  width: 100%;
  justify-content: center;
}
.btn {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  cursor: pointer;
  height: 58px;
  padding: 0 28px;
  border-radius: 20px;
  font-size: 16px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-width: 0;
}
.btn-primary {
  background: var(--yellow);
  color: var(--on-yellow);
  font-weight: 700;
  min-width: 460px;
}
/* On the error screen the primary button sits next to a secondary one */
.state-error .btn-primary { min-width: 0; }
.btn-secondary {
  background: var(--secondary);
  color: var(--subtitle);
  font-weight: 400;
}

/* Loader card — matches the reference video */
.loader-card {
  width: 110px;
  height: 110px;
  margin: 0 auto;
  border-radius: 24px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
}
.spinner {
  width: 40px;
  height: 40px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 600px) {
  .header { padding: 16px 20px; }
  .header img { height: 34px; }
  .title { font-size: 24px; line-height: 32px; }
  .actions {
    flex-direction: column;
    gap: 12px;
  }
  .btn {
    width: 100%;
    height: auto;
    min-height: 58px;
    padding: 14px 20px;
    white-space: normal;
    line-height: 1.25;
  }
  .btn-primary { min-width: 0; }
}
