/* ==========================================================================
   RoTunneling — facelift.css  (v2: tokens + base; components in components.css)
   Evolutionary visual/UX refresh loaded AFTER legacy stylesheets.
   Prefer overrides over rewrites; keeps existing markup/JS hooks intact.
   ========================================================================== */

:root {
  /* Brand (from logo): red / blue / yellow / green, on a dark header */
  --rt-red: #E4483B;
  --rt-blue: #2E7FD1;
  --rt-yellow: #F0B429;
  --rt-green: #4E7A1E; /* darkened from legacy #88b73e so white text clears 4.5:1 */
  --rt-green-dark: #3E6117;
  --rt-green-bright: #88B73E; /* logo green: decorative only (stripe), never text */
  --rt-ink: #182028;      /* body text on light */
  --rt-ink-soft: #4B5560; /* 7.3:1 on white, 6.7:1 on --rt-canvas */
  --rt-header-bg: #12161b; /* deepened, still matches existing #151718 */
  --rt-canvas: #F4F6F8;   /* quiet surface (table heads, sub-groups) */
  --rt-line: #E1E6EB;     /* hairlines */
  --rt-line-strong: #8A949E; /* input/control borders: 3.08:1 non-text contrast on white (WCAG 1.4.11) */
  --rt-border: rgba(15, 23, 30, 0.12);
  --rt-focus: #1F6FBF;    /* 5.1:1 on white */
  --rt-error: #B42318;    /* 6.6:1 on white, 5.9:1 on error tint */
  --rt-success: #4E7A1E;
  --rt-radius: 6px;
  --rt-radius-lg: 10px;
  --rt-shadow: 0 2px 10px rgba(15, 23, 30, 0.08);
  --rt-shadow-lg: 0 12px 32px rgba(15, 23, 30, 0.14);
  --rt-space-1: 4px;
  --rt-space-2: 8px;
  --rt-space-3: 16px;
  --rt-space-4: 24px;
  --rt-space-5: 40px;
  --rt-content-measure: 70ch;
  /* UI3 type scale (body 16/1.6, ~1.2 ratio) + content widths */
  --rt-fs-xs: 13px;
  --rt-fs-sm: 14px;
  --rt-fs-body: 16px;
  --rt-fs-lead: 18px;
  --rt-fs-h4: 18px;
  --rt-fs-h3: 20px;
  --rt-fs-h2: clamp(22px, 2.2vw, 26px);
  --rt-fs-h1: clamp(26px, 3vw, 34px);
  --rt-lh-body: 1.6;
  --rt-lh-tight: 1.25;
  --rt-w-text: 760px;   /* single-column reading pages */
  --rt-section-y: 48px; /* vertical rhythm of page sections */
}

/* Respect reduced motion globally: never rely on a delay/timeout for any
   functional behaviour — this only trims decorative motion. */
@media (prefers-reduced-motion: reduce) {
  * ,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------
   Base typography scale & spacing (evolutionary, keeps Open Sans stack)
   -------------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-size: var(--rt-fs-body);
  line-height: var(--rt-lh-body);
  color: var(--rt-ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Open Sans', Arial, sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--rt-ink);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: clamp(19px, 2.4vw, 24px); }
h4 { font-size: clamp(17px, 2vw, 20px); }

p { max-width: var(--rt-content-measure); }

/* Sitewide link color darkened from legacy #81B134 (2.53:1 on white) to
   clear WCAG AA 4.5:1 for normal-size body text links. */
a { color: var(--rt-green); }
a:hover { color: var(--rt-green-dark); }

/* No horizontal scroll anywhere */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
img, video, iframe { max-width: 100%; height: auto; }

/* --------------------------------------------------------------------
   Focus visibility (WCAG) — never remove focus rings, only restyle them
   -------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.order:focus-visible,
.selectboxit:focus-visible {
  outline: 3px solid var(--rt-focus);
  outline-offset: 2px;
  border-radius: var(--rt-radius);
}

/* Fallback for browsers without :focus-visible support */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--rt-focus);
  outline-offset: 1px;
}

