/* loan-sim.css — Simulador de Préstamos Fissy */
/* Sigue los colores canónicos y el design system de tools.css */

/* ── INPUTS ── */
.lsim-inputs-section { padding: 28px; }

.lsim-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.lsim-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.lsim-input-wrap {
  display: flex;
  align-items: center;
  background: var(--input-bg, rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .2s;
}
.lsim-input-wrap:focus-within {
  border-color: #00C9A7;
  box-shadow: 0 0 0 3px rgba(0,201,167,0.15);
}

.lsim-prefix, .lsim-suffix {
  padding: 0 10px;
  font-size: 0.92rem;
  color: var(--text-muted, #94a3b8);
  background: rgba(255,255,255,0.04);
  user-select: none;
  height: 42px;
  display: flex;
  align-items: center;
}

.lsim-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary, #e2e8f0);
  font-size: 0.97rem;
  padding: 0 12px;
  height: 42px;
  outline: none;
  width: 100%;
  min-width: 0;
}
.lsim-input-no-prefix { padding-left: 14px; }

.lsim-input::-webkit-inner-spin-button,
.lsim-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.lsim-input[type=number] { -moz-appearance: textfield; }

.lsim-select {
  width: 100%;
  height: 42px;
  background: var(--input-bg, rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-primary, #e2e8f0);
  font-size: 0.97rem;
  padding: 0 12px;
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.lsim-select:focus { border-color: #00C9A7; box-shadow: 0 0 0 3px rgba(0,201,167,0.15); }

.lsim-error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.lsim-cta-row {
  display: flex;
  justify-content: flex-start;
}

.lsim-btn-primary {
  background: linear-gradient(135deg, #7030A0 0%, #00c9a7 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.97rem;
  border: none;
  border-radius: 8px;
  padding: 11px 32px;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  letter-spacing: .02em;
  text-decoration: none;
  display: inline-block;
}
.lsim-btn-primary:hover  { opacity: .9; transform: translateY(-1px); }
.lsim-btn-primary:active { transform: translateY(0); }

.lsim-btn-outline {
  background: transparent;
  color: #00C9A7;
  font-weight: 600;
  font-size: 0.94rem;
  border: 1.5px solid #00C9A7;
  border-radius: 8px;
  padding: 10px 24px;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
  display: inline-block;
}
.lsim-btn-outline:hover { background: rgba(0,201,167,0.08); }

/* ── SECTION COMMON ── */
.lsim-section-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  margin: 0 0 6px 0;
}
.lsim-section-note {
  font-size: 0.83rem;
  color: var(--text-muted, #94a3b8);
  margin: 0 0 22px 0;
}

/* ── CARDS ── */
.lsim-cards-section { padding: 28px; }

.lsim-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 640px) {
  .lsim-cards-grid { grid-template-columns: 1fr; }
}

.lsim-card {
  background: var(--card-bg, rgba(255,255,255,0.04));
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.lsim-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}
.lsim-card-selected {
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(0,201,167,0.2);
}

.lsim-card-header {
  padding: 14px 16px 12px;
}
.lsim-card-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 8px;
}
.lsim-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
}

.lsim-card-body {
  padding: 14px 16px;
  flex: 1;
}
.lsim-card-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.lsim-card-row:last-child { border-bottom: none; }
.lsim-card-lbl {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
}
.lsim-card-val {
  font-size: 0.95rem;
  color: var(--text-primary, #e2e8f0);
  text-align: right;
}
.lsim-card-val small { font-size: 0.78rem; color: var(--text-muted, #94a3b8); }
.lsim-zero    { color: #94a3b8; font-weight: 600; }
.lsim-variable { font-weight: 700; }
.lsim-range   { color: #94a3b8; font-size: 0.78rem; }
.lsim-int     { font-weight: 600; }
.lsim-total strong { font-size: 1rem; }

.lsim-card-desc {
  padding: 10px 16px;
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.4;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.lsim-select-btn {
  margin: 12px 16px 14px;
  width: calc(100% - 32px);
  padding: 9px 0;
  border-radius: 7px;
  border: 1.5px solid;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.lsim-select-btn-active {
  color: #fff !important;
}

/* ── TABLA ── */
.lsim-schedule-section { padding: 28px; }

.lsim-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}

.lsim-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.lsim-table thead tr {
  background: rgba(255,255,255,0.05);
}
.lsim-table th {
  text-align: right;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  font-size: 0.78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.lsim-table th:first-child { text-align: center; }
.lsim-table td {
  padding: 9px 14px;
  text-align: right;
  color: var(--text-primary, #e2e8f0);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.lsim-table td:first-child {
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
}
.lsim-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.lsim-table tbody tr:last-child td { border-bottom: none; }
.lsim-td-int  { color: #F59E0B !important; }
.lsim-td-cap  { color: #7C3AED !important; }
.lsim-td-pmt strong { font-weight: 700; }

/* ── PUBLICAR ── */
.lsim-publish-section { padding: 28px; }

.lsim-publish-desc {
  color: var(--text-muted, #94a3b8);
  font-size: 0.9rem;
  margin: 0 0 20px 0;
}

.lsim-login-required {
  background: rgba(91,33,182,0.1);
  border: 1px solid rgba(91,33,182,0.25);
  border-radius: 10px;
  padding: 20px 22px;
}
.lsim-login-required p {
  color: var(--text-primary, #e2e8f0);
  margin: 0 0 14px 0;
  font-size: 0.93rem;
}
.lsim-login-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.lsim-publish-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 520px;
}
.lsim-purpose-group { max-width: 100%; }
.lsim-purpose-input {
  width: 100%;
  border-radius: 8px;
  background: var(--input-bg, rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-primary, #e2e8f0);
  font-size: 0.95rem;
  padding: 10px 14px;
  height: 42px;
  outline: none;
  transition: border-color .2s;
}
.lsim-purpose-input:focus {
  border-color: #00C9A7;
  box-shadow: 0 0 0 3px rgba(0,201,167,0.15);
}

.lsim-btn-publish {
  background: linear-gradient(135deg, #7030A0 0%, #9b59b6 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.97rem;
  border: none;
  border-radius: 8px;
  padding: 12px 36px;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  align-self: flex-start;
}
.lsim-btn-publish:hover   { opacity: .9; transform: translateY(-1px); }
.lsim-btn-publish:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.lsim-publish-success {
  background: rgba(0,201,167,0.12);
  border: 1px solid rgba(0,201,167,0.3);
  color: #00C9A7;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.93rem;
  font-weight: 600;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .lsim-inputs-section,
  .lsim-cards-section,
  .lsim-schedule-section,
  .lsim-publish-section { padding: 18px; }
  .lsim-inputs-grid { grid-template-columns: 1fr; }
}
