/* Saver Platform - Clean Light Theme */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f0f4f8;
  --card-bg: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #d1d5db;
  --border-light: #e5e7eb;
  --green-cta: #4ade80;
  --green-hover: #22c55e;
  --green-active: #16a34a;
  --nav-link: #3b82f6;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Navigation */
.navbar {
  padding: 0.75rem 1.5rem;
}

.nav-link {
  font-size: 0.875rem;
  color: var(--nav-link);
  text-decoration: none;
  font-weight: 500;
}

.nav-link:hover {
  text-decoration: underline;
}

.nav-active {
  color: var(--nav-link);
}

/* Main Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

/* Platform Card */
.platform-card {
  background: var(--card-bg);
  border: 2px solid var(--nav-link);
  border-radius: 12px;
  padding: 2rem 2rem 2.5rem;
}

/* Title */
.platform-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

/* Stats Row */
.stats-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  min-width: 160px;
  flex: 1;
  max-width: 220px;
  transition: border-color 200ms ease;
}

.stat-card:hover {
  border-color: var(--text-secondary);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Steps Row */
.steps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.step-text {
  text-align: center;
  flex: 1;
  min-width: 140px;
}

.step-text p {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.step-arrow {
  color: var(--text-primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Action Buttons */
.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.btn-action {
  display: block;
  width: 100%;
  max-width: 400px;
  padding: 0.875rem 2rem;
  background: var(--green-cta);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 200ms ease, box-shadow 200ms ease;
}

.btn-action:hover {
  background: var(--green-hover);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-action:active {
  background: var(--green-active);
}

.btn-action:focus-visible {
  outline: 2px solid var(--nav-link);
  outline-offset: 2px;
}

/* Shared utility */
.hidden {
  display: none !important;
}

.error-text {
  color: #ef4444;
  font-size: 0.875rem;
  text-align: center;
  margin-top: 1rem;
}

/* Section title */
.section-title {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Check Page */
.check-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.wallet-textarea {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  resize: none;
  outline: none;
  color: var(--text-primary);
  background: var(--card-bg);
  transition: border-color 200ms ease;
  word-break: break-all;
}

.wallet-textarea:focus {
  border-color: var(--green-cta);
}

.wallet-textarea::placeholder {
  color: var(--text-muted);
}

/* Result display */
.result-info {
  width: 100%;
  margin-bottom: 0.5rem;
}

.result-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.result-wallet {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.5;
}

.locked-list {
  width: 100%;
  margin-bottom: 0.75rem;
}

.locked-item {
  font-size: 0.9rem;
  color: var(--text-primary);
  padding: 0.25rem 0;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 1.25rem;
}

.status-icon {
  flex-shrink: 0;
}

.status-text {
  font-size: 1rem;
  font-weight: 500;
}

/* Outline button variant */
.btn-action-outline {
  display: block;
  width: 100%;
  max-width: 400px;
  padding: 0.875rem 2rem;
  background: transparent;
  color: var(--green-cta);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 2px solid var(--green-cta);
  border-radius: 10px;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}

.btn-action-outline:hover {
  background: rgba(74, 222, 128, 0.1);
}

.btn-action-outline:focus-visible {
  outline: 2px solid var(--nav-link);
  outline-offset: 2px;
}

/* Register page input */
.wallet-input-field {
  width: 100%;
  max-width: 420px;
  padding: 0.875rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  outline: none;
  color: var(--text-primary);
  background: var(--card-bg);
  transition: border-color 200ms ease;
}

.wallet-input-field:focus {
  border-color: var(--green-cta);
}

.wallet-input-field::placeholder {
  color: var(--text-muted);
}

.commission-note {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* Live result balance rows */
.balance-list {
  width: 100%;
}

.live-balance-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.live-balance-row:last-child {
  border-bottom: none;
}

.live-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.live-label {
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 45px;
}

.live-details {
  flex: 1;
}

.live-detail-line {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Wallet accordion */
.wallet-accordion {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  transition: background 150ms ease;
}

.accordion-header:hover {
  background: rgba(0, 0, 0, 0.02);
}

.accordion-title {
  flex: 1;
}

.accordion-chevron {
  transition: transform 200ms ease;
  color: var(--text-secondary);
}

.accordion-header.expanded .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 0 1rem 0.75rem;
}

/* Spinner (green sparkle animation for "saver in progress") */
.spinner-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  animation: spin-pulse 1.2s linear infinite;
}

@keyframes spin-pulse {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Loading state for stat numbers */
.stat-number.loading {
  color: var(--text-muted);
  font-size: 1.5rem;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 0 1rem 2rem;
  }

  .platform-card {
    padding: 1.5rem 1rem 2rem;
  }

  .platform-title {
    font-size: 1.375rem;
  }

  .stats-row {
    flex-direction: column;
    align-items: center;
  }

  .stat-card {
    width: 100%;
    max-width: 280px;
  }

  .steps-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .step-arrow {
    transform: rotate(90deg);
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .btn-action {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }
}
