:root {
  --text-main: #06385f;
  --text-muted: #425466;
  --primary-color: #ed2c62;
  --bg-color: #f4f7fa;
  --card-bg: #ffffff;
  --border-color: #e6ebf1;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --shadow-main: 0 20px 40px rgba(0,0,0,0.08), 0 5px 15px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Eliminamos el padding del body para que la cabecera ocupe el 100% del ancho */
body { 
  background-color: var(--bg-color); 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; 
}

/* --- NUEVA CABECERA MORADA --- */
.main-purple-header {
  background: linear-gradient(135deg, #06385f 0%, #0b527d 70%, #ed2c62 100%);
  height: 300px;
  width: 100%;
  color: white;
  text-align: center;
  /* Usamos padding superior para empujar el texto y que no lo tape la tarjeta */
  padding-top: 50px; 
}
.header-content h2 { font-size: 2.2rem; font-weight: 800; margin-bottom: 10px; }
.header-content p { font-size: 1.1rem; opacity: 0.9; }


/* --- TARJETA PRINCIPAL (650px y Superpuesta) --- */
.premium-calculator {
  background: var(--card-bg); 
  width: 100%;
  max-width: 750px; /* Ancho solicitado */
  margin: -120px auto 60px; /* El margen negativo (-120px) hace que se monte sobre la cabecera */
  position: relative; /* Necesario para que el z-index funcione */
  z-index: 10;
  border-radius: var(--radius-lg); 
  box-shadow: var(--shadow-main); 
}

.calc-body { padding: 40px; }

.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 10px; color: var(--text-main); }

/* Switch Toggle (Con la corrección de vibración de texto) */
.toggle-group { display: flex; align-items: center; gap: 8px; }
.toggle-label { 
  font-size: 0.85rem; color: var(--text-muted); font-weight: 500; transition: color 0.3s ease; 
  width: 65px; /* Evita que el texto vibre al ponerse en negrita */
  text-align: center;
}
.toggle-label.active { color: var(--primary-color); font-weight: 700; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(20px); }

/* Inputs */
/* --- Nuevo Input Gigante y Contenedor --- */
.premium-input-box {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04); /* Sombra suave de la imagen */
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  align-items: center;
}

.premium-input-box:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(237, 44, 98, 0.1), 0 4px 10px rgba(0, 0, 0, 0.04);
}

.premium-input-box .currency {
  position: absolute;
  left: 20px;
  color: #94a3b8; /* Gris azulado para el símbolo */
  font-weight: 800;
  font-size: 1.5rem;
}

.premium-input-box input {
  width: 100%;
  padding: 20px 20px 20px 60px; /* Espacio para el símbolo S/ */
  border: none; /* El borde ahora lo tiene la caja padre */
  background: transparent;
  font-size: 2.2rem; /* Tamaño gigante */
  font-weight: 800;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
}

.premium-input-box input::placeholder {
  color: #cbd5e1;
  font-weight: 600;
}

/* Ocultar flechas en cualquier input number residual */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* Mantener el estilo original solo para el select de Detracciones */
.premium-select {
  width: 100%; padding: 16px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); font-size: 1.1rem; color: var(--text-main); outline: none; transition: 0.2s; cursor: pointer;
}
.premium-select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 4px rgba(237, 44, 98, 0.1); }
/* Radio Tiles */
.radio-tile-group { display: flex; gap: 10px; }
.radio-tile { flex: 1; position: relative; cursor: pointer; }
.radio-tile input { position: absolute; opacity: 0; }
.tile-label {
  display: block; text-align: center; padding: 12px 10px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); font-size: 1.05rem; font-weight: 700; color: var(--text-muted); transition: 0.2s;
}
.tile-igv input:checked + .tile-label { border-color: #ed2c62; color: #d91f55; background-color: #fff0f5; }
.tile-detraccion input:checked + .tile-label { border-color: #10b981; color: #10b981; background-color: #ecfdf5; }
.tile-retencion input:checked + .tile-label { border-color: #0b527d; color: #06385f; background-color: #edf6fb; }

.info-alert { background-color: #fff0f5; border-left: 4px solid var(--primary-color); padding: 16px; border-radius: var(--radius-sm); font-size: 0.95rem; color: var(--text-muted); margin-bottom: 24px; }
.hidden { display: none !important; }

/* Barra Acciones */
.action-bar { display: flex; gap: 20px; margin-top: 24px; align-items: center; }
.btn-ghost { display: flex; align-items: center; gap: 8px; background: none; border: none; color: var(--text-muted); font-weight: 500; font-size: 1rem; cursor: pointer; padding: 10px 5px; transition: color 0.2s; }
.btn-ghost:hover { color: var(--text-main); }
.btn-copy { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; background-color: var(--primary-color); color: white; border: none; border-radius: 12px; padding: 16px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: 0.2s; }
.btn-copy:hover { background-color: #d91f55; }
.btn-copy:active { transform: scale(0.98); }
.btn-copy.success { background-color: #10b981; }

/* Dashboard de Resultados */
.results-dashboard { margin-top: 24px; padding-top: 24px; border-top: 1px dashed #cbd5e1; }
.results-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-card { padding: 16px; border-radius: 12px; display: flex; flex-direction: column; gap: 6px; transition: all 0.3s ease; }
.result-card.mt-3 { margin-top: 12px; }
.result-card:not(.bg-gray-light):not(.bg-blue-light) { flex-direction: row; justify-content: space-between; align-items: center; }

.card-label { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.card-value { font-size: 1.15rem; font-weight: 800; color: var(--text-main); }
.highlight-neto { font-size: 1.5rem; }

.bg-gray-light { background-color: #f8fafc; border: 1px solid #e2e8f0; }
.bg-blue-light { background-color: #eff6ff; border: 1px solid #bfdbfe; }
.bg-green-light { background-color: #ecfdf5; border: 1px solid #a7f3d0; }
.bg-purple-light { background-color: #fff0f5; border: 1px solid #ffc7d8; }
.border-card { background-color: #ffffff; border: 2px dashed #cbd5e1; }
.bg-primary-solid { background-color: var(--primary-color); box-shadow: 0 4px 14px rgba(237, 44, 98, 0.25); border: none; }

.text-blue { color: #1d4ed8; }
.text-green { color: #047857; }
.text-purple { color: #d91f55; }
.text-dark { color: #0f172a; }
.text-white { color: #ffffff; }

/* Ajuste Responsivo para Móviles */
@media (max-width: 700px) {
  .premium-calculator { margin-top: -80px; width: 90%; }
  .calc-body { padding: 25px; }
  .header-content { padding: 0 20px; }
}
