/* =========================================================
   Estilos generales del ejercicio
   ========================================================= */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #182230;
  --muted: #637083;
  --primary: #155eef;
  --primary-dark: #0f49b5;
  --secondary: #e8eefc;
  --border: #d7dfec;
  --success: #067647;
  --danger: #b42318;
  --warning: #b54708;
  --shadow: 0 14px 35px rgba(16, 24, 40, 0.10);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #edf4ff 0%, var(--bg) 42%, #ffffff 100%);
  min-height: 100vh;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 56px 0 36px;
  background: radial-gradient(circle at top left, rgba(21, 94, 239, 0.18), transparent 38%), #101828;
  color: white;
}

.site-header.compact {
  padding: 32px 0 28px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  opacity: 0.8;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  margin-bottom: 12px;
}

h2 {
  font-size: 1.35rem;
  margin-bottom: 12px;
}

.lead {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.08rem;
  line-height: 1.6;
}

.main-grid,
.two-columns {
  display: grid;
  gap: 24px;
  padding: 36px 0;
}

.main-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.two-columns {
  grid-template-columns: minmax(320px, 0.85fr) minmax(320px, 1.15fr);
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.feature-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feature-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--secondary);
  font-size: 1.8rem;
  margin-bottom: 18px;
}

.muted,
.note {
  color: var(--muted);
  line-height: 1.55;
}

.note {
  font-size: 0.92rem;
  margin-top: 18px;
}

.back-link,
.map-link {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.88);
}

.tag {
  display: inline-block;
  vertical-align: middle;
  margin-left: 12px;
  padding: 4px 14px;
  font-size: 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 700;
}

.swap-link {
  display: inline-block;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  text-decoration: underline;
}

.swap-link:hover,
.swap-link:focus-visible {
  color: #fff;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  min-height: 44px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.button:hover,
.button:focus-visible {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.button-secondary {
  background: #e4e7ec;
  color: #344054;
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: #cfd6e1;
}

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #344054;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 1rem;
  color: var(--text);
}

input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(21, 94, 239, 0.16);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.status-message {
  min-height: 24px;
  margin-top: 18px;
  font-weight: 700;
}

.status-message.is-success {
  color: var(--success);
}

.status-message.is-error {
  color: var(--danger);
}

.status-message.is-warning {
  color: var(--warning);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef4ff;
  color: #1849a9;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.history-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.history-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fbfdff;
}

.history-item strong {
  display: block;
  margin-bottom: 4px;
}

.history-item small {
  color: var(--muted);
}

.coordinates-panel {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
}

.coordinates-panel div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
}

.coordinates-panel dt {
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
}

.coordinates-panel dd {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.map-card {
  min-height: 520px;
}

.mapa {
  width: 100%;
  height: 460px;
  border: 0;
  border-radius: 16px;
  background: #e4e7ec;
}

.map-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--primary);
}

.site-footer {
  padding: 20px 0 34px;
  color: var(--muted);
}

@media (max-width: 800px) {
  .main-grid,
  .two-columns {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding-top: 40px;
  }

  .map-card {
    min-height: auto;
  }

  .mapa {
    height: 360px;
  }
}
