/* =====================================================================
   Trading Time — Registration form + SMS verification UI
   Light theme, matching the main site (white bg, #0071E3 CTA, Roboto).
   All custom styles for the lead form, popups, preloader and
   intl-tel-input overrides live here.
   ===================================================================== */

:root {
  --tt-bg: #ffffff;
  --tt-accent: #0071e3;
  --tt-accent-hover: #0060c1;
  --tt-text: #010000;
  --tt-muted: #6b7280;
  --tt-border: #e5e5e5;
  --tt-error: #ef4444;
  --tt-radius: 14px;
  --tt-radius-pill: 32px;
}

/* ------------------------------------------------------------------ */
/* Registration form (on page, in hero)                               */
/* ------------------------------------------------------------------ */
.reg-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 24.2857rem; /* ~340px, aligns with hero text width */
  margin: 0;
  font-family: "Roboto-Regular", "Roboto", Arial, sans-serif;
}

.reg-form .reg-input {
  width: 100%;
  height: 3.85714rem; /* ~54px */
  padding: 0 1.28571rem;
  font-family: "Roboto-Regular", "Roboto", Arial, sans-serif;
  font-size: 1.14286rem;
  color: var(--tt-text);
  background: #ffffff;
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.reg-form .reg-input::placeholder {
  color: var(--tt-muted);
  opacity: 1;
}

.reg-form .reg-input:focus {
  border-color: var(--tt-accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.reg-form .reg-submit {
  width: 100%;
  height: 4rem;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Roboto-Medium", "Roboto", Arial, sans-serif;
  font-size: 1.28571rem;
  color: #ffffff;
  background-color: var(--tt-accent);
  border: 0;
  border-radius: var(--tt-radius-pill);
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.reg-form .reg-submit:hover {
  background-color: var(--tt-accent-hover);
}

/* Registration form lives inside the popup -> fill its width */
.popup_content .reg-form {
  max-width: 100%;
  margin: 0;
  text-align: left;
}

.reg-form .reg-consent {
  margin: 4px 0 0;
  font-family: "Roboto-Regular", "Roboto", Arial, sans-serif;
  font-size: 0.85714rem;
  line-height: 1.4;
  color: var(--tt-muted);
  text-align: center;
}

.reg-form .reg-consent a {
  color: var(--tt-accent);
  text-decoration: none;
}

.reg-form .reg-consent a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/* jQuery Validate error labels                                        */
/* ------------------------------------------------------------------ */
label.error {
  display: block;
  margin: 6px 0 0 2px;
  font-family: "Roboto-Regular", "Roboto", Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--tt-error);
  background: transparent;
}

/* Pink background on invalid inputs -> keep placeholder readable */
input.error {
  border-color: var(--tt-error) !important;
}

input.error::placeholder {
  color: #d85030;
  opacity: 0.6;
}

/* ------------------------------------------------------------------ */
/* Popups (modal windows)                                             */
/* ------------------------------------------------------------------ */
.popup {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 12, 16, 0.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
}

.popup_content {
  position: relative;
  background: var(--tt-bg);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 440px;
  padding: 44px 36px 36px;
  font-family: "Roboto-Regular", "Roboto", Arial, sans-serif;
  text-align: center;
}

.close_popup {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.18s ease;
}

.close_popup:hover {
  opacity: 1;
}

.popup_content h3 {
  margin: 0 0 12px;
  font-family: "Montserrat-ExtraBold", "Roboto", Arial, sans-serif;
  font-weight: 800;
  font-size: 1.85714rem;
  line-height: 1.2;
  color: var(--tt-text);
}

.popup_content p {
  margin: 0 0 22px;
  font-size: 1.07143rem;
  line-height: 1.45;
  color: var(--tt-muted);
}

.popup_content p #currPhone {
  color: var(--tt-text);
  font-family: "Roboto-Bold", "Roboto", Arial, sans-serif;
  white-space: nowrap;
}

/* Inputs inside popups */
.popup_content .t-input {
  width: 100%;
  height: 3.85714rem;
  padding-left: 1.28571rem;
  padding-right: 1.28571rem;
  font-family: "Roboto-Regular", "Roboto", Arial, sans-serif;
  font-size: 1.14286rem;
  color: var(--tt-text);
  background: #ffffff;
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.popup_content .t-input::placeholder {
  color: var(--tt-muted);
  opacity: 1;
}

.popup_content .t-input:focus {
  border-color: var(--tt-accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

/* Submit button inside popups */
.popup_content .t-submit {
  width: 100%;
  height: 4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Roboto-Medium", "Roboto", Arial, sans-serif;
  font-size: 1.28571rem;
  color: #ffffff;
  background-color: var(--tt-accent);
  border: 0;
  border-radius: var(--tt-radius-pill);
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.popup_content .t-submit:hover {
  background-color: var(--tt-accent-hover);
}

.popup_content .jhuy {
  display: block;
  text-align: left;
  margin-bottom: 18px;
}

.flex_uh {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.change_phone {
  color: var(--tt-muted);
  font-size: 1rem;
  cursor: pointer;
  border-bottom: 1px dashed currentColor;
  line-height: 1.2;
  transition: color 0.18s ease;
}

.change_phone:hover {
  color: var(--tt-accent);
}

/* "Неверный код" — visibility is controlled by JS (inline display).
   Hidden by default here; do NOT set display in the .popup_sms scope (see below). */
#codeError {
  display: none;
  margin: 8px 0 0;
  font-family: "Roboto-Regular", "Roboto", Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--tt-error);
}

/* Reposition jQuery Validate errors inside popups (do not overlap inputs).
   IMPORTANT: #codeError rule must NOT include `display` (controlled by JS). */
.popup_sms_change #phoneConfirm-error,
.popup_sms #sms-code-error {
  position: relative !important;
  display: block !important;
  margin: 6px 0 0 2px !important;
  font-size: 0.8rem;
  color: var(--tt-error);
  background: transparent !important;
}

.popup_sms #codeError {
  position: relative !important;
  margin: 8px 0 0 !important;
  font-size: 0.85rem;
  color: var(--tt-error);
  background: transparent !important;
}

/* ------------------------------------------------------------------ */
/* Preloader (full-screen spinner)                                    */
/* ------------------------------------------------------------------ */
#preloader {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.86);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

#preloader[style*="block"],
#preloader[style*="flex"] {
  display: flex !important;
}

#floatingCirclesG {
  position: relative;
  width: 58px;
  height: 58px;
  transform: scale(0.9);
}

.f_circleG {
  position: absolute;
  height: 10px;
  width: 10px;
  border-radius: 50%;
  background-color: var(--tt-accent);
  animation: f_fadeG 1.04s infinite linear;
}

#frotateG_01 { left: 0; top: 24px; animation-delay: 0.39s; }
#frotateG_02 { left: 7px; top: 7px; animation-delay: 0.52s; }
#frotateG_03 { left: 24px; top: 0; animation-delay: 0.65s; }
#frotateG_04 { right: 7px; top: 7px; animation-delay: 0.78s; }
#frotateG_05 { right: 0; top: 24px; animation-delay: 0.91s; }
#frotateG_06 { right: 7px; bottom: 7px; animation-delay: 1.04s; }
#frotateG_07 { left: 24px; bottom: 0; animation-delay: 1.17s; }
#frotateG_08 { left: 7px; bottom: 7px; animation-delay: 1.30s; }

@keyframes f_fadeG {
  0% { opacity: 1; }
  100% { opacity: 0.25; }
}

/* ------------------------------------------------------------------ */
/* intl-tel-input overrides (light theme)                             */
/* ------------------------------------------------------------------ */
.iti {
  width: 100%;
  display: block;
}

/* Flag pushes text right -> guarantee padding-left regardless of shorthand */
.iti .reg-input,
.iti .t-input,
.popup_content .iti .t-input {
  padding-left: 52px !important;
}

.iti__country-list {
  border-radius: 12px;
  border: 1px solid var(--tt-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  font-family: "Roboto-Regular", "Roboto", Arial, sans-serif;
  font-size: 0.95rem;
  color: var(--tt-text);
}

.iti__country.iti__highlight {
  background-color: rgba(0, 113, 227, 0.08);
}

.iti__selected-flag {
  border-radius: var(--tt-radius) 0 0 var(--tt-radius);
}

/* Keep validation errors inside .iti absolutely positioned so the flag
   stays vertically centered on the input (see instruction 8.7). */
.iti #phone-error,
.iti #phoneConfirm-error {
  position: absolute !important;
  left: 0;
  top: 100%;
  margin: 4px 0 0 !important;
}

/* Parent of phone fields needs room for the error text below */
.reg-form .jhuy,
.popup_content .jhuy {
  position: relative;
}

/* ------------------------------------------------------------------ */
/* Mobile adaptation                                                  */
/* ------------------------------------------------------------------ */
@media (max-width: 768px) {
  .reg-form {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .reg-form .reg-input,
  .popup_content .t-input {
    height: 52px;
    font-size: 16px; /* prevents iOS zoom-on-focus */
  }

  .reg-form .reg-submit,
  .popup_content .t-submit {
    height: 54px;
    font-size: 16px;
  }

  .popup {
    padding: 16px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .popup_content {
    margin: auto;
    padding: 40px 22px 28px;
    max-width: 420px;
  }

  .popup_content h3 {
    font-size: 1.6rem;
  }

  .popup_content p {
    font-size: 1rem;
  }
}

@media (max-width: 400px) {
  .popup_content {
    padding: 36px 16px 24px;
    border-radius: 18px;
  }

  .popup_content h3 {
    font-size: 1.4rem;
  }

  .reg-form .reg-consent {
    font-size: 0.78rem;
  }
}

/* === Montserrat ExtraBold (рабочие файлы; в выгрузке Odoo они битые) === */
/* latin — нужен для цифр и "%" в заголовках */
@font-face {
  font-family: "Montserrat-ExtraBold";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: local("Montserrat ExtraBold"), local("Montserrat-ExtraBold"),
       url("/website_snippets/static/fonts/montserrat/Montserrat-ExtraBold-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic — текст заголовков */
@font-face {
  font-family: "Montserrat-ExtraBold";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: local("Montserrat ExtraBold"), local("Montserrat-ExtraBold"),
       url("/website_snippets/static/fonts/montserrat/Montserrat-ExtraBold-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* === Заголовки h2: Montserrat ExtraBold === */
h2 {
  font-family: "Montserrat-ExtraBold", "Montserrat", "Roboto", Arial, sans-serif !important;
  font-weight: 800 !important;
}
