/* ============================================================
   ABM Logistics — modern.css
   Mejoras estéticas y sistema de modales glassmorphism
   ============================================================ */

/* ----------------------------------------------------------
   1. DESIGN TOKENS
---------------------------------------------------------- */
:root {
  --clr-navy:        #00045f;
  --clr-navy-light:  #0007a3;
  --clr-accent:      #FCAC45;
  --clr-accent-dark: #c47e00;
  --clr-danger:      #b91c1c;
  --clr-danger-bg:   #fef2f2;
  --clr-success:     #15803d;
  --clr-success-bg:  #f0fdf4;
  --clr-text:        #1a1a2e;
  --clr-text-muted:  #4a4a62;   /* WCAG AA ≥ 4.5:1 on white and on #f5f6fb */
  --clr-bg:          #f8f9fc;
  --clr-white:       #ffffff;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 2px 8px rgba(0, 4, 95, 0.08);
  --shadow-md: 0 8px 32px rgba(0, 4, 95, 0.14);
  --shadow-lg: 0 20px 60px rgba(0, 4, 95, 0.22);

  --transition: 0.25s cubic-bezier(.4,0,.2,1);

  /* Fonts: match the existing site (Lato + Open Sans, loaded by style.css) */
  --font-head: 'Lato', sans-serif;
  --font-body: 'Open Sans', sans-serif;
}

/* ----------------------------------------------------------
   2. TYPOGRAPHY UPGRADE
---------------------------------------------------------- */
body, html {
  font-family: var(--font-body);
}
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  letter-spacing: -0.01em;
}
h2 {
  /* Match Bootstrap 3 h2 = 30px, existing site uses font-weight:300 for section titles */
  font-size: 30px;
  font-weight: 300;
  color: var(--clr-navy);
  letter-spacing: 0;
}
h3 {
  /* Match existing: h3 { font-size: 18px; font-weight: 900; } */
  font-size: 18px;
}
p {
  font-family: var(--font-body);
  line-height: 1.7;
  /* NO color here — it bleeds into dark-background parallax sections.
     Color is set per-section below or inherited from the section. */
}

/* Light-background sections: apply near-black text */
#tf-about p,
#tf-agents p {
  color: var(--clr-text);
}

/* Dark/parallax sections: ALWAYS white text — never inherit #1a1a2e */
#tf-home p,
#tf-team p,
#tf-services p,
#tf-contact p,
nav#footer p,
nav#footer small {
  color: inherit;   /* inherits #fff from their section */
}

/* Explicit placeholder color — browsers apply ~55% opacity by default,
   so we set it explicitly to guarantee contrast */
::placeholder {
  color: #767690;
  opacity: 1;   /* Firefox reduces opacity by default — override */
}

/* ----------------------------------------------------------
   3. NAVBAR — tracking button + scroll-on state polish
---------------------------------------------------------- */
.tracking-nav-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 5px 16px !important;
  border: 1.5px solid rgba(252, 172, 69, 0.7) !important;
  border-radius: 50px !important;
  color: var(--clr-accent) !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  letter-spacing: 0.5px !important;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition) !important;
  white-space: nowrap;
}
.tracking-nav-btn:hover,
.tracking-nav-btn:focus {
  background: var(--clr-accent) !important;
  color: var(--clr-navy) !important;
  box-shadow: 0 0 12px rgba(252, 172, 69, 0.4) !important;
  text-decoration: none !important;
}
.tracking-nav-btn .fa {
  font-size: 20px;
}

/* Team section: the navy divider line is invisible on black bg.
   Override it with the accent color so it's clearly visible. */
