/* --- LOCAL FONTS --- */
@font-face {
  font-family: 'YS Text';
  src: url('fonts/YS-Text-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'YS Text';
  src: url('fonts/YS-Text-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-family: 'YS Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #f5f5f5;
}

/* Backgrounds */
@media only screen and (min-width:651px) and (prefers-color-scheme:light){
  body { background-image: url('background/default-background.jpg'); background-size: cover; background-position: center; }
}
@media only screen and (min-width:651px) and (prefers-color-scheme:dark){
  body { background-image: url('background/dark-background.jpg'); background-size: cover; background-position: center; }
}

/* Logo */
.LogoLink {
  display: block;
  width: 116px;
  height: 30px;
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: left center;
  background-image: url('background/yandexlogo.svg');
}
.LogoLink_ru {
  display: block;
  width: 116px;
  height: 40px;
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: left center;
  background-image: url('background/yandexrulogo.svg');
}

/* ---------- LIGHT THEME ---------- */
@media (prefers-color-scheme: light) {
  body {
    --smart-captcha-background-color: #fff;
    --anchor-background-color: #fff;
    --anchor-background-color-checked: #5282ff;
    --anchor-border: 1px solid #c6c6cc;
    --anchor-border-hover: #999;
    --checkbox-border: #b8b8bd;
    --checkbox-bg: #fff;
    --link-view-default-typo-color-base: #04b;
    --color-typo-ghost: rgba(0,0,0,0.35);
    --color-base: #000;
    --color-secondary: #888;
    --color-service: #999;
    --color-typo-primary: var(--color-base);
    --button-view-action-typo-color-base: #fff;
    --button-view-action-fill-color-base: #6b94f7;
    --button-view-action-fill-color-hovered: #5c81d1;
    --textinput-border: 1px solid rgba(0,0,0,0.1);
    --textinput-border-focused: 1px solid rgba(0,0,0,0.3);
    --textinput-view-default-fill-color-base: #fff;
  }
}

/* ---------- DARK THEME ---------- */
@media (prefers-color-scheme: dark) {
  body {
    --smart-captcha-background-color: #313036;
    --anchor-background-color: #313036;
    --anchor-background-color-checked: #5c81d1;
    --anchor-border: 2px solid #8b8b93;      /* THICKER outline */
    --anchor-border-hover: #a5a5ac;
    --checkbox-border: #9a9aa0;
    --checkbox-bg: transparent;
    --link-view-default-typo-color-base: #8ab4f8;
    --color-typo-ghost: #9b9ba1;
    --color-base: #ffffff;                    /* crisp white */
    --color-secondary: #b5b5ba;
    --color-service: #8f8f94;
    --color-typo-primary: var(--color-base);
    --button-view-action-typo-color-base: #fff;
    --button-view-action-fill-color-base: #6b94f7;
    --button-view-action-fill-color-hovered: #5c81d1;
    --textinput-border: 1px solid #95969a;
    --textinput-border-focused: 1px solid #adafb6;
    --textinput-view-default-fill-color-base: #6e6e73;
  }
}

/* ---------- CARD (narrower, compact) ---------- */
.Theme { color: var(--color-typo-primary); }
.Theme_root_default {
  background: var(--smart-captcha-background-color);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-width: 360px;          /* NARROWER card, matches original */
  padding: 50px 24px;
}
.Container { width: 100%; }
.Spacer { margin-bottom: 0; }

/* ---------- LINKS: dotted underline ---------- */
.Link {
  color: var(--link-view-default-typo-color-base);
  text-decoration: underline;
  text-decoration-style: dotted;   /* DOTS, not a straight line */
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

/* ---------- TYPOGRAPHY (reverted to the good sizes) ---------- */
.Text {
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-typo-primary);
}
.Text_weight_regular { font-weight: 400; }
.Text_weight_medium { font-weight: 500; }

.Text_typography_headline-s { font-size: 20px; line-height: 1.4; font-weight: 500; }
.Text_typography_body-long-m { font-size: 15px; line-height: 1.5; }
.Text_typography_control-xxl { font-size: 16px; line-height: 1.375; }
.Text_typography_control-l { font-size: 14px; line-height: 1.428; }
.Text_typography_control-s { font-size: 13px; line-height: 1.384; }
.Text_typography_control-xs { font-size: 12px; line-height: 1.333; }
.Text_typography_control-xxs { font-size: 11px; line-height: 1.272; }
.Text_color_ghost { color: var(--color-typo-ghost); }

/* ---------- CAPTCHA BOX ---------- */
.CheckboxCaptcha-Box {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  background: var(--anchor-background-color);
  border: var(--anchor-border);
  border-radius: 10px;
  transition: border-color 0.2s;
}
.CheckboxCaptcha-Box:hover { border-color: var(--anchor-border-hover); }

/* Main clickable area (checkbox + text) */
.CheckboxCaptcha-Main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

/* The small square */
.CheckboxCaptcha-Checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--checkbox-border);
  border-radius: 5px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--checkbox-bg);
  margin-top: 1px;
  transition: all 0.2s;
}
.CheckIcon { width: 15px; height: 15px; color: #5282ff; opacity: 0; transition: opacity 0.15s; }

/* Checked state */
#captcha-btn[aria-checked="true"] .CheckboxCaptcha-Checkbox {
  background: #fff;
  border-color: #fff;
}
#captcha-btn[aria-checked="true"] .CheckIcon { opacity: 1; }
.CheckboxCaptcha-Box:has(#captcha-btn[aria-checked="true"]) {
  background: var(--anchor-background-color-checked);
  border-color: var(--anchor-background-color-checked);
}
.CheckboxCaptcha-Box:has(#captcha-btn[aria-checked="true"]) .CheckboxCaptcha-LabelText { color: #fff; }
.CheckboxCaptcha-Box:has(#captcha-btn[aria-checked="true"]) .CheckboxCaptcha-SecondaryText { color: rgba(255,255,255,0.85); }
.CheckboxCaptcha-Box:has(#captcha-btn[aria-checked="true"]) .CheckboxCaptcha-ServiceText { color: rgba(255,255,255,0.7); }
.CheckboxCaptcha-Box:has(#captcha-btn[aria-checked="true"]) .CaptchaButton { color: rgba(255,255,255,0.8); }

/* Text column */
.CheckboxCaptcha-Label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.CheckboxCaptcha-LabelText { color: var(--color-base); font-weight: 650; }
.CheckboxCaptcha-SecondaryText { color: var(--color-secondary); }
.CheckboxCaptcha-ServiceText { font-size: 12px; color: var(--color-service); }

/* The ? button: sits at bottom-right INSIDE the box */
.CaptchaButton {
  align-self: flex-end;
  margin-bottom: 2px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--color-typo-ghost);
  width: 24px;
  height: 24px;
  transition: background 0.2s;
}
.CaptchaButton:hover { background: rgba(128,128,128,0.15); }

/* Dropdown under the ? */
.CaptchaLinks-Links {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--smart-captcha-background-color);
  border: 1px solid var(--color-typo-ghost);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  z-index: 10;
}
.CaptchaLinks-Links.show { display: block; }

/* ---------- FORM BITS ---------- */
form { margin: 0; }

.keyboard-fallback {
  margin: 20px 0;
  padding: 16px;
  background: rgba(128,128,128,0.08);
  border-radius: 8px;
  border-left: 3px solid var(--anchor-background-color-checked);
  display: none;
  width: 100%;
}
.keyboard-fallback.show { display: block; }
.keyboard-fallback label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 14px; color: var(--color-base); }
.keyboard-fallback input { width: 100%; padding: 10px 12px; border: var(--textinput-border); border-radius: 6px; font-size: 14px; margin-bottom: 8px; background: var(--textinput-view-default-fill-color-base); color: var(--color-base); }
.keyboard-fallback input:focus { outline: none; border: var(--textinput-border-focused); }
.keyboard-fallback small { color: var(--color-typo-ghost); display: block; font-size: 12px; }

.submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--button-view-action-fill-color-base);
  color: var(--button-view-action-typo-color-base);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  display: none;
  margin-top: 16px;
}
.submit-btn.show { display: block; }
.submit-btn:hover { background: var(--button-view-action-fill-color-hovered); }

