/* ================================================================
   AUTH MODALS — всичко е scoped под .auth
   Безопасно за вграждане в съществуващ сайт.
   ================================================================ */

/* --- Box-sizing reset само за елементите вътре в модала --- */
.auth *,
.auth *::before,
.auth *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Overlay + CSS custom properties --- */
.auth {
  /* Design tokens */
  --active: #0083b7;
  --active-hover: #0080b8;
  --active-focus: #007aa8;
  --sub: #1a3a5c;
  --text-primary: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --border: #d0d0d0;
  --black: #000000;
  --border-focus: #0099d6;
  --input-bg: #ffffff;
  --error: #dc2626;
  --gray-light: #e8e8e8;
  --success: #16a34a;
  --warning: #facc15;
  --white: #ffffff;
  --fon: #f5f5f5;
  --fon-dark: #041932;

  --modal-radius: 4px;
  --radius-widget: 24px;
  --radius-card: 12px;
  --radius-element: 8px;
  --radius-button: 8px;

  --font: "Inter", sans-serif;
  --font-display: "Playfair Display", serif;

  --text-h1: 64px;
  --text-h2: 48px;
  --text-h3: 32px;
  --text-h4: 24px;
  --text-h5: 20px;
  --text-h6: 19px;
  --text-h7: 16px;
  --text-h8: 14px;
  --text-h9: 13px;

  /* Overlay layout */
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  font-family: var(--font);
  background-size: cover;
  background-position: center;
  background-color: #222;
  overflow-y: auto;
}

.auth.is-open {
  display: flex;
}

/* Огледален фон */
.auth::before {
  content: "";
  position: fixed;
  inset: 0;
  background: inherit;
  transform: scaleX(-1);
  z-index: 0;
  pointer-events: none;
}

/* Тъмен overlay върху фона */
.auth::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 0;
  pointer-events: none;
}

.auth.no-mirror::before {
  transform: none;
}

/* --- Close button --- */
.auth .auth-close {
  position: absolute;
  right: 20px;
  top: 32px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--white);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 555555555;
  opacity: 0.9;
  transition: opacity 0.15s;
}

.auth .auth-close:hover {
  opacity: 1;
}

.auth .auth-close svg {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

/* --- Header bar --- */
.auth .modal-header {
  position: relative;
  z-index: 2;
  height: 93px;
  padding: 0 20px;
  margin: 0 100px;
}

.auth .modal-logo {
  position: absolute;
  left: 20px;
  top: 32px;
  text-decoration: none;
}

/* --- Step wrappers (register + forgot — само активната стъпка е видима) --- */
.auth .reg-step,
.auth .fp-step {
  display: none;
  flex-direction: column;
  flex: 1;
  gap: 16px;
}

.auth .reg-step.active,
.auth .fp-step.active {
  display: flex;
}

/* --- White card --- */
.auth .modal-card {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 0;
  border-top-left-radius: var(--radius-widget);
  border-bottom-right-radius: var(--radius-widget);
  max-width: calc(100vw - 40px);
  margin: 0 80px;
  width: 540px;
  height: 726px;
  gap: 16px;
  padding: 40px;
}

#registerModal .modal-card {
  min-height: 726px;
  height: auto;
}

/* --- Typography --- */
.auth .card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-h1);
  line-height: 130%;
  letter-spacing: -0.02em;
  text-align: center;
}

.auth .card-subtitle {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--text-h7);
  line-height: 130%;
  letter-spacing: 0;
  text-align: center;
  margin-bottom: 10px;
}

.auth .subtitle-part3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h3);
  line-height: 130%;
  letter-spacing: 0;
  text-align: center;
}

/* --- Form fields --- */
.auth .field {
  margin-bottom: 14px;
}

.auth .field label {
  display: block;
  font-family: var(--font);
  font-size: var(--text-h9);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.auth .field label .req {
  color: var(--error);
  margin-right: 1px;
}

.auth .input-wrap {
  position: relative;
}

.auth .input-wrap input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--black);
  border-radius: 3px;
  padding: 0 36px 0 10px;
  font-size: var(--text-h8);
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--input-bg);
  outline: none;
  transition: border-color 0.15s;
}

.auth .input-wrap input:focus {
  border-color: var(--border-focus);
}

.auth .toggle-pw {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: #999;
  display: flex;
  align-items: center;
}

