/* Shared public shell refinements.
 * Kept in the plugin so the common header/account/chat behavior remains
 * consistent on theme pages, indicator/chart routes and cached public pages.
 */

.dn-home-account-menu__close {
  display: none !important;
}

.dn-home-header .dn-home-login,
.dn-home-header .dn-home-login:link,
.dn-home-header .dn-home-login:visited {
  border-color: #b9cdf7 !important;
  background: #fff !important;
  color: #1769ff !important;
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .dn-home-header__inner {
    gap: 16px;
  }

  .dn-home-header .dn-home-shell {
    width: calc(100% - 48px);
  }

  .dn-home-header .dn-home-logo {
    width: 198px;
    flex-basis: 198px;
  }

  .dn-home-header .dn-home-nav {
    gap: 16px;
  }

  .dn-home-header .dn-home-nav a {
    font-size: 13px;
  }

  .dn-home-header .dn-home-login {
    width: 92px;
  }

  .dn-home-header .dn-home-trial {
    width: 138px;
  }
}

/* Desktop product routes may tint the shared header, but must keep the same
 * geometry as the public shell reference. Keep this reset here so the large
 * indicator/chart stylesheets do not need to duplicate the shared component. */
@media (min-width: 1200px) {
  body.dnai-indicator-route .dn-home-header,
  body.dnai-indicator-route .dn-home-header__inner,
  body.dnai-chart-route .dn-home-header,
  body.dnai-chart-route .dn-home-header__inner {
    height: 70px !important;
    min-height: 70px !important;
  }

  body.dnai-indicator-route .dn-home-header__inner,
  body.dnai-indicator-route .dn-home-header .dn-home-shell,
  body.dnai-chart-route .dn-home-header__inner,
  body.dnai-chart-route .dn-home-header .dn-home-shell {
    width: min(var(--dn-shell, 1312px), calc(100% - 56px)) !important;
    max-width: none !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
  }

  body.dnai-indicator-route .dn-home-header__inner {
    gap: 28px !important;
  }

  body.dnai-indicator-route .dn-home-logo {
    width: 220px !important;
    height: 44px !important;
    flex: 0 0 220px !important;
  }

  body.dnai-indicator-route .dn-home-logo__mark {
    top: 0 !important;
    left: 0 !important;
    width: 38px !important;
    height: 38px !important;
    transform: none !important;
  }

  body.dnai-indicator-route .dn-home-logo__copy {
    top: 3px !important;
    right: auto !important;
    left: 50px !important;
    width: 166px !important;
    transform: none !important;
  }

  body.dnai-indicator-route .dn-home-nav {
    gap: 30px !important;
  }

  body.dnai-chart-route .dn-home-nav a.is-active,
  body.dnai-chart-route .dn-home-nav a.is-active:link,
  body.dnai-chart-route .dn-home-nav a.is-active:visited {
    color: #60a5fa !important;
  }
}

@media (max-width: 1023px) {
  .dn-home-header .dn-home-trial--desktop {
    display: none !important;
  }
}

.dn-home-account-menu__profile-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dn-home-account-menu__profile-copy strong,
.dn-home-account-menu__profile-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dn-home-account-menu__profile-copy small {
  color: #64748b;
}