main { padding: 0; }

/* ---------- POPUP MODAL ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  /* Slightly more transparent so the blur effect is visible */
  background: rgba(0, 0, 0, 0.4); 
  
  /* THE MAGIC BLUR PROPERTIES */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); /* Required for Safari */
  
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-overlay.show { display: flex; }

.modal-box {
  /* Keeps the box solid and sharp */
  background: var(--smart-captcha-background-color); 
  color: var(--color-typo-primary);
  border-radius: 12px;
  padding: 24px 20px;
  width: 100%;
  max-width: 280px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  
  /* Optional: Add a subtle border to help it stand out against the blurred background */
  border: 1px solid rgba(255, 255, 255, 0.1); 
}

.modal-text {
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 16px;
}

.modal-btn {
  width: 100%;
  padding: 10px 12px;
  background: var(--button-view-action-fill-color-base);
  color: var(--button-view-action-typo-color-base);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.modal-btn:hover { background: var(--button-view-action-fill-color-hovered); }

/* ---------- NUMBERED STEPS IN POPUP ---------- */
.modal-steps {
  list-style: decimal;          /* hide default 1. 2. 3. — we draw our own */
  margin: 0 0 16px 0;
  padding-left: 22px;
  text-align: left;         /* overrides the box's center alignment */
  color: var(--color-typo-primary);
}

.modal-steps li {
  margin-bottom: 10px;       /* each step on its own line with breathing room */
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-secondary);
}
.modal-steps li:last-child { margin-bottom: 0; }

html[lang="ru"] .CheckboxCaptcha-LabelText::first-letter {
  color: #FC3F1D;
}