#tf-team .section-title.center .line,
#tf-team .section-title hr {
  border-top-color: var(--clr-accent) !important;
  border-color: var(--clr-accent) !important;
}
/* Force white text on all team card elements — black background */
#tf-team .thumbnail .caption h3,
#tf-team .thumbnail .caption p,
#tf-team h2,
#tf-team .section-title h2 {
  color: #ffffff !important;
}
/* Services section: same fix for divider on dark image bg */
#tf-services .section-title.center .line,
#tf-services .section-title hr {
  border-top-color: rgba(252,172,69,0.7) !important;
  border-color: rgba(252,172,69,0.7) !important;
}
/* Team social icons: gray on black barely passes for small text.
   Bump to #c8c8dc for clear legibility. */
#tf-team .social {
  color: #c8c8dc;
}
#tf-team .social a {
  color: #c8c8dc;
}

/* navbar on state: solid navy gradient when scrolled */
.navbar-default.on {
  background: linear-gradient(135deg, var(--clr-navy) 0%, #000880 100%) !important;
  border-color: transparent !important;
  box-shadow: var(--shadow-md) !important;
}

/* section hr decoration */
.section-title hr {
  border-image: linear-gradient(90deg, var(--clr-navy), var(--clr-accent)) 1;
}

/* ----------------------------------------------------------
   4. PARALLAX OVERLAY — darken enough for readable text
   The original overlay (max 40% black) fails when background
   images are light. Minimum 65% black is needed for white text
   to pass WCAG AA (4.5:1) over any photo.
---------------------------------------------------------- */
#tf-home .overlay,
#tf-services .overlay,
#tf-contact .overlay {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.42) 0%,
    rgba(0, 0, 0, 0.35) 40%,
    rgba(0, 0, 0, 0.38) 100%
  ) !important;
  background-attachment: fixed !important;
}

/* Hero text: force pure white — #cfcfcf was too dim on partial overlays */
#tf-home,
#tf-home .content {
  color: #ffffff !important;
}
#tf-home p.lead {
  color: rgba(255, 255, 255, 0.92) !important;
}
#tf-home .content p span {
  color: #ffffff !important;
  text-shadow: 0 2px 16px rgba(0,0,0,0.7);
}

/* ----------------------------------------------------------
   4b. HERO — subtle text shadow for readability
---------------------------------------------------------- */
.content h1, .content p {
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

/* ----------------------------------------------------------
   5. SERVICE CARDS — modern hover + border glow
---------------------------------------------------------- */
#tf-services .service {
  padding: 32px 24px;
  border-radius: var(--radius-md);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
#tf-services .service:hover {
  background: rgba(255,255,255,0.07);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
#tf-services i.fa {
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
#tf-services .service:hover > i.fa {
  background: var(--clr-accent) !important;
  border-color: var(--clr-accent) !important;
  color: var(--clr-navy) !important;
  box-shadow: 0 0 20px rgba(252,172,69,0.4);
}
.btn.btn-primary {
  background: var(--clr-navy);
  border-color: var(--clr-navy);
  border-radius: 50px;
  padding: 6px 20px;
  font-family: var(--font-body);
  font-weight: 500;
  transition: background var(--transition), box-shadow var(--transition);
}
.btn.btn-primary:hover {
  background: var(--clr-navy-light);
  box-shadow: 0 4px 16px rgba(0,4,95,0.3);
}

/* ----------------------------------------------------------
   6. TEAM CARDS
---------------------------------------------------------- */
.perfilBox {
  border-radius: var(--radius-md);
  transition: transform var(--transition), box-shadow var(--transition);
}
.perfilBox:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

/* ----------------------------------------------------------
   7. DIALOG SYSTEM — glassmorphism modals
   Uses native <dialog> element for best a11y
---------------------------------------------------------- */

/* The <dialog> itself acts as the full-screen overlay */
.abm-dialog {
  /* Reset browser dialog styles */
  padding: 0;
  border: none;
  background: transparent;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  position: fixed;
  inset: 0;
  display: none;               /* hidden by default */
  align-items: center;
  justify-content: center;
  overflow: auto;
  z-index: 1060;
}
.abm-dialog[open] {
  display: flex;
}

