:root {
  --navy-950: #071b38;
  --navy-900: #0b2851;
  --navy-800: #123b6d;
  --orange: #f47a3d;
  --orange-dark: #d85b22;
  --teal: #38aabd;
  --ink: #14243a;
  --muted: #64748b;
  --line: #dfe7f0;
  --surface: #ffffff;
  --soft: #f4f7fb;
  --shadow: 0 18px 55px rgba(7, 27, 56, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f9fc 0, #fff 32rem);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(20px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(11, 40, 81, 0.1);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand img { display: block; width: 178px; max-height: 52px; object-fit: contain; }

.header-label { text-align: right; line-height: 1.25; }
.header-label span { display: block; color: var(--muted); font-size: .8rem; }
.header-label strong { color: var(--navy-900); font-size: .95rem; }

main { width: min(1420px, 100%); margin: 0 auto; }

.welcome {
  margin: clamp(20px, 4vw, 48px) clamp(18px, 4vw, 56px) 0;
  min-height: 430px;
  display: grid;
  grid-template-columns: .88fr 1.35fr;
  overflow: hidden;
  background: var(--navy-950);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.welcome-copy {
  padding: clamp(34px, 5vw, 72px);
  align-self: center;
  color: #fff;
  position: relative;
  z-index: 1;
}

.welcome-copy::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 5px;
  left: clamp(34px, 5vw, 72px);
  top: 42px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--orange) 0 62%, var(--teal) 62%);
}

