/* === SRI HELPER v2 === */

#sri-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  max-width: 1024px;
  margin: 0 auto;
  padding: 2rem 1rem;
  color: #1a1a2e;
}

/* --- FORMULARIO --- */
.sri-form {
  background: #3b82f6;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.sri-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .sri-form-grid {
    grid-template-columns: 1fr;
  }
}

.sri-label {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.sri-date-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1.3fr;
  gap: 0.5rem;
}

.sri-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
  color: #1a1a2e;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.sri-input:focus {
  outline: 3px solid #93c5fd;
  outline-offset: 1px;
}

select.sri-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.2em;
  padding-right: 2rem;
}

.sri-input-unit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sri-input-unit .sri-input {
  flex: 1;
}

.sri-unit {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* --- TIMELINE --- */
.sri-timeline {
  margin-bottom: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sri-timeline-ages {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 4px;
  min-width: 500px;
}

.sri-timeline-rows {
  position: relative;
  min-width: 500px;
}

.sri-trow {
  position: relative;
  height: 36px;
  margin-bottom: 6px;
}

.sri-tseg {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.3s, opacity 0.3s;
  background: #e5e7eb;
  color: #9ca3af;
  opacity: 0.5;
}

.sri-tseg.active {
  background: #3b82f6;
  color: #fff;
  opacity: 1;
}



/* --- CARDS --- */
.sri-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .sri-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .sri-cards {
    grid-template-columns: 1fr;
  }
}

.sri-card {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s, opacity 0.3s;
  opacity: 0.45;
  filter: grayscale(1);
}

.sri-card.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
  opacity: 1;
  filter: grayscale(0);
}

.sri-card-icon {
  width: 80%;
  max-width: 120px;
  height: auto;
  margin-bottom: 1rem;
  display: block;
}

.sri-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 0.75rem;
}

.sri-card-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0 0 1rem;
  text-align: left;
  width: 100%;
}

.sri-card-specs dt {
  color: #9ca3af;
}

.sri-card-body {
  flex: 1;
  width: 100%;
}

.sri-btn {
  width: 100%;
  padding: 0.6rem 0;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  background: #e5e7eb;
  color: #9ca3af;
  margin-top: auto;
}

.sri-card.active .sri-btn {
  background: #3b82f6;
  color: #fff;
}

.sri-card.active .sri-btn:hover {
  background: #2563eb;
}

.sri-card.active .sri-btn:active {
  transform: scale(0.97);
}

/* --- PANEL INLINE --- */
.sri-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, margin-top 0.3s ease;
}

.sri-panel.open {
  max-height: 1400px;
  margin-top: 1rem;
}

.sri-panel-inner {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.sri-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.sri-panel-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
}

.sri-panel-close {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.8rem;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.2s;
}

.sri-panel-close:hover {
  background: #f3f4f6;
}

.sri-panel-iframe {
  width: 100%;
  min-height: 600px;
  border: none;
  display: block;
}

@media (max-width: 640px) {
  .sri-panel-iframe {
    min-height: 400px;
  }
}

.sri-panel-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
  color: #6b7280;
}

.sri-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: sri-spin 0.8s linear infinite;
}

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