/* ============================================
   EasyPay Dashboard — Design System v2
   ============================================ */

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   Main Container
   ============================================ */

.container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  min-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}

/* ============================================
   App Root — flex column for cards
   ============================================ */

.app {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* ============================================
   Cards — shared base for balance, actions, form
   ============================================ */

.balance-card,
.actions-card,
.withdraw-card,
.form-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

/* Home screen cards — no shadow */
.balance-card,
.actions-card,
.withdraw-card {
  box-shadow: none;
}

/* ============================================
   Form Header: icon + title + step
   ============================================ */

.form-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 2px;
}

.form-header-icon {
  width: 20px;
  height: 20px;
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-header-icon svg { width: 15px; height: 15px; }

.form-header-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.form-header-step {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

/* ============================================
   Progress Bar — inside form-card
   ============================================ */

.form-progress {
  display: flex;
  gap: 4px;
  margin: 10px 0 18px 0;
}

.form-progress.hidden {
  display: none !important;
}

.form-progress-seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border-input);
  overflow: hidden;
  transition: background 400ms ease;
}

.form-progress-seg.done {
  background: var(--teal);
}

.form-progress-seg.active {
  background: var(--border-input);
  position: relative;
}

.form-progress-seg.active::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 40%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 400ms ease;
}

/* ============================================
   Form Section Titles
   ============================================ */

.form-section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.form-section-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
  display: none !important;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
  gap: var(--spacing-sm);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface-gray);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.error-screen {
  text-align: center;
  padding: var(--spacing-lg);
}

.error-screen h2 {
  font-family: var(--font-display);
  color: var(--error-color);
  margin-bottom: var(--spacing-sm);
}

/* ============================================
   Glass Box — legacy, still used
   ============================================ */

.glass-box {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ============================================
   Page Transitions
   ============================================ */

.screen {
  animation: fadeIn var(--ease);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 380px) {
  .balance-card,
  .actions-card,
  .withdraw-card,
  .form-card {
    padding: 14px;
  }

  .form-section-title {
    font-size: 16px;
  }
}