.eyebrow {
  display: inline-block;
  color: var(--orange);
  font-weight: 800;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.welcome .eyebrow { margin-top: 20px; color: #ffad7e; }

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 620px;
  margin: 14px 0 18px;
  font-size: clamp(2.25rem, 4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.welcome-copy p {
  max-width: 560px;
  margin-bottom: 28px;
  color: #d6e2f1;
  font-size: clamp(1rem, 1.3vw, 1.14rem);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 12px;
  color: #fff;
  background: var(--orange);
  text-decoration: none;
  font-weight: 800;
  transition: transform .2s ease, background .2s ease;
}

.primary-link:hover { transform: translateY(-2px); background: var(--orange-dark); }

.welcome-visual { min-height: 100%; background: #102d54; }
.welcome-visual img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }

.library { padding: 70px clamp(18px, 4vw, 56px) 90px; scroll-margin-top: 74px; }

.library-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.library-heading h2 { margin: 5px 0 0; color: var(--navy-950); font-size: clamp(1.9rem, 3vw, 2.8rem); letter-spacing: -.035em; }
.library-heading p { margin: 0 0 7px; color: var(--muted); }
.library-heading p strong { color: var(--navy-900); }

.search-panel {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(7, 27, 56, .07);
  margin-bottom: 28px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 17px;
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 13px;
  transition: border-color .2s, box-shadow .2s;
}

.search-box:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(56, 170, 189, .13); }
.search-box svg { width: 22px; fill: none; stroke: var(--navy-800); stroke-width: 2; stroke-linecap: round; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1rem; }
.search-box input::placeholder { color: #8290a3; }

.filters { display: flex; gap: 9px; padding-top: 14px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: 0 0 auto;
  padding: 9px 14px;
  color: var(--navy-800);
  background: #fff;
  border: 1px solid #cfdae7;
  border-radius: 999px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 750;
}
.filter:hover { border-color: var(--navy-800); }
.filter.active { color: #fff; background: var(--navy-900); border-color: var(--navy-900); }
.filter-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  color: #fff;
  background: var(--orange);
  border: 1px solid var(--orange);
  border-radius: 999px;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 800;
}
.filter-link:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.filter-link:focus-visible { outline: 3px solid rgba(56, 170, 189, .4); outline-offset: 2px; }

.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }

.document-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(7, 27, 56, .07);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.document-card:hover { transform: translateY(-4px); border-color: #bdcddd; box-shadow: 0 18px 40px rgba(7, 27, 56, .12); }

.card-preview {
  height: 190px;
  padding: 18px;
  background: linear-gradient(145deg, #edf2f8, #f9fbfd);
  overflow: hidden;
  position: relative;
}

.card-preview::after {
  content: "PDF";
  position: absolute;
  right: 13px;
  top: 13px;
  padding: 5px 8px;
  color: #fff;
  background: var(--orange);
  border-radius: 8px;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .08em;
  box-shadow: 0 5px 15px rgba(244, 122, 61, .28);
}

.card-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(7, 27, 56, .14));
}

.card-content { display: flex; flex-direction: column; flex: 1; padding: 20px; }
.card-topline { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.category { color: var(--orange-dark); font-size: .75rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.status { color: #287d60; background: #e9f7f1; border-radius: 999px; padding: 4px 8px; font-size: .72rem; font-weight: 800; }
.document-card h3 { margin-bottom: 9px; color: var(--navy-950); font-size: 1.16rem; line-height: 1.25; letter-spacing: -.015em; }
.document-card p { margin-bottom: 16px; color: var(--muted); font-size: .9rem; line-height: 1.48; }
.card-meta { display: flex; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid #edf1f5; color: #738096; font-size: .78rem; }
.card-meta span + span::before { content: "·"; margin-right: 12px; }

.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.card-actions button, .card-actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  text-decoration: none;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 800;
}
.preview-button { color: var(--navy-900); background: #fff; border: 1px solid #cbd7e4; }
.preview-button:hover { background: #f3f7fb; border-color: var(--navy-800); }
.download-button { color: #fff; background: var(--navy-900); border: 1px solid var(--navy-900); }
.download-button:hover { background: var(--navy-800); }

.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: #eaf0f7; color: var(--navy-800); font-size: 2rem; }
.empty-state h3 { margin-bottom: 5px; color: var(--navy-950); }
.empty-state button { padding: 10px 15px; border: 0; border-radius: 10px; color: #fff; background: var(--navy-900); cursor: pointer; font-weight: 800; }

.online-tools {
  margin: 0 clamp(18px, 4vw, 56px) 80px;
  padding: clamp(28px, 4vw, 48px);
  background: linear-gradient(145deg, #eef5fb, #f9fbfd);
  border: 1px solid #dce7f1;
  border-radius: 28px;
  scroll-margin-top: 90px;
}

.tools-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.tools-heading h2 { margin: 5px 0 0; color: var(--navy-950); font-size: clamp(1.9rem, 3vw, 2.8rem); letter-spacing: -.035em; }
.tools-heading p { max-width: 500px; margin: 0 0 5px; color: var(--muted); }
.tools-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.tool-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 22px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(7, 27, 56, .07);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.tool-card:hover { transform: translateY(-4px); border-color: #b8c9da; box-shadow: 0 18px 40px rgba(7, 27, 56, .13); }
.tool-card:focus-visible { outline: 3px solid rgba(56, 170, 189, .45); outline-offset: 3px; }
.tool-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 18px; color: #fff; background: var(--navy-900); border-radius: 15px; }
.tool-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool-treasury .tool-icon { background: var(--orange); }
.tool-medical .tool-icon { background: var(--teal); }
.tool-rc .tool-icon { background: var(--navy-800); }
.tool-directory .tool-icon { background: #287d60; }
.tool-type { color: var(--orange-dark); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.tool-card h3 { margin: 7px 0 9px; color: var(--navy-950); font-size: 1.12rem; line-height: 1.25; }
.tool-card p { margin-bottom: 20px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.tool-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 15px; color: var(--navy-900); border-top: 1px solid #e8eef4; font-size: .86rem; font-weight: 850; }
.tool-action span { color: var(--orange-dark); font-size: 1.05rem; }

.contacts {
  margin: 0 clamp(18px, 4vw, 56px) 80px;
  padding: clamp(30px, 4vw, 54px);
  color: #fff;
  background:
    radial-gradient(circle at 92% 5%, rgba(56, 170, 189, .2), transparent 28%),
    linear-gradient(135deg, var(--navy-950), #123c6d);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.contacts-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.contacts-heading .eyebrow { color: #ffad7e; }
.contacts-heading h2 { margin: 5px 0 0; font-size: clamp(1.9rem, 3vw, 2.8rem); letter-spacing: -.035em; }
.contacts-heading p { max-width: 500px; margin: 0 0 5px; color: #cfdded; }

.contact-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 16px; }

.contact-area {
  min-width: 0;
  padding: 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, .97);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 18px;
}

.contact-area-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.area-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--orange); border-radius: 13px; font-size: .72rem; font-weight: 900; letter-spacing: .06em; }
.contact-area-title div > span { color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.contact-area-title h3 { margin: 1px 0 0; color: var(--navy-950); font-size: 1.15rem; }
.service-hours {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -2px 0 16px;
  padding: 10px 12px;
  color: var(--navy-800);
  background: #eaf2f8;
  border: 1px solid #d5e2ed;
  border-radius: 11px;
  font-size: .78rem;
  line-height: 1.35;
}
.service-hours svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: var(--orange-dark); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.service-hours span { display: grid; gap: 1px; }
.service-hours strong { color: var(--navy-950); font-size: .75rem; letter-spacing: .02em; }
.contact-list { display: grid; gap: 10px; }

.whatsapp-button {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  color: var(--navy-950);
  background: #f4f8fb;
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.whatsapp-button:hover { transform: translateY(-2px); border-color: #25a85a; box-shadow: 0 9px 22px rgba(10, 91, 47, .13); }
.contact-name { min-width: 0; font-weight: 850; }
.whatsapp-label { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; color: #13783d; font-size: .78rem; font-weight: 850; }
.whatsapp-label svg { width: 19px; height: 19px; fill: #20b85a; }

footer {
  min-height: 130px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 26px clamp(20px, 5vw, 72px);
  color: #c7d4e5;
  background: var(--navy-950);
}
footer img { width: 140px; padding: 4px; background: #fff; border-radius: 6px; }
footer p { margin: 0; color: #fff; font-weight: 750; }
footer span { font-size: .84rem; }

dialog {
  width: min(1120px, calc(100% - 28px));
  height: min(840px, calc(100% - 28px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
}
dialog::backdrop { background: rgba(4, 17, 35, .76); backdrop-filter: blur(4px); }
.dialog-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 18px 14px 22px; border-bottom: 1px solid var(--line); }
.dialog-header span { color: var(--orange-dark); font-size: .72rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.dialog-header h2 { margin: 2px 0 0; color: var(--navy-950); font-size: 1.15rem; }
#close-dialog { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #edf2f7; color: var(--navy-950); cursor: pointer; font-size: 1.8rem; line-height: 1; }
.dialog-body { height: calc(100% - 138px); background: #e6ecf3; }
.dialog-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.dialog-actions { min-height: 64px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line); }
.dialog-actions a { padding: 10px 14px; border-radius: 10px; color: var(--navy-900); text-decoration: none; font-size: .88rem; font-weight: 800; }
.dialog-actions a:first-child { border: 1px solid #cbd7e4; }
.dialog-actions .download-dialog { color: #fff; background: var(--orange); }

@media (max-width: 1020px) {
  .welcome { grid-template-columns: 1fr 1fr; }
  .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .contact-area-gmm { grid-column: 1 / -1; }
  .contact-area-gmm .contact-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .contact-area-gmm .whatsapp-button { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 760px) {
  .site-header { min-height: 66px; padding: 9px 16px; }
  .brand img { width: 132px; }
  .header-label span { display: none; }
  .header-label strong { font-size: .78rem; }
  .welcome { margin: 14px; min-height: auto; grid-template-columns: 1fr; border-radius: 22px; }
  .welcome-copy { order: 2; padding: 30px 24px 34px; }
  .welcome-copy::after { top: 25px; left: 24px; width: 105px; height: 4px; }
  .welcome .eyebrow { margin-top: 11px; }
  h1 { font-size: clamp(2rem, 10vw, 3rem); }
  .welcome-visual { order: 1; aspect-ratio: 16 / 10; }
  .welcome-visual img { object-position: center; }
  .library { padding: 52px 14px 68px; }
  .library-heading { align-items: start; flex-direction: column; gap: 6px; }
  .search-panel { padding: 12px; border-radius: 15px; }
  .document-grid { grid-template-columns: 1fr; }
  .card-preview { height: 210px; }
  .online-tools { margin: 0 14px 52px; padding: 28px 18px; border-radius: 22px; }
  .tools-heading { align-items: start; flex-direction: column; gap: 8px; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 270px; }
  .contacts { margin: 0 14px 52px; padding: 28px 18px; border-radius: 22px; }
  .contacts-heading { align-items: start; flex-direction: column; gap: 8px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-area-gmm { grid-column: auto; }
  .contact-area-gmm .contact-list { grid-template-columns: 1fr; }
  .contact-area-gmm .whatsapp-button { align-items: center; flex-direction: row; }
  footer { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 10px; padding: 28px 18px; }
  dialog { width: 100%; height: 100%; max-width: none; max-height: none; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
