/* ---------------------------------------------------------------------------
   IntelFortes — additions to intelfortes-master.css
   Kept in a SEPARATE file on purpose: intelfortes-master.css is the file that
   arrives from design, so a future drop of it must not wipe the language
   switcher or the contact form. Variables and button classes are inherited.
   --------------------------------------------------------------------------- */

/* ---------- header fit ----------
   The header gained a Contact link and a language switcher, which is enough to
   push "How It Works" and the buttons onto two lines at 1280px. Nothing here
   restyles the header — it just stops the existing pieces from wrapping and
   hands over to the burger menu a little earlier. */

.desktop-nav a,
.header-actions .btn,
.lang-switcher > summary { white-space: nowrap; }

.header-actions { align-items: center; }

/* Contact + the switcher cost about 90px; give it back out of the nav gap so the
   English header still fits on one row at every desktop width. */
.desktop-nav { gap: 17px; }

@media (max-width: 1320px) {
  .desktop-nav { gap: 14px; }
  .desktop-nav a { font-size: .84rem; }
}

@media (max-width: 1180px) {
  .desktop-nav { display: none; }
  .mobile-nav { display: block; }
  .header-actions { margin-left: auto; }
}

/* Set by fitHeader() when the translated nav no longer fits on one row. */
.site-header.nav-collapsed .desktop-nav { display: none; }
.site-header.nav-collapsed .mobile-nav { display: block; }
.site-header.nav-collapsed .header-actions { margin-left: auto; }

/* ---------- language switcher ---------- */

.lang-switcher {
  position: relative;
  margin-right: 4px;
}

.lang-switcher > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, .015);
  font-size: .8rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: border-color .18s ease, color .18s ease;
}

.lang-switcher > summary::-webkit-details-marker { display: none; }

.lang-switcher > summary:hover,
.lang-switcher[open] > summary {
  border-color: rgba(36, 231, 244, .4);
  color: var(--text);
}

.lang-globe { font-size: .95rem; line-height: 1; }

.lang-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 60;
  min-width: 178px;
  padding: 6px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
}

.lang-panel button {
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: .84rem;
  text-align: start;
  cursor: pointer;
}

.lang-panel button:hover {
  color: var(--text);
  background: rgba(36, 231, 244, .08);
}

.lang-panel button[aria-current="true"] {
  color: var(--cyan);
  background: rgba(36, 231, 244, .1);
}

/* ---------- contact form ---------- */

.contact-panel {
  margin-top: 26px;
  padding: clamp(26px, 4vw, 46px);
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: clamp(28px, 4vw, 52px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, #0c1a27, #09141f);
  box-shadow: var(--shadow);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.contact-intro h3 {
  margin: 10px 0 14px;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -.03em;
}

.contact-intro p {
  margin: 0;
  color: var(--muted);
  font-size: .98rem;
}

.contact-points {
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
}

.contact-points li {
  position: relative;
  padding-inline-start: 22px;
  color: #9ab0bc;
  font-size: .86rem;
}

.contact-points li::before {
  content: "→";
  position: absolute;
  inset-inline-start: 0;
  color: var(--cyan);
}

.contact-form {
  display: grid;
  gap: 16px;
  align-content: start;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-form .field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.contact-form label {
  color: #c4d4dc;
  font-size: .78rem;
  font-weight: 750;
}

.contact-form .optional {
  color: #5d7687;
  font-weight: 500;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-height: 45px;
  padding: 11px 12px;
  border: 1px solid #243b4e;
  border-radius: 9px;
  outline: none;
  background: #08131d;
  color: #deedf3;
  font: inherit;
  font-size: .92rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.contact-form textarea {
  min-height: 128px;
  resize: vertical;
  line-height: 1.6;
}

.contact-form select { appearance: auto; }

/* A dark <select> keeps a WHITE native dropdown unless the options are styled
   too — the list is drawn by the OS, not by the select's own background. */
.contact-form select option {
  background: #08131d;
  color: #deedf3;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: #435b6c; }

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: rgba(36, 231, 244, .5);
  box-shadow: 0 0 0 3px rgba(36, 231, 244, .06);
  background: #0a1721;
}

.contact-form .check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
}

.contact-form .check-row input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin-top: 3px;
  padding: 0;
  accent-color: var(--cyan);
}

.contact-form .check-row a {
  color: #9eeeff;
  text-decoration: underline;
  text-decoration-color: rgba(36, 231, 244, .22);
  text-underline-offset: 2px;
}

/* Honeypot. Hidden from people, still filled in by form-spraying bots.
   Not display:none — some bots skip those.
   NOT left:-9999px either: in LTR the viewport clips that, but under dir="rtl"
   it becomes real overflow — it pushed the Arabic page to a scrollWidth of
   11279px and the whole layout scrolled off screen. Clip instead of displace. */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.contact-actions .btn[disabled] {
  opacity: .55;
  pointer-events: none;
}

.contact-note {
  color: var(--dim);
  font-size: .76rem;
}

.contact-status {
  margin: 0;
  min-height: 1px;
  font-size: .86rem;
}

.contact-status.ok { color: var(--green); }
.contact-status.bad { color: var(--red); }

/* ---------- right-to-left (Arabic) ---------- */

/* The master stylesheet was written for LTR, so only the handful of places that
   hard-code a side need flipping. Everything else is flex/grid and mirrors itself
   once dir="rtl" is on <html>. */
[dir="rtl"] body { text-align: right; }

[dir="rtl"] .console-line,
[dir="rtl"] .query-row,
[dir="rtl"] .evidence-footer,
[dir="rtl"] .footer-bottom { direction: rtl; }

/* Identifiers, hashes and addresses are read left-to-right in every language. */
[dir="rtl"] code,
[dir="rtl"] .selector-chip code,
[dir="rtl"] table td:not([data-i18n]) {
  direction: ltr;
  unicode-bidi: embed;
  text-align: left;
}

[dir="rtl"] .arch-label,
[dir="rtl"] .section-kicker { letter-spacing: normal; }

@media (max-width: 1000px) {
  .contact-panel { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .field-row { grid-template-columns: 1fr; }
  .lang-panel { right: auto; left: 0; }
}

/* Below 680px the master stylesheet sets .header-actions to display:none, which
   would take the language switcher with it. Sign In / Get IntelFortes are both
   repeated inside the mobile menu, so bring the bar back and keep only the
   switcher in it. */
@media (max-width: 680px) {
  .header-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
  }

  .header-actions > .btn { display: none; }

  .lang-switcher { margin-right: 0; }

  .lang-switcher > summary { padding: 7px 10px; }
}
