
/* ==========================================================================
   DUAL-UX Site Styles (cleaned)
   - CTA overrides stabilized against W3.css
   - Removed duplicate/conflicting rules
   - App page spacing follows measured --app-nav-height
   ========================================================================== */

   /* Force App-UX when the app is launched installed (engine-level, no JS) */
#app-ux { display: none; } /* default */

/* Own copy for pwa-install */
  .dux-copy { display:none; }

@media (display-mode: standalone), (display-mode: fullscreen) {
  #web-ux { display: none !important; }
  #app-ux { display: block !important; }  /* beats .hidden */
}

/* (Optional) Some Chromium builds report minimal-ui briefly; include if needed */
@media (display-mode: minimal-ui) {
  #web-ux { display: none !important; }
  #app-ux { display: block !important; }
}
/* used by the dualux runtime to hide the inactive surface */
.hidden { display: none !important; }

:root {
  --dualux-blue-50: #60B8FE;
  --dualux-blue-100: #49AEFE;
  --dualux-blue-200: #2AA1FE;
  --dualux-blue-300: #1497FE;
  --dualux-blue-400: #0188F2;
  --dualux-blue-500: #017BDB;
  --dualux-blue-600: #0171C9;
  --dualux-blue-700: #0168B9;
  --dualux-blue-800: #0160AA;
  --dualux-blue-900: #01579B;
  --dualux-green-50: #4AF1AC;
  --dualux-green-100: #34F0A2;
  --dualux-green-200: #18EE95;
  --dualux-green-300: #11DE89;
  --dualux-green-400: #0FC177;
  --dualux-green-500: #0DAC6A;
  --dualux-green-600: #0C9B5F;
  --dualux-green-700: #0B8D57;
  --dualux-green-800: #0A7E4E;
  --dualux-green-900: #087045;
  --dualux-on-blue: #F7F7F7;
  --dualux-on-green: #F7F7F7;
  --dualux-black: #000000;
  --dualux-white: #FFFFFF;
  --dualux-ink: #0A0A0A;
  --dualux-paper: #F7F7F7;
  --openweb-bg: #000;
  --openweb-stroke: #A6A6A6;
  --openweb-text: #fff;
  --openweb-radius: 14px;
  --openweb-height: 40px;  /* match Apple/Google 1x height */
}

.theme-dark { color-scheme: dark; background:#000; color:#fff; }
.theme-light { color-scheme: light; background:#fff; color:#0A0A0A; }

/* Consolidated button styles */
.btn-primary {
  background: var(--dualux-blue-500);
  color: var(--dualux-on-blue);
  padding: 12px 10px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}
.btn-primary:hover { background: var(--dualux-green-500); }

/* CTA component (anchor or button) — make it win over W3.css */
a {
  color: inherit;
  text-decoration: none;
}
a.btn-primary, button.btn-primary,
a.cta, button.cta {
  display: inline-block;
  background: var(--dualux-blue-500) !important;
  color: var(--dualux-on-blue) !important;
  text-decoration: none !important;
  border: none;
  border-radius: 8px;
}
a.cta, button.cta {
  padding: 10px 20px;
  font-size: 1.2em;
  margin-top: 15px;
}
a.btn-primary:hover, button.btn-primary:hover,
a.cta:hover, button.cta:hover {
  background: var(--dualux-green-500) !important;
  color: var(--dualux-on-green) !important;
}

/* If CTAs use the W3 button class, keep our palette */
.w3-button.btn-primary, .w3-button.cta {
  background: var(--dualux-blue-500) !important;
  color: var(--dualux-on-blue) !important;
  border: none;
}

/* Typography & base */
body, h1, h2, h3, h4, h5, h6 { font-family: "Raleway", sans-serif; }
body, html {
  height: 100%;
  line-height: 1.8;
  background: #000; /* ensure any uncovered area isn't white */
}
h1 { font-size: 60px; }

/* W3 helpers */
.w3-bar .w3-button { padding: 16px; }

/* Web surface */
#web-ux { background: var(--dualux-white); }

/* App UX baseline */
#app-ux {
  position: relative;
  min-height: 100vh; /* fallback; overridden by 100svh below */
  background: #000;
  --app-nav-height: 62px; /* default; JS sets real value */
  --nav-h: 48px;          /* bottom bar height for .icon-bar */
  --nav-bottom: 15px;     /* distance from bottom edge */
}

/* Prefer stable viewport height on iOS 16+ */
@supports (height: 100svh) { #app-ux { min-height: 100svh; } }
@supports not (height: 100svh) { #app-ux { min-height: 100vh; } }

/* App pages: reserve exactly the measured bottom bar height */
.app-page {
  position: absolute;
  inset: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(var(--app-nav-height) + 16px);
}
.app-page::after {
  content: "";
  display: block;
  height: var(--app-nav-height);
}

/* Page 1 (hero) */
#Page1.app-page { padding: 0; }
#Page1.app-page::after { height: 0; } /* no extra spacer on hero */
#Page1 {
  display: grid;
  place-items: center;
  background: #000;
}
@supports (height: 100svh) {
  #Page1 img {
    width: 100%;
    height: calc(100svh - var(--app-nav-height) - env(safe-area-inset-bottom, 0px));
    object-fit: contain; /* switch to 'cover' for full-bleed */
    display: block;
  }
}
@supports not (height: 100svh) {
  #Page1 img {
    width: 100%;
    height: calc(100vh - var(--app-nav-height) - env(safe-area-inset-bottom, 0px));
    object-fit: contain;
    display: block;
  }
}

