/**
 * VIDA Brand Design System
 * Matching the original VIDA app design
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* VIDA Brand Colors - Exact from design */
  --vida-teal: #00838F;        /* Primary teal from logo */
  --vida-teal-dark: #00696F;   /* Darker teal */
  --vida-teal-light: #4FB3BF;  /* Lighter teal for hover */
  
  --vida-gold: #E8B923;        /* Gold accent */
  --vida-gold-dark: #D4AF37;   /* Darker gold */
  
  /* Backgrounds - Clean white */
  --bg: #FFFFFF;
  --bg-gray: #F5F6F8;          /* Very light gray */
  --bg-card: #FFFFFF;
  
  /* Text - High contrast */
  --text: #1A1A1A;             /* Near black */
  --text-secondary: #4A4A4A;   /* Dark gray */
  --text-light: #7A7A7A;       /* Medium gray */
  --text-hint: #9E9E9E;        /* Light gray for hints */
  
  /* Borders */
  --border: #E0E0E0;
  --border-light: #F0F0F0;
  
  /* Shadows - Soft and subtle */
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.1);
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  
  /* Border radius - Matching VIDA style */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-card: 24px;
  --radius-full: 9999px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-gray);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
  min-height: 100vh;
  background: var(--bg-gray);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Header - White with VIDA logo and teal accents */
.app-header {
  background: var(--bg);
  color: var(--text);
  padding: var(--space-md);
  padding-top: calc(env(safe-area-inset-top) + var(--space-md));
  box-shadow: var(--shadow);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: 80px;
}

.app-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--vida-teal) 0%, var(--vida-teal-light) 100%);
}

.app-header .header-logo {
  height: 60px;
  width: auto;
  flex-shrink: 0;
}

.app-header .header-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  flex: 1;
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--vida-teal);
  margin: 0;
  line-height: 1.2;
}

.app-header p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.3;
}

/* Language Toggle */
.lang-toggle {
  position: absolute;
  top: calc(env(safe-area-inset-top) + var(--space-md));
  right: var(--space-md);
  display: flex;
  gap: 0.5rem;
}

.lang-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--vida-teal);
  background: var(--bg);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--vida-teal);
  transition: all 0.2s;
  min-height: 40px;
}

.lang-btn.active {
  background: var(--vida-teal);
  color: var(--bg);
}

.lang-btn:hover {
  background: var(--vida-teal-light);
  border-color: var(--vida-teal-light);
  color: var(--bg);
}

/* Content Area */
.app-content {
  padding: var(--space-md);
  max-width: 640px;
  margin: 0 auto;
}

.step {
  animation: fadeIn 0.3s ease-in;
}

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

/* Cards - Matching VIDA card style */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
}

.card.highlight {
  background: linear-gradient(135deg, #E0F7FA 0%, #B2EBF2 100%);
  border: none;
}

.card.success {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  border: none;
}

.card.warning {
  background: linear-gradient(135deg, #FFF9C4 0%, #FFF59D 100%);
  border: none;
}

.card h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.card p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-lg);
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

/* Help Icons - Teal theme */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  background: var(--vida-teal);
  color: var(--bg);
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 0.5rem;
  vertical-align: middle;
  transition: all 0.2s;
}

.help-icon:hover {
  background: var(--vida-teal-dark);
  transform: scale(1.05);
}

.help-text {
  display: none;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: #E0F7FA;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-top: var(--space-sm);
  border-left: 3px solid var(--vida-teal);
  line-height: 1.6;
}

.help-text strong {
  color: var(--text);
}

.help-text.show {
  display: block;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 200px; }
}

/* Input Fields - Clean white */
input[type="text"],
input[type="email"],
input[type="number"],
select {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  min-height: 52px;
  transition: all 0.2s;
}

input::placeholder {
  color: var(--text-hint);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--vida-teal);
  box-shadow: 0 0 0 3px rgba(0, 131, 143, 0.1);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231A1A1A'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25rem;
  padding-right: 3rem;
  appearance: none;
}

