:root {
  --green: #1b5e20;
  --green-dark: #123c15;
  --red: #b3261e;
  --amber-bg: #fff3cd;
  --amber-text: #7a5b00;
  --text: #1a1a1a;
  --bg: #ffffff;
  --border: #cfcfcf;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.4;
}

h1 {
  font-size: 1.8rem;
  margin: 0.2em 0;
}

header {
  text-align: center;
  padding: 1rem;
}

header .type {
  color: #555;
  margin: 0;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1rem 1.5rem;
}

section {
  padding: 1rem 0;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

input {
  width: 100%;
  font-size: 16px; /* nunca menos de 16px: por debajo, iOS/Android hacen zoom al enfocar */
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
  background: var(--bg);
  color: var(--text);
}

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  font-family: inherit;
}

.big {
  min-height: 64px;
  font-size: 1.25rem;
  width: 100%;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.big:active {
  background: var(--green-dark);
}

.drop {
  min-height: 45vh;
  font-size: 2rem;
  background: var(--green);
  color: #fff;
  width: 100%;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.drop:active {
  background: var(--green-dark);
}

button:disabled,
input:disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.link {
  background: none;
  color: #444;
  text-decoration: underline;
  width: 100%;
  min-height: 44px;
  font-size: 1rem;
}

.hint {
  color: #555;
  font-size: 0.95rem;
  text-align: center;
}

.error {
  color: var(--red);
  font-weight: 700;
  font-size: 1.1rem;
}

.pending {
  background: var(--amber-bg);
  color: var(--amber-text);
  font-weight: 600;
  padding: 0.6rem;
  border-radius: 8px;
  text-align: center;
}

#manual-map {
  height: 50vh;
  width: 100%;
  border-radius: 8px;
  border: 2px solid var(--border);
  margin: 0.75rem 0;
}

.ok {
  font-size: 5rem;
  color: var(--green);
  text-align: center;
  line-height: 1;
}

#step-done {
  text-align: center;
}

.unknown {
  max-width: 480px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #666;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

footer .who a {
  color: var(--green);
  margin-left: 0.3rem;
}

/* Login (Task 3) */
body.login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f2f2f2;
}

body.login main {
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  padding: 2rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
}

body.login h1 {
  margin-top: 0;
}

body.login button[type="submit"] {
  min-height: 64px;
  font-size: 1.25rem;
  width: 100%;
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

body.login button[type="submit"]:active {
  background: var(--green-dark);
}

/* Mapa d'oficina (Task 8) */
body.map-page {
  margin: 0;
  overflow: hidden;
}

.map-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.map-header h1 {
  font-size: 1.1rem;
  margin: 0;
  white-space: nowrap;
}

.map-header #q {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  padding: 0.4rem 0.6rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.map-header #count {
  white-space: nowrap;
  color: #555;
  font-size: 0.9rem;
}

.map-header nav {
  display: flex;
  gap: 0.75rem;
  white-space: nowrap;
}

.map-header nav a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}

#map {
  height: calc(100vh - 56px);
  width: 100%;
}

.pin {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.pin .dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
}

.pin .label {
  background: rgba(255, 255, 255, 0.9);
  padding: 0 0.3rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

#empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #555;
  font-size: 1.1rem;
  max-width: 320px;
}