.auth .toggle-pw svg {
  width: 18px;
  height: 18px;
}

/* --- Tooltip --- */
.auth .tooltip-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 5px;
  font-family: var(--font);
  font-size: var(--text-h8);
  font-weight: 400;
  position: relative;
  background: var(--fon);
  border-radius: 6px;
  padding: 10px 12px;
}

.auth .tooltip-icon {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.auth .tooltip-wrap svg {
  flex-shrink: 0;
  color: var(--black);
  display: block;
}

.auth .tooltip-icon:hover .tooltip-box {
  display: block;
}

.auth .tooltip-wrap svg circle,
.auth .tooltip-wrap svg path {
  stroke: var(--black);
}

.auth .tooltip-box {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: -124px;
  background: var(--fon-dark);
  color: #fff;
  font-family: var(--font);
  font-size: var(--text-h7);
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 4px;
  width: 280px;
  z-index: 10;
  pointer-events: none;
}

.auth .tooltip-box::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 126px;
  left: auto;
  border: 6px solid transparent;
  border-top-color: var(--fon-dark);
}

/* --- Forgot password link --- */
.auth .forgot-link {
  display: block;
  text-align: right;
  color: var(--active);
  font-family: var(--font);
  font-weight: 500;
  font-size: var(--text-h8);
  line-height: 130%;
  text-decoration: underline;
  margin-top: 16px;
}

.auth .forgot-link:hover {
  text-decoration: underline;
}

/* --- Primary button --- */
.auth .btn-primary {
  display: block;
  width: 100%;
  height: 53px;
  background: var(--active);
  color: var(--white);
  border: none;
  border-radius: 3px;
  font-size: var(--text-h8);
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
  text-decoration: none;
  line-height: 56px;
}

.auth .btn-primary:hover {
  background: var(--active-hover);
}

.auth .btn-primary:active {
  background: var(--active-focus);
}

.auth .register-continue {
  margin-top: 16px;
}

.auth .if-profile {
  margin-top: 16px;
}

/* --- Divider --- */
.auth .divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  font-family: var(--font);
  font-size: var(--text-h9);
  font-weight: 400;
  line-height: 130%;
}

.auth .divider::before,
.auth .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --- Social buttons --- */
.auth .social-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.auth .social-row {
  flex-direction: row;
}

.auth .btn-social {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  border-radius: var(--radius-button);
  padding: 16px 9px;
  background: var(--fon);
  font-size: var(--text-h8);
  font-family: var(--font);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
  font-weight: 500;
  line-height: 130%;
}

.auth .btn-social:hover {
  background: #ebebeb;
}

.auth .btn-social svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* --- Card bottom link --- */
.auth .card-bottom {
  text-align: center;
  font-family: var(--font);
  font-size: var(--text-h8);
  font-weight: 500;
  line-height: 130%;
}

.auth .card-bottom a {
  color: var(--active);
  font-weight: 500;
}

.auth .card-bottom a:hover {
  text-decoration: underline;
}

/* --- Two-column field row --- */
.auth .field-row {
  display: flex;
  gap: 10px;
}

.auth .field-row .field {
  flex: 1;
}

/* --- Radio group --- */
.auth .radio-group {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  padding-left: 10px;
}

.auth .gender {
  padding-left: 10px;
}

.auth .radio-group label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font);
  font-size: var(--text-h8);
  color: var(--text-primary);
  cursor: pointer;
  margin-bottom: 0;
}

.auth .radio-group input[type="radio"] {
  accent-color: var(--active);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* --- Select --- */
.auth .field select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--black);
  border-radius: 3px;
  padding: 0 36px 0 10px;
  font-size: var(--text-h8);
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--input-bg);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color 0.15s;
}

.auth .field select:focus {
  border-color: var(--border-focus);
}

/* --- Checkboxes --- */
.auth .checkbox-group {
  margin: 10px 0;
}

.auth .checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font);
  font-size: var(--text-h9);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.4;
}

.auth .checkbox-item input[type="checkbox"] {
  accent-color: var(--active);
  width: 14px;
  height: 14px;
  margin-top: 1px;
  flex-shrink: 0;
  cursor: pointer;
}

.auth .checkbox-item a {
  color: var(--active);
  text-decoration: underline;
}

/* --- Promo section --- */
.auth .promo-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  flex: 1;
  padding: 80px;
}

