/* Macelum — shared styles for index.html and proveedores.html */

:root {
  --navy: #16224a;
  --navy-2: #1f2e63;
  --navy-3: #2b3d7d;
  --blue: #2f6bf0;
  --blue-dark: #1f56d6;
  --tint: #e9efff;
  --paper: #f5f7fc;
  --white: #ffffff;
  --ink: #131a33;
  --muted: #4f5878;
  --line: #dde3f0;
  --amber: #f2b233;
  --amber-ink: #6b4a00;
  --banner: #ffe14d;
  --ok: #17794c;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px -8px rgba(0, 0, 0, 0.16);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--blue); color: var(--white); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.on-navy :focus-visible, .hero :focus-visible, .cta-final :focus-visible { outline-color: var(--banner); }

* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid var(--paper); }

[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -0.02em; line-height: 1.12; font-weight: 700; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.fill { fill: currentColor; stroke: none; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Demo banner */
.demo-banner { background: var(--banner); color: #2b2500; text-align: center; font-size: 0.875rem; padding: 8px 16px; line-height: 1.4; }
.demo-banner strong { font-weight: 700; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(8px); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--navy); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em; }
.logo svg { width: 32px; height: 32px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 0.9375rem; font-weight: 500; color: var(--muted); padding: 8px 12px; border-radius: 8px; }
.nav a:hover { color: var(--navy); background: var(--paper); }
.nav a[aria-current="page"] { color: var(--navy); font-weight: 700; }
.nav .btn { margin-left: 8px; color: var(--white); }
.nav .btn:hover { color: var(--white); background: var(--navy-2); }
.menu-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--white); border-radius: 10px; align-items: center; justify-content: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 0.9375rem; text-decoration: none; cursor: pointer; transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-2); }
.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-dark); }
.btn-ghost { background: var(--white); color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-light { background: var(--white); color: var(--navy); }
.btn-light:hover { background: var(--tint); }
.btn-outline-light { color: var(--white); border-color: rgba(255, 255, 255, 0.45); background: transparent; }
.btn-outline-light:hover { border-color: var(--white); background: rgba(255, 255, 255, 0.08); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.875rem; }

/* Fields */
.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-size: 0.8125rem; font-weight: 600; color: var(--navy); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.input::placeholder, .textarea::placeholder { color: #6b7391; }
.input:hover, .select:hover, .textarea:hover { border-color: #b9c3dc; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 107, 240, 0.25); }
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234f5878' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input.invalid { border-color: #b3261e; }
.err { color: #b3261e; font-size: 0.8125rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); width: 18px; height: 18px; margin: 0; flex: none; }

/* Rating */
.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 0.9375rem; }
.rating .icon { color: var(--amber); width: 1em; height: 1em; }
.rating small { font-weight: 500; color: var(--muted); font-size: 0.8125rem; }

/* Provider logo tile */
.mark { display: grid; place-items: center; flex: none; width: var(--s, 56px); height: var(--s, 56px); border-radius: 14px; font-weight: 800; letter-spacing: -0.02em; font-size: calc(var(--s, 56px) * 0.34); color: var(--fg, var(--navy)); background: var(--bg, var(--tint)); }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 0.8125rem; font-weight: 500; border: 1px solid var(--line); }
.badge-featured { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: #fff3d1; color: var(--amber-ink); font-size: 0.75rem; font-weight: 700; }
.badge-featured .icon { width: 0.95em; height: 0.95em; }

/* Section rhythm */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { display: grid; gap: 12px; max-width: 62ch; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
.section-head p { color: var(--muted); font-size: 1.0625rem; }
.section-head.row { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--blue-dark); text-decoration: none; white-space: nowrap; }
.link-arrow:hover { text-decoration: underline; }
.link-arrow .icon { transition: transform 0.2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* Footer */
.site-footer { background: var(--navy); color: #d3dbf5; padding-block: 56px 32px; }
.site-footer .logo { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid p { max-width: 34ch; margin-top: 16px; font-size: 0.9375rem; }
.footer-grid h3 { font-size: 0.875rem; letter-spacing: 0.02em; color: var(--white); margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-grid a { text-decoration: none; font-size: 0.9375rem; }
.footer-grid a:hover { color: var(--white); text-decoration: underline; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.875rem; display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }

/* Contact dialog */
dialog { border: 0; padding: 0; border-radius: 18px; width: min(520px, 100% - 32px); box-shadow: 0 24px 80px -12px rgba(0, 0, 0, 0.35); color: var(--ink); }
dialog::backdrop { background: rgba(19, 26, 51, 0.55); }
dialog[open] { animation: pop 0.28s var(--ease); }
.dlg-head { display: flex; gap: 14px; align-items: center; padding: 24px 24px 0; }
.dlg-head h2 { font-size: 1.25rem; }
.dlg-head p { color: var(--muted); font-size: 0.875rem; }
.dlg-close { margin-left: auto; align-self: start; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); display: grid; place-items: center; }
.dlg-close:hover { border-color: var(--navy); }
.dlg-body { padding: 20px 24px 24px; display: grid; gap: 16px; }
.dlg-note { display: flex; gap: 10px; background: var(--tint); border-radius: 10px; padding: 12px 14px; font-size: 0.875rem; color: var(--navy); }
.dlg-note .icon { margin-top: 2px; color: var(--blue-dark); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.875rem; color: var(--muted); }
.check input { margin-top: 2px; }
.dlg-done { text-align: center; padding: 40px 24px 32px; display: grid; gap: 12px; justify-items: center; }
.dlg-done .ok { width: 56px; height: 56px; border-radius: 50%; background: #e2f5ec; color: var(--ok); display: grid; place-items: center; }
.dlg-done .ok .icon { width: 28px; height: 28px; }

@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (max-width: 880px) {
  .menu-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: var(--white); padding: 12px 16px 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .nav .btn { margin: 8px 0 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .section-head.row { flex-direction: column; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Auth dialog */
dialog.auth { width: min(560px, 100% - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
.auth-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--tint); color: var(--navy); display: grid; place-items: center; flex: none; }
.auth .dlg-head h2 { font-size: 1.25rem; line-height: 1.25; }
.auth .dlg-body p { color: var(--ink); max-width: 62ch; }
.auth-risk { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 10px; }
.auth-risk strong { color: var(--navy); font-size: 0.9375rem; }
.auth-risk p { color: var(--muted); font-size: 0.9375rem; }
.auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-later { justify-self: center; }
.auth form { display: grid; gap: 14px; }
.auth-foot { font-size: 0.9375rem; text-align: center; }
.auth-demo { font-size: 0.8125rem; color: var(--muted); text-align: center; }
.auth .linkbtn { background: none; border: 0; padding: 0; color: var(--blue-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; font-size: inherit; }
@media (max-width: 520px) { .auth-actions { grid-template-columns: 1fr; } }

/* Photo frames. Photos illustrate the category, they are not of the provider. */
.ph { position: relative; display: block; overflow: hidden; background: var(--tint); border-radius: 12px; aspect-ratio: 4 / 3; }
.ph img { width: 100%; height: 100%; object-fit: cover; animation: imgIn 0.28s var(--ease) backwards; transition: transform 0.28s var(--ease); }
.ph .mark { position: absolute; left: 10px; bottom: 10px; border: 2px solid var(--white); }
@keyframes imgIn { from { opacity: 0; } to { opacity: 1; } }
@media (hover: hover) and (pointer: fine) {
  .res:hover .ph img, .pcard:hover .ph img, .gal button:hover img { transform: scale(1.03); }
}

.auth fieldset.role { border: 0; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.auth fieldset.role legend { font-size: 0.8125rem; font-weight: 600; color: var(--navy); padding: 0; margin-bottom: 6px; }
.auth fieldset.role label { display: inline-flex; gap: 8px; align-items: center; font-size: 0.9375rem; }
