@import url('https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600,700&display=swap');

:root {
  --cream: #F4F3F0;
  --ink: #1a1a18;
  --orange: #E8500A;
  --border: #ddd9d1;
  --muted: #6b6a64;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'General Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px;
}

.grid-phi {
  display: grid;
  grid-template-columns: 8fr 13fr;
  gap: 32px;
}

@media (max-width: 720px) {
  .grid-phi { grid-template-columns: 1fr; }
}

h1, h2, h3 { font-weight: 600; margin: 0 0 8px; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
p { color: var(--muted); margin: 0 0 16px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  margin-top: 14px;
}

input, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background: var(--cream);
}

textarea { resize: vertical; min-height: 60px; }

button, .btn {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  background: var(--ink);
  color: var(--cream);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

button.accent { background: var(--orange); color: #fff; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--border); }
button:hover { opacity: 0.88; }

.error { color: var(--orange); font-size: 13px; margin-top: 10px; }

.list-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-item .meta { font-size: 13px; color: var(--muted); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ---------- pantalla de acceso ---------- */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell {
  width: 100%;
  max-width: 460px;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px 36px 32px;
  box-shadow: 0 1px 2px rgba(26, 26, 24, 0.04), 0 8px 24px rgba(26, 26, 24, 0.06);
}

.auth-title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.auth-sub {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 28px;
}

.provider-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.provider-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 13px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.provider-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.provider-btn:hover {
  opacity: 1;
  border-color: #b9b4a9;
  box-shadow: 0 1px 3px rgba(26, 26, 24, 0.08);
}

.provider-btn:active {
  transform: translateY(1px);
}

.provider-btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* ---------- mapa (perfil inicial) ---------- */

#mapContainer {
  width: 100%;
  height: 220px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

#mapContainer .mapboxgl-ctrl-attrib {
  font-size: 9px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 20px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.auth-card label {
  margin-top: 0;
  margin-bottom: 6px;
}

.auth-card input {
  background: #fff;
  padding: 12px;
}

.auth-card input:focus {
  outline: 2px solid var(--orange);
  outline-offset: -1px;
  border-color: transparent;
}

.auth-card form > input + .label-row,
.auth-card form > input + label {
  margin-top: 16px;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 16px;
  margin-bottom: 6px;
}

.label-row label { margin: 0; }

.link-btn {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-btn:hover { color: var(--ink); opacity: 1; }

.btn-primary {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: 9px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-primary:disabled { opacity: 0.55; cursor: default; }

.btn-secondary {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.btn-secondary:hover { border-color: #b9b4a9; opacity: 1; }

.auth-msg {
  font-size: 13px;
  line-height: 1.5;
  margin-top: 14px;
  min-height: 0;
}

.auth-msg.error { color: var(--orange); }

.auth-msg.ok {
  color: #2f6d3f;
  background: #f0f6f1;
  border: 1px solid #d3e5d7;
  border-radius: 8px;
  padding: 10px 12px;
}

.auth-switch {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: 20px 0 0;
}

.auth-legal {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  margin: 24px 0 0;
}

.auth-foot {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  margin: 20px 0 0;
}

@media (max-width: 420px) {
  .auth-card { padding: 32px 24px 26px; }
  .provider-row { grid-template-columns: 1fr; }
  .provider-btn { justify-content: flex-start; padding-left: 18px; }
}
