/* Reset y configuración base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  transition: background-color 0.4s, color 0.4s;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Temas */
html:not(.dark) body {
  background-color: #f3f4f6;
  color: #1f2937;
}

html.dark body {
  background-color: #111827;
  color: #f9fafb;
}

/* Contenedor */
.container {
  width: 100%;
  max-width: 28rem;
}

.card {
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  padding: 1.5rem;
  transition: all 0.5s ease;
}
html.dark .card {
  background-color: #1f2937;
}

/* Encabezado */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1f2937;
}
html.dark .header h1 {
  color: #f9fafb;
}

/* Tasa actual */
.rate-box {
  text-align: center;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background-color: #fffbeb;
  border: 2px solid #fde68a;
  margin-bottom: 1.5rem;
}
html.dark .rate-box {
  background-color: rgba(120, 53, 15, 0.15);
  border-color: #b45309;
}
.rate-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: #92400e;
}
html.dark .rate-text {
  color: #fcd34d;
}

/* Etiquetas */
.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
}
html.dark .label {
  color: #e5e7eb;
}

/* Inputs y select */
.input,
.select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 0.5rem;
  background-color: white;
  color: #1f2937;
  font-size: 1rem;
  transition: all 0.15s ease;
}
html.dark .input,
html.dark .select {
  border-color: #4b5563;
  background-color: #1f2937;
  color: #f9fafb;
}
.input::placeholder,
.select::placeholder {
  color: #9ca3af;
}
html.dark .input::placeholder,
html.dark .select::placeholder {
  color: #6b7280;
}
.input:focus,
.select:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* Select con ícono */
.select-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}
.select {
  padding-right: 2.5rem;
  appearance: none;
}
.select-icon {
  position: absolute;
  right: 1.25rem;
  top: 2.5rem;
  width: 1.25rem;
  height: 1.25rem;
  pointer-events: none;
  color: #6b7280;
}
html.dark .select-icon {
  color: #d1d5db;
}

/* Botón */
.btn {
  width: 100%;
  padding: 0.75rem;
  background-color: #f59e0b;
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  font-size: 1rem;
}
.btn:hover:not(:disabled) {
  background-color: #d97706;
  box-shadow: 0 6px 8px -2px rgba(0,0,0,0.15);
}
.btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.5);
}
.btn:disabled {
  background-color: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 1;
}
html.dark .btn:disabled {
  background-color: #374151;
  color: #6b7280;
}

/* Resultado */
.result-box {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: #fffbeb;
  border-left: 4px solid #f59e0b;
  color: #374151;
  border-radius: 0.5rem;
  min-height: 4rem;
  display: flex;
  align-items: center;
}
html.dark .result-box {
  background-color: #374151;
  color: #f9fafb;
}
.result-placeholder {
  font-style: italic;
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
}
html.dark .result-placeholder {
  color: #d1d5db;
}

/* Switch de tema */
.switch {
  position: relative;
  width: 54px;
  height: 28px;
  background: #e2e8f0;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.4s ease;
}
.switch::before {
  content: "🌙";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
html.dark .switch {
  background: #1f2937;
  box-shadow: 0 0 12px 3px rgba(250, 204, 21, 0.4);
}
html.dark .switch::before {
  content: "☀️";
  transform: translateX(26px);
  background: #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.8);
}

/* Animación de resultado */
.resultado-animado {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: all 0.4s ease-out;
}
.resultado-animado.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Responsive */
@media (min-width: 640px) {
  .card {
    padding: 2rem;
  }
  .header h1 {
    font-size: 2.25rem;
  }
}