/* Slider - Teal theme */
.slider-container {
  margin: var(--space-lg) 0;
}

.slider {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--vida-teal);
  cursor: pointer;
  border: 4px solid var(--bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.slider::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

.slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--vida-teal);
  cursor: pointer;
  border: 4px solid var(--bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slider-value {
  display: block;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--vida-teal);
  margin-top: var(--space-md);
}

/* Buttons - Teal primary */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  min-height: 56px;
  font-family: inherit;
  box-shadow: var(--shadow);
}

.btn-primary {
  background: var(--vida-teal);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--vida-teal-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
  background: var(--bg);
  color: var(--vida-teal);
  border: 2px solid var(--vida-teal);
}

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

/* Credit Simulator - Card style */
.credit-simulator {
  background: var(--bg);
  border-radius: var(--radius-card);
  padding: var(--space-xl);
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-card);
}

.simulator-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.simulator-header h3 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.simulator-header p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Amount Display - Large and prominent */
.amount-display {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--vida-teal);
  text-align: center;
  margin: var(--space-xl) 0;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Payment Details Card */
.payment-details {
  background: var(--bg-gray);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
}

.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}

.payment-row:last-child {
  border-bottom: none;
  border-top: 2px solid var(--vida-teal);
  padding-top: var(--space-md);
  margin-top: var(--space-sm);
  font-size: 1.25rem;
}

.payment-label {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

.payment-value {
  font-weight: 700;
  color: var(--text);
  font-size: 1.0625rem;
}

.payment-row:last-child .payment-value {
  color: var(--vida-teal);
}

/* Success State */
.success-message {
  text-align: center;
  padding: var(--space-xl);
}

.success-icon {
  width: 96px;
  height: 96px;
  background: var(--vida-teal);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  font-size: 3rem;
  box-shadow: var(--shadow-lg);
}

.success-message h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.success-message p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
}

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

.loading {
  text-align: center;
  padding: var(--space-xl);
}

.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid var(--border);
  border-top-color: var(--vida-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* Progress Indicator */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--vida-teal);
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 640px) {
  .app-header {
    min-height: 70px;
    gap: var(--space-sm);
  }
  
  .app-header .header-logo {
    height: 50px;
  }
  
  .app-header h1 {
    font-size: 1.25rem;
  }
  
  .app-header p {
    font-size: 0.875rem;
  }
  
  /* Stack language buttons vertically on mobile */
  .lang-toggle {
    flex-direction: column;
    gap: 0.25rem;
    top: calc(env(safe-area-inset-top) + 0.5rem);
    right: 0.5rem;
  }
  
  .lang-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-height: 28px;
    min-width: 32px;
    border-width: 1.5px;
  }
  
  .amount-display {
    font-size: 2.5rem;
  }
}

@media (min-width: 768px) {
  .app-content {
    padding: var(--space-xl);
  }
  
  .card,
  .credit-simulator {
    padding: var(--space-xl);
  }
}

/* Touch Targets */
@media (hover: none) and (pointer: coarse) {
  input,
  select,
  .btn {
    min-height: 56px;
  }
  
  input,
  select {
    font-size: 16px;
  }
}

/* Additional utility classes for all pages */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.5rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
}

.info-box {
  background: var(--bg-gray);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin: 1rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.success-card {
  text-align: center;
  padding: 2rem 1rem;
}

.success-icon {
  font-size: 3rem;
  color: var(--vida-teal);
  margin-bottom: 1rem;
}

.success-card h2 {
  color: var(--vida-teal);
  margin-bottom: 0.5rem;
}

.success-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.error-card {
  background: #FEE;
  padding: 1rem;
  border-radius: var(--radius-md);
  border-left: 4px solid #D32F2F;
  color: #D32F2F;
}

.btn-large {
  width: 100%;
  padding: 1rem;
  font-size: 1.0625rem;
  font-weight: 600;
  margin-top: 1.5rem;
}

.btn-outline {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--vida-teal);
  border: 2px solid var(--vida-teal);
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: var(--vida-teal);
  color: white;
  transform: translateY(-1px);
}