/* --------------------------------------------------------------------
   Header / nav — keep dark tone, improve contrast, spacing, tap targets
   -------------------------------------------------------------------- */
div#topBar {
  background-color: var(--rt-header-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

div#topBar nav ul li a {
  color: #C7CDD3;
  font-weight: 600;
  letter-spacing: 0.01em;
}

div#topBar nav ul li a:hover,
div#topBar nav ul li a:focus-visible {
  color: #FFFFFF;
  border-bottom-color: var(--rt-green);
}

div#topBar nav ul li a.login {
  background: var(--rt-green);
  border-radius: var(--rt-radius);
  font-weight: 700;
}

div#topBar nav ul li a.login:hover {
  background: var(--rt-green-dark);
  text-decoration: none;
}

/* Mobile nav: keep JS-driven slideToggle behaviour (#mobileNav / #mobileNavigation),
   just raise tap targets and contrast. Legacy CSS hides these with
   `display:none` above 768px (div#topBar #mobileNav,.mobileHome,nav#mobileNavigation{display:none})
   — scope every override to that same breakpoint so the toggle never
   reappears (and breaks the desktop float layout) at tablet/desktop widths. */
@media screen and (max-width: 768px) {
  div#topBar #mobileNav {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  nav#mobileNavigation ul li a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  div#topBar .mobileHome {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Legacy style.css gives .mobileHome z-index:-250; that was inert while the
     link was a block, but as a flex item the <img> honours z-index and slides
     behind the dark header bar (logo invisible on mobile). */
  div#topBar img.mobileHome {
    z-index: auto;
  }
}

/* --------------------------------------------------------------------
   Hero slider caption (nivoSlider clones #htmlcaption markup into
   .nivo-caption over the header image). The global `h1{color:var(--rt-ink)}`
   rule above is a direct property on the element, so it beats the
   inherited white from `.nivo-caption{color:#fff}` and made the headline
   dark-on-dark; restore white + add text-shadow for AA over the photo,
   and tighten line-height so the last line clears #slideControls's dots
   (bottom:70px) instead of overlapping it.
   -------------------------------------------------------------------- */
.nivo-caption,
.nivo-html-caption,
.nivo-caption h1,
.nivo-caption p,
.nivo-html-caption h1,
.nivo-html-caption p {
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

.nivo-caption h1,
.nivo-html-caption h1 {
  line-height: 1.25;
}

.nivo-caption p,
.nivo-html-caption p {
  line-height: 1.4;
  margin: 0 0 6px;
}

.nivo-caption {
  padding-bottom: 90px;
}

/* --------------------------------------------------------------------
   Buttons & CTAs — consistent radius, hover/active/disabled states
   -------------------------------------------------------------------- */
.btn,
a.order,
.order {
  border-radius: var(--rt-radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover,
a.order:hover {
  transform: translateY(-1px);
  box-shadow: var(--rt-shadow);
}

.btn:active,
a.order:active {
  transform: translateY(0);
}

.btn[disabled],
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --------------------------------------------------------------------
   Forms — labels, focus, error states (keeps Bootstrap 3 classes/JS hooks)
   -------------------------------------------------------------------- */
label {
  font-weight: 600;
  color: var(--rt-ink);
  margin-bottom: var(--rt-space-1);
}

.form-control {
  border-radius: var(--rt-radius);
  border-color: var(--rt-border);
  min-height: 44px;
  box-shadow: none;
}

.form-control:focus {
  border-color: var(--rt-focus);
  box-shadow: 0 0 0 3px rgba(46, 127, 209, 0.18);
}

.has-error .form-control {
  border-color: var(--rt-error);
}

.has-error .control-label,
.has-error .help-block {
  color: var(--rt-error);
  font-weight: 600;
}

.help-block {
  font-size: 13px;
  margin-top: var(--rt-space-1);
}

/* Billing-address autocomplete hint: darkened from legacy #777 (4.47:1,
   just under AA) to a verified 5.74:1. billing_address.css loads after this
   stylesheet on register/account pages, so !important is needed to win the
   equal-specificity, later-in-DOM cascade. */
.rt-billing-hint {
  color: #666666 !important;
}

/* Bootstrap's default .btn-success (#5cb85c on white text, 2.48:1) darkened
   to a verified 4.99:1; used on guide/plan CTA links. */
.btn-success {
  background-color: #3e7d3e;
  border-color: #356b35;
}

/* Keep Turnstile / selectBoxIt / third-party widgets untouched in size,
   only make sure nothing clips them. */
.cf-turnstile {
  max-width: 100%;
  min-height: 65px;
}

/* --------------------------------------------------------------------
   Pricing cards (index.tpl #packageWrapper) — clearer hierarchy
   -------------------------------------------------------------------- */
#packageWrapper {
  padding-top: var(--rt-space-3);
}

#packageWrapper > .row > [class*="col-"] {
  margin-bottom: var(--rt-space-4);
}

#packageWrapper div.packageHeader {
  border-radius: var(--rt-radius-lg) var(--rt-radius-lg) 0 0;
  box-shadow: var(--rt-shadow);
  font-weight: 700;
}