.dn-home-account-menu__badges {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.dn-home-account-menu__badge {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  padding: 3px 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf2ff;
  color: #145fc1;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dn-home-account-menu__badge--ib {
  background: #dcfce7;
  color: #15803d;
}

body.dnai-indicator-route .dn-home-account-menu__profile-copy small {
  color: #9fb1c5;
}

/* BOT MT5 consultation form. These rules are intentionally scoped so they do
 * not alter other public forms owned by parallel tasks. */
.dn-simple-page--bot-lead .dn-simple-page__contact-card--lead {
  display: grid;
  box-sizing: border-box;
  width: 100%;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  align-items: center;
  gap: clamp(32px, 5vw, 58px);
  text-align: left;
}

.dn-simple-page--bot-lead .dn-simple-page__lead-copy .dn-simple-page__icon,
.dn-simple-page--bot-lead .dn-simple-page__lead-copy h1,
.dn-simple-page--bot-lead .dn-simple-page__lead-copy .dn-simple-page__description,
.dn-simple-page--bot-lead .dn-simple-page__lead-copy .dn-simple-page__supporting {
  margin-inline: 0;
}

.dn-simple-page--bot-lead .dn-simple-page__lead-copy h1 {
  font-size: clamp(34px, 3.5vw, 48px);
}

.dn-simple-page--bot-lead .dn-simple-page__lead-copy .dn-simple-page__actions {
  justify-content: flex-start;
}

.dn-simple-page--bot-lead .dn-simple-page__lead-form {
  display: grid;
  min-width: 0;
  gap: 17px;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--dn-public-border, #d8e2f0);
  border-radius: 18px;
  background: #f7faff;
  box-shadow: 0 14px 38px rgba(29, 72, 132, 0.08);
}

.dn-simple-page--bot-lead .dn-simple-page__form-heading {
  margin-bottom: 2px;
}

.dn-simple-page--bot-lead .dn-simple-page__form-heading .dn-simple-page__eyebrow {
  margin-bottom: 6px;
}

.dn-simple-page--bot-lead .dn-simple-page__form-heading h2 {
  margin: 0;
  color: var(--dn-public-text-primary, #0f172a) !important;
  font-size: 25px;
  font-weight: 750;
  line-height: 1.3;
}

.dn-simple-page--bot-lead .dn-simple-page__form-heading > p:last-child {
  margin: 8px 0 0;
  color: var(--dn-public-text-muted, #64748b);
  font-size: 14px;
  line-height: 1.55;
}

.dn-simple-page--bot-lead .dn-simple-page__lead-form > label:not(.dn-simple-page__trap) {
  display: grid;
  gap: 7px;
  color: var(--dn-public-text-secondary, #334155);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.dn-simple-page--bot-lead .dn-simple-page__lead-form input:not([type="hidden"]) {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid var(--dn-public-border-strong, #b8c7da);
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--dn-public-text-primary, #0f172a);
  font: inherit;
  font-weight: 500;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.dn-simple-page--bot-lead .dn-simple-page__lead-form input:not([type="hidden"]):focus {
  border-color: var(--dn-public-primary, #1769ff);
  box-shadow: 0 0 0 3px rgba(15, 94, 234, 0.14);
}

.dn-simple-page--bot-lead .dn-simple-page__trap {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.dn-simple-page--bot-lead .dn-simple-page__captcha {
  min-height: 78px;
  overflow: hidden;
}

.dn-simple-page--bot-lead .dn-simple-page__captcha-note,
.dn-simple-page--bot-lead .dn-simple-page__form-status,
.dn-simple-page--bot-lead .dn-simple-page__privacy {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.dn-simple-page--bot-lead .dn-simple-page__captcha-note {
  padding: 10px 12px;
  border: 1px solid #f2d28b;
  border-radius: 8px;
  background: #fff8e7;
  color: #7a4b00;
}

.dn-simple-page--bot-lead .dn-simple-page__form-status {
  padding: 11px 12px;
  border-radius: 8px;
  font-weight: 650;
}

.dn-simple-page--bot-lead .dn-simple-page__form-status--success {
  border: 1px solid #9ed8b6;
  background: #ecfdf3;
  color: #17663a;
}

.dn-simple-page--bot-lead .dn-simple-page__form-status--error {
  border: 1px solid #f2b8b5;
  background: #fff1f0;
  color: #9b2c25;
}

.dn-simple-page--bot-lead .dn-simple-page__submit {
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid var(--dn-public-primary, #1769ff);
  border-radius: 10px;
  background: var(--dn-public-primary, #1769ff);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.dn-simple-page--bot-lead .dn-simple-page__submit:hover,
.dn-simple-page--bot-lead .dn-simple-page__submit:focus-visible {
  border-color: var(--dn-public-primary-hover, #0f5eea);
  background: var(--dn-public-primary-hover, #0f5eea);
  box-shadow: 0 8px 22px rgba(23, 105, 255, 0.24);
}

.dn-simple-page--bot-lead .dn-simple-page__submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.dn-simple-page--bot-lead .dn-simple-page__privacy {
  color: var(--dn-public-text-muted, #64748b);
  text-align: center;
}

@media (max-width: 767px) {
  .dn-home-header .dn-home-login,
  .dn-home-header .dn-home-login:link,
  .dn-home-header .dn-home-login:visited {
    border-color: #1769ff !important;
    background: #1769ff !important;
    color: #fff !important;
  }

  .dn-home-account-menu__close {
    display: grid !important;
  }

  .dn-home-account-menu__profile {
    align-items: flex-start !important;
  }

  .dn-home-account-menu__profile-copy {
    padding-top: 2px;
  }

  .dn-home-header__actions {
    min-width: 0;
    gap: 8px !important;
  }

  .dn-home-logo {
    min-width: 0;
  }

  .dn-home-logo__copy {
    min-width: 0;
  }

  .dn-home-logo__copy strong,
  .dn-home-logo__copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body:not(.wp-admin) .dnai-ai-chat,
  html body:not(.wp-admin) .dnai-ai-chat[data-edge="left"] {
    top: calc(var(--dnai-visual-viewport-top, 0px) + max(6px, env(safe-area-inset-top))) !important;
    right: 4px !important;
    bottom: auto !important;
    left: 4px !important;
    width: auto !important;
    height: calc(var(--dnai-visual-viewport-height, 100dvh) - var(--dn-mobile-nav-height, 70px) - env(safe-area-inset-bottom) - max(12px, env(safe-area-inset-top))) !important;
    max-height: none !important;
    border-radius: 20px 20px 10px 10px !important;
    transform-origin: center bottom;
  }

  html body:not(.wp-admin) .dnai-ai-chat__body {
    min-height: 0 !important;
  }

  html body:not(.wp-admin) .dnai-ai-chat__messages {
    min-height: 0 !important;
  }

  html body:not(.wp-admin) .dnai-ai-chat__composer {
    flex: 0 0 auto;
  }

  .dn-simple-page--bot-lead .dn-simple-page__lead-form {
    padding: 24px 20px;
    text-align: left;
  }

  .dn-simple-page--bot-lead .dn-simple-page__contact-card--lead {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    text-align: center;
  }

  .dn-simple-page--bot-lead .dn-simple-page__lead-copy .dn-simple-page__icon,
  .dn-simple-page--bot-lead .dn-simple-page__lead-copy .dn-simple-page__description,
  .dn-simple-page--bot-lead .dn-simple-page__lead-copy .dn-simple-page__supporting {
    margin-inline: auto;
  }

  .dn-simple-page--bot-lead .dn-simple-page__lead-copy h1 {
    margin-inline: auto;
  }

  .dn-simple-page--bot-lead .dn-simple-page__lead-copy .dn-simple-page__actions {
    justify-content: center;
  }
}

@media (max-width: 374px) {
  .dn-home-header__inner {
    gap: 7px !important;
    padding-inline: 12px !important;
  }

  .dn-home-logo__mark {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
  }

  .dn-home-logo__copy strong {
    font-size: 16px !important;
  }

  .dn-home-logo__copy small {
    max-width: 145px;
    font-size: 9px !important;
  }

  .dn-home-login {
    min-width: 70px !important;
    padding-inline: 8px !important;
  }

  .dn-home-menu-toggle {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    flex-basis: 40px !important;
  }

  .dn-simple-page--bot-lead .dn-simple-page__captcha {
    height: 60px;
    min-height: 60px;
  }

  .dn-simple-page--bot-lead .dn-simple-page__captcha .g-recaptcha {
    width: 304px;
    transform: scale(0.75);
    transform-origin: 0 0;
  }
}

@media (max-width: 339px) {
  .dn-home-logo__copy small {
    display: none;
  }

  .dn-simple-page--bot-lead .dn-simple-page__captcha {
    height: 50px;
    min-height: 50px;
  }

  .dn-simple-page--bot-lead .dn-simple-page__captcha .g-recaptcha {
    transform: scale(0.62);
  }
}
