/* ============================================
   TRUSTPAY - PAGAMENTO POR VOZ CONTÍNUA
   CSS Minimalista e Otimizado
   ============================================ */

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Start Screen */
.start-screen {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  padding: 3rem 2rem;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.start-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.start-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
  animation: pulse 2s infinite;
}

.start-screen h1 {
  font-size: 2rem;
  color: #1f2937;
  margin: 0;
}

.start-subtitle {
  font-size: 1.1rem;
  color: #6b7280;
  font-weight: 500;
}

.start-description {
  color: #4b5563;
  line-height: 1.6;
  max-width: 400px;
}

.start-btn {
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  color: white;
  border: none;
  padding: 1.25rem 2.5rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  transition: all 0.3s;
  margin-top: 1rem;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

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

.start-btn:focus {
  outline: 3px solid #4f46e5;
  outline-offset: 2px;
}

.start-hint {
  font-size: 0.85rem;
  color: #9ca3af;
  font-style: italic;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Container */
.container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  overflow: hidden;
  animation: fadeIn 0.5s ease;
}

/* Header */
.header {
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  color: white;
  padding: 2rem;
  text-align: center;
}

.header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  opacity: 0.9;
  font-size: 0.9rem;
}

/* Voice Status */
.voice-status {
  background: #f3f4f6;
  padding: 1rem 2rem;
  text-align: center;
  font-weight: 600;
  color: #4f46e5;
  border-bottom: 2px solid #e5e7eb;
  animation: pulse 2s infinite;
}

.voice-status.listening {
  background: #fee2e2;
  color: #dc2626;
  animation: pulse 1s infinite;
}

.voice-status.processing {
  background: #fef3c7;
  color: #d97706;
}

.voice-status.success {
  background: #d1fae5;
  color: #10b981;
  animation: none;
}

.voice-status.error {
  background: #fee2e2;
  color: #dc2626;
  animation: shake 0.3s;
}

.voice-status.confirming {
  background: #dbeafe;
  color: #2563eb;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Steps */
.step {
  display: none;
  padding: 2rem;
}

.step.active {
  display: block;
  animation: slideIn 0.3s ease;
}

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

.step h2 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: #1f2937;
}

/* Fields */
.field {
  margin-bottom: 1.5rem;
  position: relative;
}

.field.editing {
  background: #fef3c7;
  padding: 1rem;
  border-radius: 8px;
  margin: -0.5rem -1rem 1rem -1rem;
  animation: highlight 0.5s ease;
}

@keyframes highlight {
  0%,
  100% {
    background: #fef3c7;
  }
  50% {
    background: #fde68a;
  }
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #374151;
}

.field input {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  background: #f9fafb;
  transition: all 0.3s;
  cursor: default;
}

.field input:focus {
  outline: none;
  border-color: #4f46e5;
  background: white;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.field input.filled {
  border-color: #10b981;
  background: #f0fdf4;
}

.hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #6b7280;
  min-height: 1.2rem;
}

.hint.error {
  color: #dc2626;
  font-weight: 500;
}

.hint.success {
  color: #10b981;
  font-weight: 500;
}

/* Summary */
.summary {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  border: 1px solid #e5e7eb;
}

.summary p {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

/* Confirmation */
.confirmation {
  background: #f9fafb;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.confirmation div {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.confirmation div:last-child {
  border-bottom: none;
  font-weight: 600;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 2px solid #e5e7eb;
}

/* Success */
.success {
  text-align: center;
  padding: 2rem;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.5rem;
  color: white;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.success h2 {
  color: #10b981;
  margin-bottom: 1rem;
}

.success p {
  color: #6b7280;
  margin: 0.5rem 0;
}

.date {
  font-size: 0.85rem;
  margin-top: 1rem !important;
}

.success-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.action-hint {
  color: #4f46e5;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.75rem;
  background: #eef2ff;
  border-radius: 8px;
}

/* Toast */
.toast {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: #10b981;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
  font-weight: 600;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 1000;
  max-width: 300px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.error {
  background: #ef4444;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
}

/* Help Button */
.help {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 50;
}

#helpBtn {
  width: 56px;
  height: 56px;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  transition: all 0.3s;
}

#helpBtn:hover,
#helpBtn:focus {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* Audio Visualizer */
.audio-visualizer {
  width: 90px;
  height: 90px;
  margin: 1rem auto;
  border-radius: 50%;
  background: radial-gradient(circle, #4f46e5 30%, #a5b4fc 70%);
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.6);
  transform: scale(1);
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

.audio-visualizer.active {
  transform: scale(1.3);
  box-shadow: 0 0 25px rgba(79, 70, 229, 0.9);
}

/* Responsive Mobile */
@media (max-width: 480px) {
  body {
    padding: 0;
  }

  .start-screen {
    border-radius: 0;
    min-height: 100vh;
    padding: 2rem 1.5rem;
  }

  .start-icon {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
  }

  .start-screen h1 {
    font-size: 1.75rem;
  }

  .start-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
  }

  .container {
    border-radius: 0;
    min-height: 100vh;
  }

  .header {
    padding: 1.5rem;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .step {
    padding: 1.5rem;
  }

  .field input {
    font-size: 16px;
  }

  .toast {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }

  .help {
    bottom: 1rem;
    right: 1rem;
  }

  #helpBtn {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
