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

:root {
  --red: #E53935;
  --red-dark: #B71C1C;
  --red-glow: rgba(229, 57, 53, 0.25);
  --bg: #080808;
  --surface: #111111;
  --surface-2: #1A1A1A;
  --border: #242424;
  --text: #F5F5F5;
  --text-muted: #666666;
  --text-sub: #9E9E9E;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Ambient glow */
body::before {
  content: '';
  position: fixed;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(229, 57, 53, 0.12) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50%       { opacity: 1;   transform: translateX(-50%) scale(1.1); }
}

/* Card */
.card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 44px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 32px 64px rgba(0,0,0,0.6),
    0 0 80px rgba(229, 57, 53, 0.06);
  animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Icon ring */
.icon-ring {
  width: 80px;
  height: 80px;
  margin: 0;
  border-radius: 22px;
  background: linear-gradient(135deg, #E53935 0%, #B71C1C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.1) inset,
    0 16px 32px var(--red-glow);
  animation: icon-bounce 0.6s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes icon-bounce {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.icon-ring svg {
  width: 40px;
  height: 40px;
  fill: white;
}

/* Spinner wrapper */
.spinner-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  position: absolute;
  top: 0; left: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--red);
  border-right-color: rgba(229, 57, 53, 0.3);
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-ring.done {
  border-top-color: #4CAF50;
  border-right-color: rgba(76, 175, 80, 0.3);
  animation: none;
}

.spinner-ring.error {
  border-top-color: var(--red);
  border-right-color: rgba(229, 57, 53, 0.3);
  animation: none;
}

/* Typography */
h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 10px;
  color: var(--text);
}

.subtitle {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.65;
  margin-bottom: 32px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* Progress bar */
.progress-track {
  width: 100%;
  height: 3px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 32px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #E53935, #FF7043);
  border-radius: 99px;
  width: 0%;
  transition: width 0.4s ease;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.1) inset,
    0 8px 24px var(--red-glow);
  transition: all 0.2s ease;
  letter-spacing: -0.2px;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn:hover          { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,255,255,0.15) inset, 0 16px 40px var(--red-glow); }
.btn:hover::after   { opacity: 1; }
.btn:active         { transform: translateY(0); }

.btn svg {
  width: 18px;
  height: 18px;
  fill: white;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Footer note */
.note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.note a {
  color: var(--red);
  text-decoration: none;
}

/* Error box */
.error-msg {
  display: none;
  background: rgba(229, 57, 53, 0.08);
  border: 1px solid rgba(229, 57, 53, 0.2);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: #EF9A9A;
  margin-bottom: 20px;
  text-align: left;
  line-height: 1.5;
}

/* App badge */
.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 12px 5px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 20px;
}

.app-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.hidden { display: none !important; }