#packageWrapper ul.packageBody {
  border-radius: 0 0 var(--rt-radius-lg) var(--rt-radius-lg);
  overflow: hidden;
  box-shadow: var(--rt-shadow);
}

#packageWrapper ul.packageBody li.last {
  padding: var(--rt-space-3);
}

#packageWrapper ul.packageBody li.last a.order {
  width: 100%;
  border-radius: var(--rt-radius);
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* Emphasize the featured plan (ribboned card) without changing markup */
#packageWrapper .col-md-3:has(.ribbon.blue) div.packageHeader,
#packageWrapper .col-md-3:has(.ribbon.green) div.packageHeader {
  box-shadow: var(--rt-shadow-lg);
}

/* Ribbon colors darkened vs. legacy (#f58a20/#2583C3/#88b73e) so white text
   clears WCAG AA 4.5:1 at the ribbon's 10px bold size (axe-verified). */
#packageWrapper .ribbon.orange { background-color: #B35400; }
#packageWrapper .ribbon.blue { background-color: #1E5F8C; }
#packageWrapper .ribbon.green { background-color: #4E7A1E; }

/* --------------------------------------------------------------------
   Guide / article readable content (pagina.tpl, articol.tpl)
   -------------------------------------------------------------------- */
.rt-readable {
  max-width: var(--rt-content-measure);
}

.rt-readable p,
.rt-readable li {
  line-height: 1.7;
}

.rt-readable h2,
.rt-readable h3 {
  margin-top: var(--rt-space-4);
  margin-bottom: var(--rt-space-2);
}

.rt-readable pre,
.rt-readable code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: #f4f6f8;
  border: 1px solid var(--rt-border);
  border-radius: var(--rt-radius);
}

.rt-readable code {
  padding: 2px 6px;
  font-size: 0.9em;
}

.rt-readable pre {
  padding: var(--rt-space-3);
  overflow-x: auto;
  line-height: 1.5;
}

.rt-readable pre code {
  border: none;
  background: none;
  padding: 0;
}

.rt-readable ol,
.rt-readable ul {
  padding-left: 1.4em;
}

/* Guide "step" numbered lists read as steps only where content already
   uses ordered lists — no numbering added where content is not a sequence. */
.rt-readable ol > li {
  margin-bottom: var(--rt-space-2);
}

/* --------------------------------------------------------------------
   Cookie consent bar — reserve space to avoid layout shift (CLS) and
   raise the third-party widget's default text/button contrast to AA.
   -------------------------------------------------------------------- */
.cc-window {
  min-height: 56px;
}

.cc_message,
.cc-message {
  color: #5b5b5b;
}

