/* ==========================================================================
   Control de desbroces
   Interfaz de campo: contraste alto, texto grande, botones que se aciertan
   con guantes. Móvil primero.
   ========================================================================== */

:root {
    --verde: #77a632;
    --verde-osc: #31421a;
    --verde-medio: #4c6b25;
    --verde-claro: #eef4e3;
    --vis: #ffd21e;
    --vis-osc: #4a3c00;
    --naranja: #e2661f;
    --rojo: #c0392b;
    --carbon: #1d2416;
    --gris: #6f7864;
    --fondo: #f3f5ef;
    --papel: #ffffff;
    --borde: #dbe1d2;
    --radio: 14px;
    --sombra: 0 1px 2px rgba(29, 36, 22, .08), 0 8px 20px -14px rgba(29, 36, 22, .5);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--fondo);
    color: var(--carbon);
    font: 400 17px/1.5 Barlow, system-ui, -apple-system, "Segoe UI", sans-serif;
    padding-bottom: 92px;
}

h1, h2, h3, .condensada {
    font-family: "Barlow Condensed", Barlow, system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: .01em;
    margin: 0 0 .4em;
    line-height: 1.15;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.2rem; }

a { color: var(--verde-medio); }

.eyebrow {
    font-family: "Barlow Condensed", sans-serif;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .8rem;
    font-weight: 600;
    color: var(--gris);
}

/* ---------------------------------------------------------------- cabecera */

.barra {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--verde-osc);
    border-bottom: 4px solid var(--vis);
    color: #fff;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.marca {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.marca-icono {
    width: 14px;
    height: 24px;
    background: var(--vis);
    clip-path: polygon(50% 0, 100% 45%, 62% 45%, 62% 100%, 38% 100%, 38% 45%, 0 45%);
}

.barra .menu { display: none; margin-left: auto; gap: 4px; }

.barra .menu a {
    color: #dfe8d2;
    text-decoration: none;
    padding: 9px 13px;
    border-radius: 8px;
    font-weight: 500;
}

