/* Scoped to Digits forms; the rest of the site keeps its existing theme. */
.ag-auth-ui { --ag-auth-blue: #1964ec; --ag-auth-ink: #172b57; --ag-auth-muted: #60718b; --ag-auth-line: #d6e1ef; }
.ag-auth-ui, .ag-auth-ui input, .ag-auth-ui button, .ag-auth-ui label { font-family: Shabnam, Tahoma, sans-serif; box-sizing: border-box; }
.digits_popup_wrapper .digits-form_page { min-height: 100dvh; padding: 32px 24px; background: #f1f6fd; align-items: center; }
.digits_popup_wrapper .digits-form_container.ag-auth-popup-card { display: grid; grid-template-columns: 300px minmax(0, 460px); direction: ltr; width: min(760px, 100%); max-width: 760px; padding: 0; border: 1px solid #dce6f3; border-radius: 20px; overflow: hidden; box-shadow: 0 18px 70px #172b5714; margin: auto; background: #fff; }
.ag-auth-popup-card > .digits-form_wrapper { direction: rtl; min-width: 0; width: 100%; padding: 28px 36px; align-self: center; }
.ag-auth-popup-card > .digits_site_footer_box[hidden] { display: none !important; }
.digits_popup_wrapper .digits-cancel { width: 44px; height: 44px; top: 8px; right: 12px; cursor: pointer; border-radius: 10px; }
.digits_popup_wrapper .digits-cancel:focus-visible { outline: 3px solid #7ba8fa; outline-offset: 2px; }
.ag-auth-welcome { display: flex; flex-direction: column; gap: 34px; padding: 32px 28px; direction: rtl; color: #fff; background: #172b57; align-self: stretch; }
.ag-auth-brand { display: flex; gap: 12px; align-items: center; color: #fff !important; text-decoration: none; font-size: 18px; font-weight: 700; line-height: 1.7; }
.ag-auth-brand img { display: block; width: 48px; height: 48px; border-radius: 10px; background: #fff; padding: 5px; }
.ag-auth-brand small { display: block; color: #d2e0f8; font-size: 12px; font-weight: 400; }
.ag-auth-welcome-copy { margin: auto 0; }
.ag-auth-welcome-copy > strong { display: block; font: 700 72px/1.15 'Segoe UI', Arial, sans-serif; color: #fff; text-align: left; margin-bottom: 24px; letter-spacing: -3px; }
.ag-auth-welcome-copy h2 { color: #fff; font-size: 25px; line-height: 1.8; margin: 0 0 10px; }
.ag-auth-welcome-copy p { color: #d2e0f8; font-size: 15px; line-height: 2; margin: 0; }
.ag-auth-footnote { border-top: 1px solid #ffffff30; color: #d2e0f8; font-size: 12px; line-height: 2; padding-top: 18px; margin: 0; }
.ag-auth-ui .digits-form_heading { margin: 0 0 8px; font-size: 27px; line-height: 1.7; color: var(--ag-auth-ink); }
.ag-auth-ui .digits-form_heading_text { color: var(--ag-auth-ink); font-weight: 700; }
.ag-auth-ui .ag-auth-intro { color: var(--ag-auth-muted); margin: 0 0 18px; font-size: 14px; line-height: 1.9; }
.ag-auth-ui .ag-auth-intro[hidden] { display: none; }
.ag-auth-ui .digits-form_tabs { margin: 0 0 16px; }
.ag-auth-ui .digits-form_tab-bar { display: flex; gap: 6px; padding: 4px; background: #eff4fb; border-radius: 11px; width: 100%; }
.ag-auth-ui .digits-form_tab-item { flex: 1 1 0; text-align: center; font-size: 15px; font-weight: 600; min-height: 44px; line-height: 24px; padding: 10px 8px; margin: 0; border: none; border-radius: 8px; color: #52637d; opacity: 1; cursor: pointer; }
.ag-auth-ui .digits-form_tab-item::after { display: none; }
.ag-auth-ui .digits-form_tab-item.digits-tab_active { background: #fff; color: var(--ag-auth-blue); box-shadow: 0 1px 5px #172b5710; border: 0; }
.ag-auth-ui .digits-form_body { margin-top: 0; }
.ag-auth-ui .ag-auth-label { display: block !important; position: static; padding: 0 !important; margin: 0 0 4px !important; color: var(--ag-auth-ink); font-size: 14px; font-weight: 500; line-height: 24px; }
.ag-auth-ui .digits-form_input_row { margin-bottom: 12px; }
.ag-auth-ui .digits-form_input input:not([type='hidden']):not([type='checkbox']):not([type='radio']):not(.countrycode) { width: 100%; box-sizing: border-box; min-height: 52px; height: 52px; border: 1px solid var(--ag-auth-line); background: #f8fafd; border-radius: 10px; color: var(--ag-auth-ink); font-size: 16px; line-height: 24px; padding: 13px 14px; margin: 0; }
.ag-auth-ui .digits-form_input input::placeholder { color: #8290a5; opacity: 1; }
.ag-auth-ui .digits-mobile_wrapper { height: 52px; min-height: 52px; border: 1px solid var(--ag-auth-line); background: #f8fafd; border-radius: 10px; }
.ag-auth-ui .digits-mobile_wrapper .digits-form_input input { border: none !important; background: transparent !important; }
.ag-auth-ui .digits-mobile_wrapper .digits-form_input :is(input.countrycode,input[type='tel']) { height: 50px; min-height: 50px; line-height: 24px; padding-top: 13px; padding-bottom: 13px; margin: 0; font-family: 'Segoe UI', Tahoma, sans-serif; font-size: 16px; font-weight: 400; direction: ltr; text-align: left; }
.ag-auth-ui .digits-form_countrycode .digits-field-country_flag { top: calc(50% - 16px); }
.ag-auth-ui .digits-form_input input[type='email'] { direction: ltr; text-align: left; font-family: 'Segoe UI', Tahoma, sans-serif; }
.ag-auth-ui .digits-form_input input:focus, .ag-auth-ui .digits-mobile_wrapper:focus-within { outline: 0; border-color: var(--ag-auth-blue); box-shadow: 0 0 0 3px #1964ec12; }
.ag-auth-ui .digits-mobile_wrapper input:focus { box-shadow: none; }
.ag-auth-ui .digits_password_inp_row input { padding-left: 48px !important; }
.ag-auth-ui .digits_password_eye-cont { top: 4px; left: 5px; right: auto; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.ag-auth-ui .digits-form_submit-btn { width: 100%; height: 52px; min-height: 52px; padding: 12px 16px; margin-top: 4px; background: var(--ag-auth-blue); color: #fff; border: 0; border-radius: 10px; box-shadow: none; font-size: 16px; font-weight: 700; line-height: 28px; }
.ag-auth-ui .digits-form_submit-btn .digits-form_button-text { font-size: 16px; }
.ag-auth-ui .digits-form_submit-btn:hover { background: #1054d4; }
.ag-auth-ui .digits-form_button_ic { display: none; }
.ag-auth-ui .dig_login_signup_bar { margin-top: 16px; padding-top: 14px; border-top: 1px solid #e5ecf5; font-size: 14px; line-height: 2; text-align: center; }
.ag-auth-ui .dig_login_signup_bar span { opacity: 1; color: var(--ag-auth-muted); }
.ag-auth-ui .dig_login_signup_bar a { color: #145cd7; font-weight: 700; padding: 4px 2px; display: inline-block; }
.ag-auth-ui .digits-form_rememberme, .ag-auth-ui .ag-terms { margin: 4px 0 16px; }
.ag-auth-ui .digits-form_footer { font-size: 14px; line-height: 2; }
.ag-auth-ui .digits-form_footer:not(:empty) { padding-top: 12px; }
.ag-auth-ui :is(button,a,[role='button'],input):focus-visible { outline: 3px solid #7ba8fa !important; outline-offset: 3px; }
.dig_popmessage.dig_error_message .dig_lase_message { text-align: right; word-spacing: normal; font-size: 14px; line-height: 1.9; }
/* The prefix stays editable; the flag button opens the existing country list. */
.ag-auth-ui .digits-mobile_wrapper .digits-form_countrycode { width: 116px !important; height: 100%; left: 0; right: auto; top: 0; padding: 0; border-right: 1px solid #d6e1ef; }
.ag-auth-ui .digits-mobile_wrapper .digits-form_countrycode input.countrycode { position: absolute; left: 42px; top: 0; width: 72px !important; padding: 0 7px !important; text-align: left !important; }
.ag-auth-ui .digits-mobile_wrapper .digits-form_input input[type='tel'] { padding-left: 128px !important; padding-right: 12px !important; }
.ag-auth-ui .ag-country-picker { position: absolute; left: 0; top: 0; bottom: 0; width: 42px; height: 100%; padding: 0; border: 0; border-radius: 9px 0 0 9px; background: transparent; color: #172b57; cursor: pointer; }
.ag-auth-ui .ag-country-picker:hover { background: #e8effa; }
.ag-auth-ui .ag-country-picker::after { content: none; display: none; }
/* Keep the sprite's native 48×32 cell; scale the whole cell, not its background. */
.ag-auth-ui .ag-country-picker .digits-field-country_flag { pointer-events: none; position: absolute; width: 48px !important; height: 32px !important; min-width: 48px; padding: 0; margin: 0; border: 0; left: 50% !important; right: auto !important; top: 50% !important; bottom: auto; background-size: auto !important; background-repeat: no-repeat; transform: translate(-50%, -50%) scale(.625) !important; transform-origin: center; }
.ag-auth-ui .ag-country-picker .digits-field-country_flag.flag_selected { display: block; }
.ag-auth-ui .ag-country-hint { color: #60718b; font-size: 12px; line-height: 1.9; margin: -4px 0 14px; text-align: right; }
.digit_cs-list .countrycode_search { min-height: 48px !important; font-size: 16px !important; }
.digit_cs-list li[data-country] { min-height: 46px; font-size: 16px; }
@media (min-width: 901px) {
  /* Desktop auth fills the viewport; keep the form at a readable width. */
  .digits_popup_wrapper .digits-form_page { padding: 0; min-height: 100dvh; align-items: stretch; }
  .digits_popup_wrapper .digits-form_container.ag-auth-popup-card { width: 100%; max-width: none; min-height: 100dvh; grid-template-columns: minmax(320px, 42fr) minmax(0, 58fr); margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .ag-auth-popup-card > .digits-form_wrapper { width: 100%; max-width: 600px; padding: 56px clamp(32px, 4vw, 60px); justify-self: center; }
  .ag-auth-popup-card > .ag-auth-welcome { min-height: 100dvh; padding: 48px clamp(32px, 5vw, 80px); }
  .ag-auth-popup-card .ag-auth-welcome-copy > strong { font-size: clamp(80px, 7vw, 120px); }
  .digits_popup_wrapper .digits-cancel { position: fixed; top: 16px; right: 20px; z-index: 10; }
  body.ag-login-page #digits_protected .digits-form_page { padding: 0; align-items: stretch; background: #fff; }
  body.ag-login-page #digits_protected .ag-shell { width: 100%; max-width: none; min-height: 100dvh; grid-template-columns: minmax(320px, 42fr) minmax(0, 58fr); border: 0; border-radius: 0; box-shadow: none; }
  body.ag-login-page #digits_protected .ag-welcome { min-height: 100dvh; padding: 48px clamp(32px, 5vw, 80px); background: #172b57; color: #fff; border: 0; }
  body.ag-login-page #digits_protected .ag-greeting { color: #fff; text-shadow: none; font-size: clamp(80px, 7vw, 120px); }
  body.ag-login-page #digits_protected .ag-welcome :is(.ag-german-line,.ag-welcome-fa p,.ag-welcome-foot span) { color: #d2e0f8; }
  body.ag-login-page #digits_protected .ag-welcome-fa strong { color: #fff; }
  body.ag-login-page #digits_protected .ag-welcome-foot span { border-color: #ffffff30; }
  body.ag-login-page #digits_protected .ag-shell > .digits-form_container { width: 100%; max-width: 600px; padding: 48px clamp(32px, 4vw, 60px); justify-self: center; }
  body.ag-login-page #digits_protected .ag-footer { width: 100%; margin: 0; padding: 14px 24px; background: #fff; }
}
@media (max-width: 700px) {
  .digits_popup_wrapper .digits-form_page { padding: 52px 16px 28px; align-items: flex-start; }
  .digits_popup_wrapper .digits-form_container.ag-auth-popup-card { display: block; max-width: 440px; border-radius: 16px; }
  .ag-auth-welcome { padding: 16px 22px; }
  .ag-auth-welcome-copy, .ag-auth-footnote { display: none; }
  .ag-auth-brand { font-size: 16px; }
  .ag-auth-brand img { width: 40px; height: 40px; }
  .ag-auth-popup-card > .digits-form_wrapper { padding: 24px 22px; }
  .ag-auth-ui .digits-form_heading { font-size: 24px; }
  .ag-auth-ui .ag-auth-intro { font-size: 14px; margin-bottom: 18px; }
  .ag-auth-ui .digits-form_tab-item { font-size: 16px; min-height: 48px; }
  .ag-auth-ui .ag-auth-label, .ag-auth-ui .ag-phone-label { font-size: 16px !important; line-height: 26px; margin-bottom: 6px !important; }
  .ag-auth-ui .ag-auth-intro, .ag-auth-ui .ag-form-intro { font-size: 15px; }
  .ag-auth-ui .digits-form_input input:not([type='hidden']):not([type='checkbox']):not([type='radio']):not(.countrycode) { height: 58px !important; min-height: 58px !important; font-size: 18px !important; line-height: 28px; }
  .ag-auth-ui .digits-mobile_wrapper { height: 58px !important; min-height: 58px !important; }
  .ag-auth-ui .digits-mobile_wrapper .digits-form_input :is(input.countrycode,input[type='tel']) { height: 56px !important; min-height: 56px !important; font-size: 18px !important; }
  .ag-auth-ui .digits-form_submit-btn { height: 56px; min-height: 56px; font-size: 17px; }
  .ag-auth-ui .digits-form_submit-btn .digits-form_button-text { font-size: 17px; }
  .ag-auth-ui .dig_login_signup_bar, .ag-auth-ui .digits-form_rememberme label, .ag-auth-ui .ag-terms label { font-size: 16px !important; }
  .ag-auth-ui .ag-country-hint { font-size: 13px; }
  .ag-auth-ui .digits_password_eye-cont { top: 7px; }
  .ag-login-page .ag-method-switch button { min-height: 48px; font-size: 16px; }
  .dig_popmessage.dig_error_message { max-width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) { .ag-auth-ui * { transition: none !important; animation: none !important; } }

/* OTP: remove the native information overlay, preserving password controls. */
:is(.ag-auth-ui, .ag-login-page #digits_protected) .digits-form_input_info > .digits_otp_info {
  display: none !important;
}
/* Keep the current field heights; show entered/autofilled codes left-to-right. */
:is(.ag-auth-ui, .ag-login-page #digits_protected) .digits-form_input
  input:is(.otp_input, .digits_otp_input-field, .dig_verify_otp_input, [name='dig_otp']):not([type='hidden']) {
  direction: ltr !important;
  text-align: center !important;
  padding-inline: 16px !important;
  font-family: 'Segoe UI', Tahoma, sans-serif !important;
  font-size: 20px !important;
  letter-spacing: .18em !important;
}
/* Only the empty field's Persian placeholder reads from right to left. */
:is(.ag-auth-ui, .ag-login-page #digits_protected) .digits-form_input
  input:is(.otp_input, .digits_otp_input-field, .dig_verify_otp_input, [name='dig_otp']):not([type='hidden']):placeholder-shown {
  direction: rtl !important;
  text-align: right !important;
  letter-spacing: normal !important;
}
:is(.ag-auth-ui, .ag-login-page #digits_protected) .digits-form_input
  input:is(.otp_input, .digits_otp_input-field, .dig_verify_otp_input, [name='dig_otp']):not([type='hidden'])::placeholder {
  font-family: Shabnam, Tahoma, sans-serif !important;
  font-size: 16px !important;
  letter-spacing: normal !important;
}
@media (max-width: 700px) {
  :is(.ag-auth-ui, .ag-login-page #digits_protected) .digits-form_input
    input:is(.otp_input, .digits_otp_input-field, .dig_verify_otp_input, [name='dig_otp']):not([type='hidden'])::placeholder {
    font-size: 18px !important;
  }
}

/* One shared height prevents the phone controls overflowing their border.
   Native input text centring needs no vertical padding or forced line box. */
.ag-auth-ui .digits-mobile_wrapper {
  --ag-phone-height: 52px;
  height: var(--ag-phone-height) !important;
  min-height: var(--ag-phone-height) !important;
}
.ag-login-page #digits_protected .digits-mobile_wrapper {
  --ag-phone-height: 56px;
  height: var(--ag-phone-height) !important;
  min-height: var(--ag-phone-height) !important;
}
:is(.ag-auth-ui, .ag-login-page #digits_protected) .digits-mobile_wrapper
  .digits-form_input :is(input.countrycode, input[type='tel']) {
  box-sizing: border-box;
  height: calc(var(--ag-phone-height) - 2px) !important;
  min-height: calc(var(--ag-phone-height) - 2px) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-block: 0 !important;
  line-height: normal !important;
}
@media (max-width: 700px) {
  :is(.ag-auth-ui, .ag-login-page #digits_protected) .digits-mobile_wrapper {
    --ag-phone-height: 58px;
  }
}