/* Keep the bar on one line at tablet/desktop widths instead of wrapping the
   message under the button (cookieconsent2's "light-top" theme lays these
   out with floats, which wrap once the button grows to a 44px tap target). */
@media (min-width: 769px) {
  .cc-window {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }
  .cc-message,
  .cc_message {
    flex: 1 1 auto;
    margin-right: var(--rt-space-3);
    white-space: normal;
  }
  .cc-compliance {
    flex: 0 0 auto;
  }
}

/* Brand-consistent button: cookieconsent2's own "light-top" theme ships a
   yellow accent by default; keep that brand color (var(--rt-yellow), same
   hue as the pricing ribbon/logo yellow) instead of introducing a new blue,
   with dark text for a verified AA-passing contrast. tingle.css (T&C modal
   on register/account pages) loads after this stylesheet, so !important is
   needed to win the equal-specificity, later-in-DOM cascade. */
.cc_btn,
.cc-btn,
.tingle-btn--primary {
  background-color: var(--rt-yellow) !important;
  color: #1a1400 !important;
  white-space: nowrap;
}

body {
  /* Reserve room so the fixed cookie bar never overlaps final content
     on short viewports; harmless no-op once dismissed. */
  scroll-padding-bottom: 64px;
}

/* T&C modal (tingle.js, register.tpl) must render above the fixed cookie
   bar: cookieconsent2 sets its own inline z-index (very high, fixed to the
   top of the viewport) which otherwise covers the modal's title/close
   button on short/narrow viewports. tingle.css's own z-index:1000 loses to
   that, so raise it explicitly; !important needed since tingle.css loads
   after this stylesheet on register.tpl. */
.tingle-modal {
  z-index: 999999999 !important;
}

.tingle-modal__close {
  z-index: 1000000000 !important;
}

/* --------------------------------------------------------------------
   404 page
   -------------------------------------------------------------------- */
.rt-404 {
  text-align: center;
  padding: var(--rt-space-5) var(--rt-space-3);
}

.rt-404 h1 {
  font-size: clamp(48px, 10vw, 96px);
  color: var(--rt-blue);
  margin-bottom: var(--rt-space-2);
}

/* --------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------- */
#footer, footer {
  line-height: 1.6;
}

/* --------------------------------------------------------------------
   Responsive safety nets at key breakpoints (360/390/768/1024/1366)
   -------------------------------------------------------------------- */
@media (max-width: 480px) {
  .container { width: 100%; padding-left: var(--rt-space-3); padding-right: var(--rt-space-3); }
  h1 { font-size: 26px; }
  #packageWrapper ul.packageBody li { padding: 14px; }
}

@media (min-width: 481px) and (max-width: 768px) {
  .container { width: 100%; }
}

/* Table-friendly guide content on small screens */
@media (max-width: 600px) {
  .rt-readable table { display: block; overflow-x: auto; max-width: 100%; }
}

/* T&C modal: keep the "Da, Accept" footer always visible while the terms scroll.
   tingle's sticky footer is position:fixed inside a transformed .tingle-modal-box,
   so it scrolled away with the content. Instead the box is a fixed-height flex column:
   only the content scrolls, the footer stays at the bottom of the box. */
.tingle-modal.tingle-modal--visible {
  overflow: hidden !important;
}
.tingle-modal .tingle-modal-box {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 80px);
  max-height: calc(100dvh - 80px);
  margin-top: 40px;
  margin-bottom: 40px;
}
.tingle-modal .tingle-modal-box__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.tingle-modal .tingle-modal-box__footer,
.tingle-modal .tingle-modal-box__footer--sticky {
  position: static !important;
  flex: 0 0 auto;
  bottom: auto;
  width: auto !important;
  box-shadow: 0 -6px 12px -8px rgba(0, 0, 0, .25);
}
@media (max-width: 540px) {
  .tingle-modal .tingle-modal-box {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin-top: 12px;
    margin-bottom: 12px;
  }
}