.barra .menu a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.barra .menu a.activo { background: var(--verde); color: #fff; }

.sesion { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.quien {
    display: none;
    color: #fff;
    text-decoration: none;
    line-height: 1.1;
    text-align: right;
}

.quien small { display: block; color: #b9c9a4; font-size: .75rem; }

.salir {
    color: #17200c;
    background: var(--vis);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: .95rem;
}

/* --------------------------------------------------------------- contenedor */

.contenedor { max-width: 1080px; margin: 0 auto; padding: 18px 14px 30px; }

.cabecera-pagina {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cabecera-pagina h1 { margin: 0; }

/* -------------------------------------------------------------------- avisos */

.aviso {
    padding: 14px 16px;
    border-radius: var(--radio);
    margin-bottom: 14px;
    font-weight: 500;
    border-left: 8px solid var(--verde);
    background: var(--verde-claro);
}

.aviso-error { border-color: var(--rojo); background: #fdecea; }
.aviso-info { border-color: #4a7ba7; background: #eaf2f9; }

/* ------------------------------------------------------------------ tarjetas */

.tarjeta {
    background: var(--papel);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--sombra);
}

.tarjeta > h2:first-child, .tarjeta > h3:first-child { margin-top: 0; }

.rejilla { display: grid; gap: 14px; grid-template-columns: 1fr; }

@media (min-width: 720px) {
    .rejilla-2 { grid-template-columns: 1fr 1fr; }
    .rejilla-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Ficha de finca / tarea con franja de color a la izquierda */
.ficha {
    display: block;
    position: relative;
    background: var(--papel);
    border: 1px solid var(--borde);
    border-left: 10px solid var(--franja, var(--verde));
    border-radius: var(--radio);
    padding: 14px 14px 14px 16px;
    margin-bottom: 12px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--sombra);
}

a.ficha:hover { border-color: var(--verde); border-left-color: var(--franja, var(--verde)); }

.ficha-cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ficha-titulo { font-family: "Barlow Condensed", sans-serif; font-size: 1.3rem; font-weight: 700; line-height: 1.1; }
.ficha-dato { color: var(--gris); font-size: .95rem; }
.ficha-pie { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }

.orden-num {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gris);
    min-width: 1.6em;
}

/* ------------------------------------------------------------------ etiquetas */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    background: var(--verde-claro);
    color: var(--verde-osc);
    white-space: nowrap;
}

.badge-vis { background: var(--vis); color: var(--vis-osc); }
.badge-aviso { background: #fbe3d5; color: #8a3b0d; }
.badge-rojo { background: #fbe0dd; color: #8f2a1f; }
.badge-gris { background: #eceee8; color: var(--gris); }
.badge-zona { background: var(--zona, var(--verde)); color: #fff; }

.estrellas { letter-spacing: 1px; white-space: nowrap; }
.estrellas .on { color: var(--naranja); }
.estrellas .off { color: #d7dbd0; }

/* ------------------------------------------------------------------- botones */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 12px 20px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: var(--verde);
    color: #fff;
    font: 600 1.02rem/1.1 Barlow, system-ui, sans-serif;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover { background: var(--verde-medio); }
.btn:active { transform: translateY(1px); }

.btn-vis { background: var(--vis); color: var(--vis-osc); }
.btn-vis:hover { background: #f0c30d; }

.btn-borde { background: var(--papel); color: var(--verde-osc); border-color: var(--borde); }
.btn-borde:hover { background: var(--verde-claro); border-color: var(--verde); }

.btn-peligro { background: var(--papel); color: var(--rojo); border-color: #f0cfcb; }
.btn-peligro:hover { background: #fdecea; }

.btn-gigante {
    width: 100%;
    min-height: 76px;
    font-size: 1.3rem;
    font-family: "Barlow Condensed", sans-serif;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
}

.btn-pequeno { min-height: 40px; padding: 6px 12px; font-size: .92rem; border-radius: 9px; }

.botonera { display: flex; flex-wrap: wrap; gap: 10px; }
.botonera-fin { justify-content: flex-end; }

/* ------------------------------------------------------------------ formulario */

.campo { margin-bottom: 16px; }

.campo > label, .etiqueta {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: .98rem;
}

.campo .pista { display: block; color: var(--gris); font-size: .88rem; font-weight: 400; margin-top: 2px; }

input[type=text], input[type=password], input[type=search], input[type=number],
input[type=date], input[type=datetime-local], input[type=tel], select, textarea {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 2px solid var(--borde);
    border-radius: 12px;
    background: var(--papel);
    font: 400 17px/1.4 Barlow, system-ui, sans-serif;
    color: var(--carbon);
}

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

input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
    outline: 3px solid var(--verde);
    outline-offset: 2px;
    border-color: var(--verde);
}

.fila { display: flex; gap: 12px; flex-wrap: wrap; }
.fila > * { flex: 1 1 200px; }

/* Selector de importancia con estrellas grandes */
.selector-estrellas { display: flex; gap: 6px; }

.selector-estrellas input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.selector-estrellas label {
    font-size: 2.2rem;
    line-height: 1;
    color: #d7dbd0;
    cursor: pointer;
    padding: 4px 2px;
    user-select: none;
}

.selector-estrellas label.marcada { color: var(--naranja); }
.selector-estrellas input:focus-visible + label { outline: 3px solid var(--verde); }

/* Botón de subir fotos, grande y evidente */
.subir-foto {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 104px;
    border: 3px dashed var(--borde);
    border-radius: var(--radio);
    background: var(--papel);
    color: var(--verde-osc);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    padding: 12px;
}

.subir-foto:hover { border-color: var(--verde); background: var(--verde-claro); }
.subir-foto .icono { font-size: 2rem; line-height: 1; }
.subir-foto input[type=file] { display: none; }

.previsualizacion { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.previsualizacion img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--borde); }

.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.galeria img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--borde); display: block; }

/* ---------------------------------------------------------------- elegir finca */

.opcion-finca {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: var(--papel);
    border: 2px solid var(--borde);
    border-radius: var(--radio);
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.opcion-finca:hover { border-color: var(--verde); }
.opcion-finca.elegida { border-color: var(--verde); background: var(--verde-claro); box-shadow: inset 0 0 0 1px var(--verde); }
.opcion-finca .nombre { font-family: "Barlow Condensed", sans-serif; font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.opcion-finca .detalle { color: var(--gris); font-size: .92rem; }
.opcion-finca .distancia { margin-left: auto; text-align: right; }

.paso { display: none; }
.paso.activo { display: block; }

.paso-titulo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

.paso-numero {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    background: var(--verde-osc);
    color: var(--vis);
    display: grid;
    place-items: center;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
}

/* ------------------------------------------------------------------- tablas */

.tabla { width: 100%; border-collapse: collapse; background: var(--papel); border-radius: var(--radio); overflow: hidden; }
.tabla th, .tabla td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--borde); }
.tabla th { background: var(--verde-claro); font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .06em; font-size: .9rem; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla-envoltorio { overflow-x: auto; border-radius: var(--radio); border: 1px solid var(--borde); }

.vacio { text-align: center; padding: 40px 20px; color: var(--gris); }
.vacio .icono { font-size: 3rem; display: block; margin-bottom: 8px; opacity: .5; }

.mapa { height: 300px; border-radius: var(--radio); border: 1px solid var(--borde); z-index: 1; }

.separador { height: 1px; background: var(--borde); border: 0; margin: 18px 0; }

.dato-grande { font-family: "Barlow Condensed", sans-serif; font-size: 2.4rem; font-weight: 700; line-height: 1; }

/* ----------------------------------------------------------- barra inferior */

.barra-inferior {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    background: var(--papel);
    border-top: 1px solid var(--borde);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 30;
    box-shadow: 0 -6px 18px -12px rgba(29, 36, 22, .6);
}

.barra-inferior a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 2px;
    color: var(--gris);
    text-decoration: none;
    font-size: .78rem;
    font-weight: 600;
}

.barra-inferior a.activo { color: var(--verde-medio); }
.barra-inferior .ico { font-size: 1.35rem; line-height: 1; }

.barra-inferior .central {
    color: var(--vis-osc);
    font-weight: 700;
    margin-top: -26px;
}

.barra-inferior .central .mas {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--vis);
    color: var(--vis-osc);
    display: grid;
    place-items: center;
    font-size: 2rem;
    line-height: 1;
    border: 4px solid var(--fondo);
    box-shadow: 0 4px 14px -4px rgba(29, 36, 22, .5);
}

/* -------------------------------------------------------------------- login */

.sin-sesion { display: grid; place-items: center; min-height: 100vh; padding-bottom: 0; background: var(--verde-osc); }
.sin-sesion .contenedor { max-width: 420px; width: 100%; }

.caja-login { background: var(--papel); border-radius: 18px; padding: 28px 24px; border-top: 6px solid var(--vis); }
.caja-login h1 { text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.caja-login .lema { text-align: center; color: var(--gris); margin: -6px 0 22px; }

/* ---------------------------------------------------------------- escritorio */

@media (min-width: 900px) {
    body { padding-bottom: 20px; }
    .barra-inferior { display: none; }
    .barra .menu { display: flex; }
    .quien { display: block; }
    .contenedor { padding: 26px 20px 40px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

@media print {
    .barra, .barra-inferior, .botonera { display: none; }
    body { background: #fff; }
}

/* Medios empleados en el trabajo: tres botones grandes */
.opcion-medio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 86px;
    border: 2px solid var(--borde);
    border-radius: 12px;
    background: var(--papel);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    padding: 8px 4px;
}

.opcion-medio .icono { font-size: 1.8rem; line-height: 1; }
.opcion-medio:hover { border-color: var(--verde); }
.opcion-medio:has(input:checked) { border-color: var(--verde); background: var(--verde-claro); }
.opcion-medio:has(input:focus-visible) { outline: 3px solid var(--verde); }
