:root {
  --bg-color: #06090e;
  --card-bg: rgba(13, 20, 32, 0.75);
  --card-border: rgba(56, 189, 248, 0.18);
  --card-border-glow: rgba(56, 189, 248, 0.35);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #38bdf8;
  --accent-blue: #2563eb;
  --accent-glow: rgba(56, 189, 248, 0.4);
  --success-green: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Outfit', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow-x: hidden;
  position: relative;
  padding: 1.5rem 1rem;
}

/* Cyber Grid & Ambient Background */
.cyber-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-1 {
  top: 10%;
  left: 20%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #0284c7 0%, transparent 70%);
}

.bg-glow-2 {
  bottom: 10%;
  right: 20%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #0369a1 0%, transparent 70%);
}

/* Header */
.brand-header {
  z-index: 1;
  margin-bottom: 2rem;
}

.usr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.usr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.usr-name {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}

.usr-version {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

/* Main Container */
.main-container {
  z-index: 1;
  width: 100%;
  max-width: 460px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 520px;
}

.card-container {
  width: 100%;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-container.hidden {
  display: none;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
}

.card-container.active {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Glass Card */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 
    0 20px 45px -10px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(56, 189, 248, 0.06);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Top accent border highlight */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

/* Captcha Card */
.captcha-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* Captcha Box Widget */
.captcha-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 15, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s ease;
}

.captcha-box:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(14, 21, 37, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(56, 189, 248, 0.12);
}

.captcha-box:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.custom-checkbox {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
}

.captcha-box:hover .custom-checkbox {
  border-color: rgba(56, 189, 248, 0.6);
}

.checkbox-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Spinner */
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Checkmark */
.checkmark-icon {
  display: none;
  width: 24px;
  height: 24px;
  transform: scale(0);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Captcha States */
.captcha-box.loading {
  pointer-events: none;
}

.captcha-box.loading .custom-checkbox {
  border-color: transparent;
  background: transparent;
}

.captcha-box.loading .spinner {
  display: block;
}

.captcha-box.verified {
  pointer-events: none;
  border-color: rgba(16, 185, 129, 0.4);
}

.captcha-box.verified .custom-checkbox {
  border-color: var(--success-green);
  background: rgba(16, 185, 129, 0.12);
  box-shadow: 0 0 12px var(--success-glow);
}

.captcha-box.verified .spinner {
  display: none;
}

.captcha-box.verified .checkmark-icon {
  display: block;
  transform: scale(1);
}

/* Branding side */
.captcha-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.75;
}

.captcha-brand-icon {
  width: 26px;
  height: 26px;
  color: var(--accent-cyan);
}

.branding-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.brand-sub {
  font-size: 0.55rem;
  color: var(--text-muted);
}

/* System status text */
.system-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
}

.pulse-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* STAGE 2: Sonny Card */
.sonny-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  padding: 2.2rem 2rem;
}

.sonny-portrait-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.7),
    0 0 25px rgba(56, 189, 248, 0.25);
  border: 2px solid rgba(56, 189, 248, 0.35);
}

.portrait-glow {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 30px rgba(56, 189, 248, 0.35);
  pointer-events: none;
  z-index: 2;
}

.sonny-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sonny-portrait-wrapper:hover .sonny-image {
  transform: scale(1.05);
}

/* Hologram scanline effect */
.scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(56, 189, 248, 0.08) 51%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 3;
}

.id-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  background: rgba(6, 10, 18, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
  z-index: 4;
}

.id-code {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
}

.id-status {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--success-green);
  background: rgba(16, 185, 129, 0.15);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* Quote */
.quote-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.speech-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.sound-wave {
  width: 3px;
  height: 10px;
  background-color: var(--accent-cyan);
  border-radius: 3px;
  animation: wave 1.2s infinite ease-in-out;
}

.sound-wave:nth-child(2) {
  height: 14px;
  animation-delay: 0.2s;
}

.sound-wave:nth-child(3) {
  height: 8px;
  animation-delay: 0.4s;
}

@keyframes wave {
  0%, 100% { transform: scaleY(0.5); opacity: 0.4; }
  50% { transform: scaleY(1.3); opacity: 1; }
}

.quote-source {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.quote-text {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.35;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(56, 189, 248, 0.35);
  max-width: 380px;
  letter-spacing: -0.01em;
}

.quote-subtext {
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.4;
}

/* Action button */
.card-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.7rem 1.4rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-reset:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.25);
}

.btn-reset:active {
  transform: translateY(0);
}

.btn-reset svg {
  transition: transform 0.4s ease;
}

.btn-reset:hover svg {
  transform: rotate(-45deg);
}

/* Site Footer */
.site-footer {
  z-index: 1;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
}

.site-footer em {
  color: var(--text-secondary);
  font-style: normal;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  body {
    padding: 1rem 0.75rem;
  }
  
  .glass-card {
    padding: 1.5rem 1.25rem;
  }

  .quote-text {
    font-size: 1.25rem;
  }

  .sonny-portrait-wrapper {
    width: 180px;
    height: 180px;
  }
}

@keyframes pulse-quote {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
    filter: blur(4px);
  }
  50% {
    text-shadow: 0 0 25px rgba(56, 189, 248, 0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
