/* Base and layout */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg,#081427 0%, #0a192f 100%);
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: #f4f4f4;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Container is full-height card with clean divisions */
.container {
  background-color: #0f263f;
  width: 96%;
  max-width: 920px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
  gap: 14px;
  padding: 20px;
  box-sizing: border-box;
}

/* Top header */
.top { text-align: center; padding-top: 6px; }
.top h1 { margin: 0; color: #ff8c00; font-size: 1.4rem; text-shadow: 0 1px 0 rgba(0,0,0,0.4); }
.top h2 { margin: 6px 0 0 0; color: #e6eef8; font-weight: 600; font-size: 0.95rem; }

/* Main content area grows and scrolls if needed */
.main-area {
  padding: 8px 4px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Inputs row */
.input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.input-group {
  flex: 1 1 30%;
  min-width: 140px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: #dbeefe;
  font-size: 0.9rem;
}

input[type="number"] {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(100,181,246,0.12);
  border-radius: 8px;
  box-sizing: border-box;
  background-color: #102b58;
  color: #fff;
  font-size: 0.95rem;
}

input[type="number"]:focus {
  border-color: #ffb36b;
  outline: none;
  box-shadow: 0 6px 18px rgba(255,140,0,0.06);
}

/* Buttons */
.buttons-row {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 6px 0 0 0;
}

button, .link-back {
  background-color: #ff8c00;
  color: #071124;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.08s ease, box-shadow 0.12s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

button:hover, .link-back:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(230,119,0,0.12); }
.link-back { background: transparent; color: #ffb36b; border: 1px solid rgba(255,140,0,0.10); padding: 9px 12px; }

/* Bottom area sticks to bottom of container */
.bottom-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 12px;
  align-items: start;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* Results card */
.resultados {
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(180deg,#0d2a56 0%, #0b2347 100%);
  border: 1px solid rgba(66,165,245,0.08);
  color: #eaf6ff;
  box-shadow: 0 6px 18px rgba(2,8,23,0.6);
}

.resultados h2 { margin-top: 0; color: #ffb36b; font-size: 1rem; margin-bottom: 8px; }
.resultados p { margin: 6px 0; color: #dbeefe; font-size: 0.95rem; }

/* Lista de estancias (right column) */
.lista-estancias {
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,140,0,0.03), rgba(0,0,0,0.02));
  border: 1px solid rgba(66,165,245,0.06);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lista-estancias h2 { color: #ffb36b; margin: 6px 0 12px; font-size: 0.98rem; text-align: left; }
#estancias { display: grid; gap: 8px; max-height: 260px; overflow:auto; padding-right:6px; }

/* Card style */
.estancia-card {
  background: linear-gradient(180deg,#0e2a53,#0b2548);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,140,0,0.06);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header strong { color: #ffd6b3; font-weight:700; }
.remove-btn {
  background: transparent;
  border: none;
  color: #ffd6b3;
  font-size: 16px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}
.remove-btn:hover { background: rgba(255,140,0,0.06); }

/* List controls */
.lista-controls {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Footer (inside container) */
.footer {
  margin-top: 6px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,140,0,0.06);
  display:flex;
  justify-content:center;
  gap:12px;
  align-items:center;
  color:#fff;
  font-size:13px;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(255,140,0,0.02));
  border-radius: 8px;
  flex-shrink: 0;
}

.footer a {
  color: #ffb56a;
  text-decoration: none;
  font-weight: 700;
}

.footer a:hover { text-decoration: underline; }

/* Responsive adjustments */
@media (max-width: 880px) {
  .bottom-area { grid-template-columns: 1fr; }
  .container { height: auto; max-height: 100vh; padding-bottom: 14px; }
}

@media (max-width: 520px) {
  .input-row { gap: 8px; }
  .input-group { flex: 1 1 100%; }
  .buttons-row { gap: 8px; }
  .link-back { margin-left: 0; width: 100%; text-align:center; }
}