.auth .promo-item {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  flex-direction: column;
  align-items: flex-end;
}

.auth .promo-bubble {
  width: 76px;
  height: 76px;
  border-radius: 100px 100px 100px 0;
  background: var(--white);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.12);
}

.auth .promo-bubble img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth .promo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: var(--text-h3);
  line-height: 130%;
  text-align: right;
  color: var(--white);
}

/* --- Success / Error states --- */
.auth .state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.auth .state-title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 500;
  text-align: center;
  margin-bottom: 10px;
  line-height: 130%;
  letter-spacing: 0;
}

.auth .state-body {
  font-family: var(--font);
  font-size: var(--text-h7);
  font-weight: 400;
  color: var(--black);
  text-align: center;
  margin-bottom: 18px;
  line-height: 150%;
  letter-spacing: 0;
}

.auth .help {
  margin-top: 20px;
}

.auth .forgot-info-primary {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 500;
  line-height: 130%;
  text-align: center;
  color: var(--text-primary);
}

.auth .forgot-info-secondary {
  font-family: var(--font);
  font-size: var(--text-h7);
  font-weight: 400;
  line-height: 150%;
  text-align: center;
  color: var(--text-primary);
}

/* --- Footer --- */
.auth .page-footer {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  background: var(--fon-dark);
  color: var(--white);
  font-family: var(--font);
  margin-top: auto;
  height: 103px;
  gap: 16px;
  padding: 16px 80px;
  border-top-left-radius: var(--radius-element);
  border-top-right-radius: var(--radius-element);
  border-top: 1px solid var(--gray-light);
}

.auth .footer-links {
  display: flex;
  flex-wrap: wrap;
  height: 21px;
  gap: 16px;
}

.auth .footer-links a {
  color: var(--white);
  text-decoration: none;
  font-family: var(--font);
  font-weight: 500;
  font-size: var(--text-h8);
  line-height: 130%;
}

.auth .footer-links a:hover {
  opacity: 0.8;
}

.auth .footer-divider {
  width: 100%;
  height: 1px;
  background: #273f5c;
  border: none;
}

.auth .footer-copy {
  color: var(--white);
  display: flex;
  justify-content: space-between;
  height: 17px;
  font-family: var(--font);
  font-weight: 700;
  font-size: var(--text-h9);
  line-height: 130%;
}

/* --- Page content layout (card + promo) --- */
.auth .page-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 1;
  padding: 100px 40px;
  gap: 40px;
  position: relative;
  z-index: 2;
}

/* ================================================================
   Mobile
   ================================================================ */
@media (max-width: 600px) {
  .auth {
    --text-h1: 40px;
    --text-h2: 32px;
    --text-h3: 24px;
    --text-h4: 20px;
    --text-h5: 18px;
    --text-h6: 16px;
    --text-h7: 15px;
    --text-h8: 13px;
    --text-h9: 11px;
  }

  .auth .modal-header {
    padding: 10px 14px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
  }

  .auth .modal-logo {
    position: static;
    margin-top: 20px;
  }

  .auth .auth-close {
    top: 50%;
    right: 14px;
  }

  .auth .page-content {
    flex-direction: column;
    align-items: center;
    padding: 24px 14px;
  }

  .auth .modal-card {
    width: 100%;
    margin: 0;
    border-radius: 0;
    border-top-left-radius: var(--radius-widget);
    border-bottom-right-radius: var(--radius-widget);
    padding: 24px 20px 20px;
    height: auto;
  }

  .auth .tooltip-icon {
    position: static;
  }

  .auth .tooltip-wrap {
    position: relative;
  }

  .auth .tooltip-box {
    right: 0;
    left: 0;
    width: 100%;
    transform: none;
  }

  .auth .tooltip-box::after {
    right: 12px;
    left: auto;
    transform: none;
  }

  .auth .field-row .field {
    padding-left: 0;
  }

  .auth .field-row {
    flex-direction: column;
  }

  .auth .radio-group {
    padding-left: 0;
  }

  .auth .gender {
    padding-left: 0;
  }

  .auth .promo-section {
    display: none;
  }

  .auth .social-buttons.social-row {
    flex-direction: column;
  }

  .auth .page-footer {
    height: auto;
    padding: 16px 20px;
  }

  .auth .footer-links {
    height: auto;
    flex-wrap: wrap;
  }
}


.auth .autoComplete_wrapper {
  width: 100%;
}