:root {
  color-scheme: dark;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --bg: radial-gradient(circle at top, #4d62ff 0%, #1c1c3a 45%, #0b0b18 100%);
  --fg: #f5f6ff;
  --muted: #a0a5c2;
  --panel: rgba(17, 18, 41, 0.78);
  --stroke: rgba(255, 255, 255, 0.08);
  --accent: #9c6bff;
  --accent-strong: #c084fc;
  --danger: #ff6b6b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-image: var(--bg);
  background-attachment: fixed;
  color: var(--fg);
  display: flex;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.layout {
  width: min(1200px, 100%);
  display: grid;
  gap: 1.5rem;
}

.hero {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.25));
  border: 1px solid var(--stroke);
  box-shadow: 0 20px 60px rgba(6, 6, 33, 0.45);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.75rem;
  color: var(--accent-strong);
  margin-bottom: 0.6rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.hero__intro {
  margin-top: 1rem;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.6;
}

.panel {
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid var(--stroke);
  box-shadow: 0 20px 60px rgba(6, 6, 33, 0.45);
  padding: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel-form {
  order: 1;
}

.panel-listado {
  order: 2;
}

.panel-analizador {
  order: 3;
}

.panel__header h2 {
  margin: 0;
}

.panel__header p {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.panel__scroll {
  max-height: 260px;
  overflow: auto;
  padding-right: 0.5rem;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#listaRocas li {
  list-style: none;
}

.roca-card {
  padding: 1.1rem 1.2rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.25));
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.roca-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.3);
}

.roca-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.roca-card__id {
  font-weight: 700;
  color: var(--fg);
}

.roca-card__grupo {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
}

.roca-card__nombre {
  margin: 0;
  font-size: 1.35rem;
}

.roca-card__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
  margin: 0;
}

.roca-card__stats div {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.roca-card__stats dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.roca-card__stats dd {
  margin: 0;
  font-weight: 600;
}

.roca-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.roca-card__chips span {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(156, 107, 255, 0.16);
  border: 1px solid rgba(156, 107, 255, 0.4);
  font-size: 0.85rem;
}

.roca-card__validation {
  margin-top: 0.4rem;
  padding-top: 0.8rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.18);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.roca-card__temp {
  margin: 0;
  font-weight: 500;
  color: var(--fg);
}

.roca-card__status {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
}

.roca-card__status {
  /* estilos base previos */
  margin: 0;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  /* Mantener el borde del mismo color que el fondo cuando está validada o invalidada */
  border: 1px solid transparent;
  transition: background 0.2s, border 0.2s, color 0.2s;
}

/* Solo la "franja" de status cuando es validada */
.roca-card--validada .roca-card__status {
  color: #fff;
  background: rgba(5, 205, 22, 0.864);
  border: 1px solid rgba(125, 213, 11, 0.4);
  box-shadow: 0 2px 8px rgba(10, 189, 143, 0.18);
}

/* Solo la "franja" de status cuando es invalidada */
.roca-card--invalidada .roca-card__status {
  color: #fff;
  background: rgba(227, 13, 24, 0.801);
  border: 1px solid rgba(135, 44, 11, 0.4);
  box-shadow: 0 2px 8px rgba(189, 10, 31, 0.15);
}

#formulario {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem 1.5rem;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
}

.campo label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  transition: opacity 0.2s ease;
}

.campo input,
.campo select {
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.07);
  color: var(--fg);
  transition: border 0.2s ease, background 0.2s ease;
  font-family: inherit;
}

.campo input:focus,
.campo select:focus {
  outline: none;
  border-color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.14);
}

.campo select:invalid {
  color: var(--muted);
}

@media (max-width: 640px) {
  #formulario {
    grid-template-columns: 1fr;
  }
  .campo label {
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
  }
  .campo input::placeholder,
  .campo select:invalid {
    color: rgba(255, 255, 255, 0.6);
    opacity: 1 !important;
  }
}

@media (min-width: 641px) {
  .campo input::placeholder {
    color: transparent;
  }
  select:invalid {
    color: rgba(255, 255, 255, 0.6);
  }
}

button,
.analizador__form input {
  font-family: inherit;
}

button[type="submit"],
#botonAnalizador {
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--fg);
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  box-shadow: 0 15px 35px rgba(156, 107, 255, 0.35);
}

button[type="submit"]:hover,
#botonAnalizador:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.analizador__form {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.analizador__form input {
  flex: 1;
  min-width: 220px;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.07);
  color: var(--fg);
}

.analizador__form input:focus {
  outline: none;
  border-color: var(--accent);
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel-form {
    grid-column: span 2;
  }
  .panel-listado,
  .panel-analizador {
    grid-column: span 1;
  }
}

@media (max-width: 480px) {
  body {
    padding: 1rem;
  }
  .panel,
  .hero {
    border-radius: 16px;
  }
}