/* Contain pull-to-bounce in installed mode only (keeps Safari nice) */
html.standalone, html.standalone body { overscroll-behavior: none; }

/* Custom element should behave like a block container */
footer-app { display: block; }

/* Shared surface box-model */
.ux-block { display: block; min-height: 100vh; box-sizing: border-box; }

/* Hero background (web) — unified definition */
.bgimg-1 {
  background-image: url('/assets/img/erda-estremera-1232x2101.jpg');
  min-height: 100vh;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Content utilities */
.highlight {
  background: rgba(255, 255, 255, 0.9);
  padding: 2em;
  margin-top: 2em;
  border-radius: 12px;
}

.downloads a {
  display: inline-block;
  margin: 10px;
  padding: 12px 20px;
  background: var(--dualux-blue-500);
  color: var(--dualux-paper);
  border-radius: 6px;
  text-decoration: none;
}
.downloads a:hover { background: var(--dualux-green-500); }

.w3-container form input,
.w3-container form textarea { margin-bottom: 12px; }

/* Legacy #app overlay (if used) */
#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100vh;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  z-index: 10;
  font-family: 'Lato', sans-serif;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  margin: 0;
}

#app-ux h1 { color: #ffffff; font-size: 36px; }
#app-ux h2, #app-ux p { color: #a5a0a0; }

.logo {
  position: absolute;
  top: 5vh;
  left: 20px;
  color: #ffffff;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 1px;
  text-align: left;
}