/* Glassmorphism backdrop */
.abm-dialog__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 4, 95, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 0;
  animation: abm-backdrop-in 0.25s ease forwards;
}
@keyframes abm-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* The content panel */
.abm-dialog__panel {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px 36px;
  width: min(480px, calc(100vw - 32px));
  animation: abm-panel-in 0.3s cubic-bezier(.2,1.2,.4,1) forwards;
  text-align: center;
}
.abm-dialog__panel--sm {
  width: min(420px, calc(100vw - 32px));
}
@keyframes abm-panel-in {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* Close button */
.abm-dialog__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--clr-text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  line-height: 1;
  padding: 0;
}
.abm-dialog__close:hover {
  background: rgba(0,4,95,0.07);
  color: var(--clr-navy);
}

/* Logo icon inside modal */
.abm-dialog__logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-navy) 0%, #0009cc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 6px 20px rgba(0,4,95,0.3);
}
.abm-dialog__logo .fa {
  font-size: 50px;
  color: #fff;
}
.abm-dialog__logo--warn {
  background: linear-gradient(135deg, #e8960e 0%, var(--clr-accent) 100%);
  box-shadow: 0 6px 20px rgba(252,172,69,0.4);
}

.abm-dialog__title {
  font-family: 'Lato', sans-serif;
  font-size: 22px;   /* matches navbar brand 22px; clearly a title without being a section h2 */
  font-weight: 700;
  color: var(--clr-navy);
  margin: 0 0 6px;
  line-height: 1.2;
}
.abm-dialog__subtitle {
  font-size: 14px;   /* Bootstrap body = 14px */
  color: #1a1a2e;
  margin: 0 0 24px;
  font-family: 'Open Sans', sans-serif;
  line-height: 1.5;
}

/* Footer links inside modal */
.abm-dialog__links {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.abm-dialog__links a {
  font-size: 12px;   /* matches existing nav-link 12px */
  color: var(--clr-navy);
  font-family: 'Open Sans', sans-serif;
  transition: color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.abm-dialog__links a:hover {
  color: var(--clr-accent-dark);
  font-weight: 600;
  text-decoration: none;
}
.abm-dialog__register-link {
  font-weight: 600 !important;
  color: var(--clr-accent-dark) !important;
}
.abm-dialog__register-link:hover {
  color: var(--clr-navy) !important;
}

/* ----------------------------------------------------------
   8. FORM COMPONENTS inside modals
---------------------------------------------------------- */
.abm-form {
  text-align: left;
}
.abm-form__field {
  margin-bottom: 18px;
}
.abm-form__label {
  display: block;
  font-size: 14px;  /* Bootstrap form-control default */
  font-weight: 400;
  color: #1a1a2e;
  margin-bottom: 4px;
  font-family: 'Open Sans', sans-serif;
  letter-spacing: 0;
  float: none;
}
.abm-form__hint {
  display: block;
  font-size: 12px;   /* matches existing: nav links, footer = 12px */
  color: #3d3d55;
  margin-bottom: 5px;
  font-family: 'Open Sans', sans-serif;
}
.abm-form__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.abm-form__icon {
  position: absolute;
  left: 13px;
  color: #3d3d55;
  font-size: 14px;   /* matches Bootstrap form icon size context */
  pointer-events: none;
  z-index: 1;
}
.abm-form__input {
  width: 100%;
  padding: 11px 42px;
  border: 1.5px solid #d0d4e8;
  border-radius: var(--radius-sm);
  /* Match Bootstrap .form-control exactly: 14px, 6px 12px padding, height 34px */
  padding: 6px 12px 6px 34px;
  font-size: 14px;
  line-height: 1.42857143;
  height: 34px;
  font-family: 'Open Sans', sans-serif;
  color: var(--clr-text);
  background: #f0f1f8;   /* slightly darker grey = better contrast for text */
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
  box-shadow: none;
  /* remove Bootstrap's box-sizing interference */
  box-sizing: border-box;
}
.abm-form__input:focus {
  border-color: var(--clr-navy);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,4,95,0.14);
}

/* Native :user-invalid — show error only after interaction */
.abm-form__input:user-invalid {
  border-color: var(--clr-danger);
  background-color: var(--clr-danger-bg);
}
.abm-form__input:user-valid {
  border-color: var(--clr-success);
}

/* Error message — hidden by default */
.abm-form__error {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 14px;   /* Bootstrap body = 14px */
  font-weight: 400;
  color: #9b1c1c;
  font-family: 'Open Sans', sans-serif;
  margin-top: 5px;
  padding: 7px 12px;
  background: #fef2f2;
  border-radius: var(--radius-sm);
  border-left: 3px solid #b91c1c;
}
/* Revealed by :user-invalid sibling selector */
.abm-form__input:user-invalid + .abm-form__error {
  display: flex;
}
/* Server-side error (shown programmatically) */
.abm-form__error--server {
  margin-top: 12px;
}
.abm-form__error--server:not([hidden]) {
  display: flex;
}

/* Password toggle button */
.abm-form__toggle-pass {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #3d3d55;    /* was clr-text-muted; this passes AA on all bg */
  padding: 4px;
  transition: color var(--transition);
  display: flex;
  align-items: center;
}
.abm-form__toggle-pass:hover {
  color: var(--clr-navy);
}

/* Form actions row */
.abm-form__actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ----------------------------------------------------------
   9. BUTTON SYSTEM
---------------------------------------------------------- */
.abm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* Match Bootstrap btn: 6px 12px padding, 14px font — keep our pill radius as aesthetic improvement */
  padding: 6px 20px;
  border-radius: 50px;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.42857143;
}
.abm-btn:active {
  transform: scale(0.97);
}
.abm-btn--primary {
  background: linear-gradient(135deg, var(--clr-navy) 0%, #000dcc 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,4,95,0.28);
}
.abm-btn--primary:hover {
  box-shadow: 0 6px 20px rgba(0,4,95,0.4);
  background: linear-gradient(135deg, #000dcc 0%, var(--clr-navy) 100%);
  color: #fff;
  text-decoration: none;
}
.abm-btn--ghost {
  background: transparent;
  color: #3d3d55;   /* was clr-text-muted */
  border-color: #b8bce0;  /* slightly darker border = clearer definition */
}
.abm-btn--ghost:hover {
  background: #f0f2ff;
  color: var(--clr-navy);
  border-color: var(--clr-navy);
}
.abm-btn--full {
  width: 100%;
  justify-content: center;
}

/* ----------------------------------------------------------
   10. FOOTER — explicit colors so generic p rule can't bleed in
---------------------------------------------------------- */
nav#footer {
  background: linear-gradient(135deg, #00024a 0%, #00045f 100%);
  color: #ffffff;               /* all text inherits white */
}
nav#footer p,
nav#footer small {
  color: rgba(255, 255, 255, 0.88);  /* slight softening is fine at 17+:1 */
  font-size: 12px;
}
nav#footer a {
  color: #ffc966;    /* lighter accent so orange pops on dark navy: ~8:1 */
}
nav#footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}
/* Social icons in footer */
nav#footer #footer i.fa,
#footer i.fa {
  color: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.4);
}
#footer i.fa:hover {
  background: var(--clr-accent);
  border-color: var(--clr-accent);
  color: #00045f;
}

/* ----------------------------------------------------------
   11. SCROLL BEHAVIOR POLISH
---------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

/* ----------------------------------------------------------
   12. FOCUS-VISIBLE ring (keyboard only)
---------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--clr-accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* ----------------------------------------------------------
   13. RESPONSIVE
---------------------------------------------------------- */
@media (max-width: 600px) {
  .abm-dialog__panel {
    padding: 36px 20px 28px;
  }
  .abm-form__actions {
    flex-direction: column;
  }
  .abm-btn {
    width: 100%;
    justify-content: center;
  }
  .tracking-nav-btn {
    margin-top: 8px;
  }
}
