/* ─── Reset & Base ────────────────────────────────────────────────── */

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

:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);

  --text-primary: #f0f0f5;
  --text-secondary: rgba(240, 240, 245, 0.5);
  --text-muted: rgba(240, 240, 245, 0.3);

  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-emerald: #34d399;
  --accent-rose: #f43f5e;

  --gradient-primary: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  --gradient-success: linear-gradient(135deg, var(--accent-emerald), var(--accent-indigo));

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* ─── App Container ──────────────────────────────────────────────── */

#app {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1.5rem;
  overflow: hidden;
}

/* ─── Ambient Background ─────────────────────────────────────────── */

.ambient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.ambient-orb--1 {
  width: 400px;
  height: 400px;
  background: var(--accent-indigo);
  top: -100px;
  right: -100px;
  animation: float-1 12s ease-in-out infinite;
}

.ambient-orb--2 {
  width: 300px;
  height: 300px;
  background: var(--accent-purple);
  bottom: -50px;
  left: -80px;
  animation: float-2 15s ease-in-out infinite;
}

.ambient-orb--3 {
  width: 200px;
  height: 200px;
  background: var(--accent-emerald);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  animation: float-3 10s ease-in-out infinite;
  opacity: 0.08;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 20px) scale(1.1); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -30px) scale(1.05); }
}

@keyframes float-3 {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.08; }
  50% { transform: translateX(-50%) scale(1.3); opacity: 0.12; }
}

/* ─── Screens ────────────────────────────────────────────────────── */

.screen {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.screen--active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* ─── Logo ───────────────────────────────────────────────────────── */

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.logo-icon {
  animation: pulse-slow 3s ease-in-out infinite;
}

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

.logo-text {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.5;
}

/* ─── Marco Button ───────────────────────────────────────────────── */

.marco-btn {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow:
    0 0 40px rgba(99, 102, 241, 0.3),
    0 0 80px rgba(168, 85, 247, 0.15);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.marco-btn:hover {
  transform: scale(1.05);
  box-shadow:
    0 0 60px rgba(99, 102, 241, 0.4),
    0 0 120px rgba(168, 85, 247, 0.2);
}

.marco-btn:active {
  transform: scale(0.95);
}

.marco-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.marco-btn__text {
  font-size: 2rem;
  font-weight: 800;
  color: white;
  z-index: 2;
  letter-spacing: -0.02em;
}

/* Ripple animation */
.marco-btn__ripple {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.4);
  animation: ripple 2.5s ease-out infinite;
}

.marco-btn__ripple--delayed {
  animation-delay: 1.25s;
}

@keyframes ripple {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Sending state */
.marco-btn--sending .marco-btn__text {
  animation: pulse-text 1s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hint {
  margin-top: 2.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Success Screen ─────────────────────────────────────────────── */

.success-icon {
  margin-bottom: 1.5rem;
  animation: success-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes success-pop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-success);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.success-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── Error Screen ───────────────────────────────────────────────── */

.error-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-rose);
  margin-bottom: 0.5rem;
}

.error-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.retry-btn {
  padding: 0.75rem 2rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.retry-btn:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ─── App CTA Footer ────────────────────────────────────────────── */

.app-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(to top, var(--bg-primary) 60%, transparent);
  text-align: center;
  z-index: 10;
}

.app-cta__text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.app-cta__badges {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.store-badge:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ─── Responsive ─────────────────────────────────────────────────── */

@media (max-height: 600px) {
  .logo { margin-bottom: 0.5rem; }
  .subtitle { margin-bottom: 1.5rem; }
  .marco-btn { width: 140px; height: 140px; }
  .marco-btn__text { font-size: 1.5rem; }
  .hint { margin-top: 1.5rem; }
}