.button-container {
  width: 100%;
  max-width: 500px;
  padding: 40px 20px;
  margin-bottom: 20vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.download-button {
  width: 100%;
  background-color: #222;
  color: #fff;
  font-size: 18px;
  padding: 16px;
  border: none;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.3s;
}
.download-button:hover { background-color: #333; }

/* Modal PDF Viewer */
#pdfModal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 999999;
  overflow: auto;
}
#pdfViewer canvas {
  display: block;
  margin: 20px auto;
  max-width: 100%;
}
.close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 28px;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  z-index: 10000;
}
.close-btn:hover { background: #444; }

/* Animations (respect reduced motion) */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
section {
  margin-bottom: 4rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease forwards;
}
section:nth-of-type(2) { animation-delay: 0.4s; }
section:nth-of-type(3) { animation-delay: 0.8s; }
section:nth-of-type(4) { animation-delay: 1.2s; }

.appsection {
  padding: 20px;
  margin-left: 10px;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease forwards;
}

/* When an app page is visible, force its sections to be visible immediately */
.app-page:not([style*="display: none"]) .appsection {
  opacity: 1 !important;
  transform: translateY(20px);
  animation: fadeInUp 1s ease forwards;
}

.pill-button {
  background-color: #1c1c1e;
  color: #fff;
  border: 1px solid #333;
  border-radius: 2rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  margin: 0.5rem auto;
  width: 80%;
  max-width: 300px;
  text-decoration: none;
  display: block;
  opacity: 1;
}
.pill-button:hover { background-color: #333; }

.footer {
  color: #666;
  font-size: 0.9rem;
  margin-top: 3rem;
  opacity: 0;
  animation: fadeIn 1s ease forwards;
  animation-delay: 2.2s;
}

@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { to { opacity: 1; } }

#resources { text-align: center; margin-bottom: 6rem; }

.card-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.doc-card {
  background-color: #1c1c1e;
  border: 1px solid #333;
  border-radius: 1.5rem;
  padding: 2rem 1.5rem;
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.6s ease, opacity 0.6s ease;
  opacity: 1;      /* keep visible by default */
  transform: none; /* avoid persistent 40px offset */
}

.doc-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.doc-card h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.doc-card p { font-size: 1rem; margin-bottom: 1rem; color: #ccc; }

/* Responsive stacking */
@media (min-width: 600px) {
  .card-container { flex-direction: row; justify-content: center; }
  .doc-card { width: 300px; }
}

/* Reveal animation if you choose to toggle .visible in JS */
.doc-card.visible { opacity: 1; transform: translateY(0); }

/* ==== Bottom icon bar (app) ==== */
.icon-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--nav-h);
  display: flex; justify-content: space-around; align-items: center;
  background: #000; padding: 0 !important; margin: 0; z-index: 1000;
  box-sizing: border-box;
}

/* Items: column layout so we control icon+label stack precisely */
.icon-bar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; height: 100%;
  padding: 0; margin: 0;
  color: #fff; text-decoration: none;
  font-size: 10px; line-height: 1;
}

/* Icon: block + line-height:1 prevents baseline creep */
.icon-bar a i { display: block; font-size: 24px; line-height: 1; }

/* If markup still has <br>, neutralize it (we're using flex) */
.icon-bar a br { display: none; }

/* IMPORTANT: remove any prior iOS-specific nudges */
@supports (-webkit-touch-callout: none) {
  .icon-bar { align-items: center; }
  .icon-bar a { padding-bottom: 0; }
}

.icon-bar a.active { color: var(--dualux-blue-500); }

.openweb-badge {
  display:inline-flex;
  align-items:center;
  gap:10px;
  height:var(--openweb-height);
  padding:0 12px 0 10px;
  background:var(--openweb-bg);
  color:var(--openweb-text);
  border-radius:var(--openweb-radius);
  border:1px solid var(--openweb-stroke);
  text-decoration:none;
  -webkit-font-smoothing:antialiased;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}

.openweb-icon{
  width:56px; height:28px;
  display:inline-block;
  background-image:url('/assets/img/Progressive_Web_Apps_Logo.svg');
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;   /* preserves the ring */
  border-radius:0;           /* don't clip the SVG */
}   
.openweb-texts { line-height:1; display:flex; flex-direction:column; }
.openweb-small { font-size:11px; opacity:.9; }
.openweb-strong { font-weight:700; font-size:15px; }
/* 2x / 3x convenience sizes */
.openweb-badge.x2 { --openweb-height:80px; border-radius:20px; }
.openweb-badge.x2 .openweb-icon { width:104px; height:52px; border-radius:0px; }
.openweb-badge.x2 .openweb-small { font-size:19px; }
.openweb-badge.x2 .openweb-strong { font-size:28px; }
.openweb-badge.x3 { --openweb-height:120px; border-radius:24px; }
.openweb-badge.x3 .openweb-icon { width:156px; height:78px; border-radius:0px; }
.openweb-badge.x3 .openweb-small { font-size:24px; }
.openweb-badge.x3 .openweb-strong { font-size:42px; }
