/* ==========================================================================
   Manzanarez ProEnergy Spa — Digitalización de formularios de terreno
   ========================================================================== */

:root {
  --mz-purple: #2c1c66;
  --mz-purple-dark: #1d1245;
  --mz-green: #2fa84f;
  --mz-green-light: #8bc34a;
  --mz-green-pale: #eaf6ec;
  --mz-ok: #2fa84f;
  --mz-nook: #d64545;
  --mz-na: #8a8a8a;
  --mz-bg: #f5f6f8;
  --mz-paper: #ffffff;
  --mz-border: #d7dbe3;
  --mz-text: #202230;
  --mz-text-soft: #5b5f6f;
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

body {
  background: var(--mz-bg);
  color: var(--mz-text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, .mz-heading {
  font-weight: 700;
  color: var(--mz-purple);
  letter-spacing: -0.01em;
}

a { text-decoration: none; }

/* ---- Top brand bar --------------------------------------------------- */
.mz-topbar {
  background: linear-gradient(90deg, var(--mz-purple) 0%, var(--mz-purple-dark) 100%);
  color: #fff;
  padding: .6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.mz-topbar img { height: 60px; width: auto; }
.mz-topbar .mz-title { font-size: 1rem; font-weight: 600; }
.mz-topbar .mz-subtitle { font-size: .78rem; color: #cfd0e6; }
.mz-topbar .mz-back {
  color: #fff;
  font-size: .9rem;
  border: 1px solid rgba(255,255,255,.35);
  padding: .3rem .7rem;
  border-radius: 999px;
}
.mz-topbar .mz-back:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ---- Home menu --------------------------------------------------------- */
.mz-hero {
  background: radial-gradient(circle at 15% 20%, rgba(139,195,74,.18), transparent 45%),
              linear-gradient(160deg, var(--mz-purple) 0%, var(--mz-purple-dark) 100%);
  color: #fff;
  padding: 3rem 1.25rem 5.5rem;
}
.mz-hero .badge-live {
  background: rgba(139,195,74,.18);
  color: var(--mz-green-light);
  border: 1px solid rgba(139,195,74,.4);
  border-radius: 999px;
  font-size: .75rem;
  padding: .3rem .75rem;
  letter-spacing: .02em;
}
.mz-hero h1 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.mz-hero p { color: #d7d8ec; max-width: 40rem; }

.mz-cards { margin-top: -3.5rem; padding-bottom: 3rem; }

.mz-module-card {
  background: var(--mz-paper);
  border: 1px solid var(--mz-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow: 0 1px 3px rgba(20,20,40,.05);
}
.mz-module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(44,28,102,.12);
  border-color: var(--mz-green-light);
}
.mz-module-card .mz-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--mz-green-pale);
  color: var(--mz-green);
  font-size: 1.4rem;
}
.mz-module-card .mz-tag {
  font-size: .72rem;
  color: var(--mz-text-soft);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.mz-module-card h3 { font-size: 1.15rem; margin: 0; }
.mz-module-card p { color: var(--mz-text-soft); font-size: .9rem; flex-grow: 1; }
.mz-module-card .btn { align-self: flex-start; }

.btn-mz-primary {
  background: var(--mz-green);
  border-color: var(--mz-green);
  color: #fff;
  font-weight: 600;
}
.btn-mz-primary:hover { background: #268a41; border-color: #268a41; color: #fff; }

.btn-mz-outline {
  border: 1px solid var(--mz-purple);
  color: var(--mz-purple);
  font-weight: 600;
  background: transparent;
}
.btn-mz-outline:hover { background: var(--mz-purple); color: #fff; }

/* ---- Form shell --------------------------------------------------------- */
.mz-form-page { padding-bottom: 6rem; }
.mz-section {
  background: var(--mz-paper);
  border: 1px solid var(--mz-border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.mz-section-header {
  background: var(--mz-purple);
  color: #fff;
  padding: .65rem 1rem;
  font-weight: 700;
  font-size: .88rem;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mz-section-header.alt { background: var(--mz-green); }
.mz-section-body { padding: 1rem; }

.required-mark { color: var(--mz-nook); margin-left: .15rem; }

.form-label { font-size: .85rem; font-weight: 600; color: var(--mz-text); margin-bottom: .25rem; }
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--mz-border);
  font-size: .92rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--mz-green);
  box-shadow: 0 0 0 .2rem rgba(47,168,79,.15);
}
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--mz-nook); }

/* ---- Checklist table ---------------------------------------------------- */
.mz-checklist-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.mz-checklist-table th {
  background: var(--mz-purple);
  color: #fff;
  padding: .5rem .4rem;
  text-align: left;
  font-size: .78rem;
  white-space: nowrap;
}
.mz-checklist-table td {
  padding: .45rem .4rem;
  border-bottom: 1px solid var(--mz-border);
  vertical-align: middle;
}
.mz-checklist-table tr:nth-child(even) td { background: #fafbfc; }
.mz-checklist-table .mz-item-no { color: var(--mz-text-soft); font-weight: 600; width: 2rem; }
.mz-checklist-table .mz-item-name { font-weight: 600; min-width: 9rem; }
.mz-checklist-table .mz-item-activity { color: var(--mz-text-soft); min-width: 14rem; }
.mz-checklist-table .mz-obs input { min-width: 10rem; }

.mz-status-group { display: flex; gap: .35rem; white-space: nowrap; }
.mz-status-group .form-check-input { cursor: pointer; }
.mz-status-group label { font-size: .78rem; cursor: pointer; }
.form-check-input.status-ok:checked { background-color: var(--mz-ok); border-color: var(--mz-ok); }
.form-check-input.status-nook:checked { background-color: var(--mz-nook); border-color: var(--mz-nook); }
.form-check-input.status-na:checked { background-color: var(--mz-na); border-color: var(--mz-na); }

.table-responsive-mz { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--mz-border); }

/* ---- Dynamic rows table (mediciones / repuestos) ------------------------ */
.mz-dyn-table input, .mz-dyn-table select { font-size: .85rem; }
.mz-dyn-remove { color: var(--mz-nook); cursor: pointer; border: none; background: none; font-size: 1.1rem; }
.mz-add-row-btn { font-size: .82rem; }

/* ---- EPP / Risk checkbox grid ------------------------------------------- */
.mz-check-grid { display: grid; grid-template-columns: 1fr; gap: .4rem; }
@media (min-width: 576px) { .mz-check-grid { grid-template-columns: 1fr 1fr; } }
.mz-check-grid .form-check {
  border: 1px solid var(--mz-border);
  border-radius: var(--radius-sm);
  padding: .45rem .6rem;
  background: #fbfbfd;
}

/* ---- Photo evidence ------------------------------------------------------ */
.mz-photo-box {
  border: 1.5px dashed var(--mz-border);
  border-radius: var(--radius-sm);
  padding: .75rem;
  text-align: center;
  background: #fafbfc;
}
.mz-photo-box .mz-photo-preview {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: none;
  margin-bottom: .5rem;
}
.mz-photo-box .mz-photo-placeholder {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mz-text-soft);
  font-size: 1.6rem;
  margin-bottom: .5rem;
  background: #f0f1f4;
  border-radius: var(--radius-sm);
}
.mz-photo-box label { font-size: .78rem; font-weight: 700; color: var(--mz-purple); }

/* ---- Signature pad -------------------------------------------------------- */
.mz-sign-wrap { text-align: center; }
.mz-sign-canvas {
  border: 1.5px dashed var(--mz-border);
  border-radius: var(--radius-sm);
  background: #fff;
  width: 100%;
  max-width: 320px;
  height: 150px;
  touch-action: none;
  cursor: crosshair;
}
.mz-sign-clear {
  font-size: .78rem;
  margin-top: .35rem;
}
.mz-sign-name { margin-top: .5rem; }

/* ---- Sticky action bar ---------------------------------------------------- */
.mz-action-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--mz-border);
  padding: .7rem 1rem;
  box-shadow: 0 -4px 16px rgba(20,20,40,.08);
  z-index: 1030;
}
.mz-action-bar .mz-progress-label { font-size: .78rem; color: var(--mz-text-soft); }

.mz-group-invalid { outline: 1.5px solid var(--mz-nook); border-radius: var(--radius-sm); }

/* ---- Toast / status pill --------------------------------------------------- */
.mz-pill { border-radius: 999px; padding: .2rem .6rem; font-size: .72rem; font-weight: 700; }
.mz-pill-ok { background: var(--mz-green-pale); color: var(--mz-green); }

/* ---- PDF hidden render target --------------------------------------------- */
#mz-pdf-render { position: absolute; left: -10000px; top: 0; width: 794px; background: #fff; }

@media print {
  .mz-topbar, .mz-action-bar { display: none !important; }
}
