/* Hydra customer portal — single-file CSS, no framework. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: #191919;
  color: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #FE9522; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ─────────────────────────────────────────────────── */
header {
  background: rgba(20,20,20,0.95);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2a2a2a;
}
header .brand {
  display: flex; align-items: center; gap: 12px;
}
header .brand img { height: 40px; }
header .brand-name {
  color: #FE9522;
  font-weight: bold;
  letter-spacing: 1px;
  font-size: 14px;
}
header .user {
  display: flex; align-items: center; gap: 16px;
  font-size: 13px; color: #ccc;
}
header .user .email { color: #fff; }
header .user button {
  background: transparent;
  border: 1px solid #555;
  color: #ccc;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
header .user button:hover {
  border-color: #FE9522;
  color: #FE9522;
}

.lang-selector {
  display: flex;
  gap: 2px;
  margin-right: 8px;
}
.lang-selector button {
  background: transparent;
  border: 1px solid transparent;
  color: #888;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}
.lang-selector button:hover {
  color: #fff;
}
.lang-selector button.active {
  background: #FE9522;
  color: #1a1a1a;
  border-color: #FE9522;
  font-weight: 700;
}

/* ── Generic layout ─────────────────────────────────────────── */
main {
  flex: 1;
  padding: 40px 32px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

h1 {
  color: #FE9522;
  font-size: 22px;
  margin: 0 0 28px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
h2 { color: #FE9522; font-size: 18px; margin: 0 0 16px; }

.loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid #2a2a2a;
  border-top-color: #FE9522;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Auth screens ───────────────────────────────────────────── */
.auth-screen {
  max-width: 400px;
  margin: 80px auto;
  background: #232323;
  padding: 32px;
  border-radius: 8px;
  border: 1px solid #2f2f2f;
}
.auth-screen p { color: #bbb; line-height: 1.5; margin: 0 0 20px; font-size: 14px; }
.auth-screen label { display: block; color: #ccc; font-size: 13px; margin-bottom: 6px; }
.auth-screen input[type=email],
.auth-screen input[type=text] {
  width: 100%;
  padding: 11px 14px;
  background: #1a1a1a;
  border: 1px solid #444;
  color: #fff;
  border-radius: 4px;
  font-size: 15px;
  outline: none;
  margin-bottom: 18px;
}
.auth-screen input:focus { border-color: #FE9522; }
.auth-screen input.code {
  letter-spacing: 8px;
  font-size: 20px;
  text-align: center;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.auth-screen button.primary {
  width: 100%;
  padding: 12px;
  background: #FE9522;
  color: #1a1a1a;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}
.auth-screen button.primary:hover { background: #e6841a; }
.auth-screen button.primary:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-screen button.secondary {
  background: transparent;
  border: 1px solid #555;
  color: #ccc;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 12px;
}
.auth-screen .error {
  background: rgba(255, 60, 60, 0.12);
  border: 1px solid rgba(255, 60, 60, 0.4);
  color: #ff8585;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 16px;
}
.auth-screen .info {
  color: #aaa;
  font-size: 12px;
  margin-top: 14px;
  text-align: center;
}
.auth-screen .session-note {
  color: #777;
  font-size: 11px;
  margin-top: 12px;
  text-align: center;
}

/* ── Grid de municipios ─────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 22px;
  background: #1f1f1f;
  border: 1px solid #2f2f2f;
  border-radius: 10px;
  color: #f0f0f0;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
  min-height: 190px;
  position: relative;
}
.grid a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  pointer-events: none;
  transition: box-shadow 0.18s ease;
}
.grid a:hover {
  background: #242424;
  border-color: #FE9522;
  transform: translateY(-6px);
  text-decoration: none;
}
.grid a:hover::after {
  box-shadow: 0 12px 32px rgba(254, 149, 34, 0.28);
}
.grid a img {
  height: 95px;
  width: auto;
  max-width: 95px;
  margin-bottom: 16px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.grid a:hover img {
  transform: scale(1.18) translateY(-2px);
}
.grid a .label {
  font-size: 14px;
  letter-spacing: 0.3px;
  color: #e8e8e8;
}
.grid a:hover .label {
  color: #FE9522;
}

footer {
  padding: 18px 32px;
  text-align: center;
  color: #777;
  font-size: 12px;
  border-top: 1px solid #2a2a2a;
}
footer a { color: #999; }

@media (max-width: 600px) {
  header { padding: 12px 16px; flex-direction: column; gap: 10px; }
  main { padding: 20px 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .grid a { min-height: 110px; padding: 14px 8px; }
  .grid a img { height: 44px; }
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: modalFadeIn 0.15s ease-out;
}
.modal {
  background: #232323;
  border: 1px solid #FE9522;
  border-radius: 6px;
  padding: 28px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: modalSlideUp 0.2s ease-out;
}
.modal h2 {
  color: #FE9522;
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: bold;
}
.modal p {
  color: #ccc;
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.5;
}
.modal button.primary {
  background: #FE9522;
  color: #1a1a1a;
  border: none;
  padding: 10px 22px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  float: right;
  min-width: 100px;
}
.modal button.primary:hover { background: #e6841a; }

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}


/* Administración link in the header */
.admin-link { color:#FE9522; text-decoration:none; font-size:13px; padding:6px 12px; border:1px solid #FE9522; border-radius:4px; margin-right:8px; }
.admin-link:hover { background:#FE9522; color:#fff; }
