/*
 * REDESIGN DIGITS LOGIN PAGE 1.0.9 — AREF ELECTRONIC
 * All rules are scoped to Digits UI roots marked by experience.js.
 * Uses existing Digits authentication HTML; no replacement form or mock verification.
 */
.deniz-auth-surface {
  --deniz-rose: #cb0101;
  --deniz-aqua: #920101;
  --deniz-ink: #081923;
  --deniz-text: #fbf9fc;
  --deniz-muted: #b8cbd0;
  color: var(--deniz-text);
  isolation: isolate;
}

/* Cinematic, animated aurora background — no external images or fonts. */
.deniz-auth-page.deniz-auth-surface,
.deniz-auth-popup.deniz-auth-surface {
  background: #190c0f !important;
  background-image:
    radial-gradient(ellipse 60% 70% at 0% 10%, rgba(203,1,1,.40), transparent 72%),
    radial-gradient(ellipse 65% 75% at 100% 85%, rgba(203,1,1,.32), transparent 70%),
    linear-gradient(145deg, #290d12 0%, #180e13 52%, #2a1018 100%) !important;
  overflow-x: hidden;
  position: relative;
}
.deniz-auth-page.deniz-auth-surface { min-height: 100svh; }
.deniz-auth-page.deniz-auth-surface::before,
.deniz-auth-popup.deniz-auth-surface::before {
  content: "";
  position: fixed;
  width: 120vmax;
  height: 120vmax;
  inset: -45vmax auto auto -40vmax;
  border-radius: 42%;
  background:
    radial-gradient(circle at 44% 42%, rgba(203,1,1,.19), transparent 40%),
    radial-gradient(circle at 76% 65%, rgba(231,45,45,.21), transparent 36%);
  transform: rotate(-12deg);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: deniz-aurora 19s ease-in-out infinite alternate;
}
.deniz-auth-page.deniz-auth-surface::after,
.deniz-auth-popup.deniz-auth-surface::after {
  content: "";
  position: fixed;
  width: min(75vw, 900px);
  height: min(75vw, 900px);
  right: -25vw;
  top: -40vh;
  border: 1px solid rgba(219,157,157,.13);
  border-radius: 50%;
  box-shadow: 0 0 0 62px rgba(211,150,150,.025),
              0 0 0 125px rgba(192,130,130,.023),
              0 0 0 195px rgba(255,255,255,.012);
  pointer-events: none;
  z-index: 0;
  animation: deniz-orbit 22s ease-in-out infinite alternate;
}
.deniz-auth-page.deniz-auth-surface > *,
.deniz-auth-popup.deniz-auth-surface > * { position: relative; z-index: 2; }

@keyframes deniz-aurora {
  from { transform: translate(-3%, 3%) rotate(-14deg) scale(.94); }
  to { transform: translate(9%, -9%) rotate(8deg) scale(1.06); }
}
@keyframes deniz-orbit {
  from { transform: translateY(0) scale(1); opacity: .7; }
  to { transform: translateY(9%) scale(1.08); opacity: 1; }
}

/* Auth card: new DIGITS 9.x design and classic popup both supported. */
.deniz-auth-surface .deniz-auth-card {
  --dform_bg: transparent;
  --dtitle: #ffffff;
  --dprimary: #ffffff;
  --daccent: #f28c8c;
  --dfield_bg: rgba(255,255,255,.075);
  --dbutton_text: #ffffff;
  box-sizing: border-box;
  position: relative;
  width: min(490px, calc(100% - 30px)) !important;
  max-width: 100% !important;
  margin-inline: auto !important;
  padding: 34px 39px 30px !important;
  border-radius: 28px !important;
  border: 1px solid rgba(255,255,255,.23) !important;
  background: linear-gradient(145deg, rgba(35,18,23,.88), rgba(40,19,26,.83)) !important;
  color: #ffffff !important;
  box-shadow: 0 38px 100px rgba(1,12,24,.48),
              inset 0 1px 0 rgba(255,255,255,.20) !important;
  backdrop-filter: blur(27px) saturate(1.2);
  -webkit-backdrop-filter: blur(27px) saturate(1.2);
  animation: deniz-card-entry .64s cubic-bezier(.2,.82,.2,1) both;
  overflow: visible;
}
.deniz-auth-surface .deniz-auth-card::before {
  content: "";
  height: 3px;
  width: 86px;
  position: absolute;
  top: -1px;
  right: calc(50% - 43px);
  border-radius: 0 0 10px 10px;
  background: linear-gradient(90deg, var(--deniz-aqua), var(--deniz-rose));
  box-shadow: 0 2px 19px rgba(203,1,1,.45);
}
@keyframes deniz-card-entry {
  from { opacity: 0; transform: translateY(32px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.deniz-auth-surface .deniz-auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  direction: rtl;
  margin-bottom: 22px;
  gap: 5px;
  position: relative;
  z-index: 2;
}
.deniz-auth-surface .deniz-auth-logo {
  height: auto !important;
  max-height: 67px !important;
  max-width: 170px !important;
  width: auto !important;
  object-fit: contain;
  margin: 0 auto 16px;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,.16));
}
.deniz-auth-name {
  color: #f2b2b2;
  font: 800 15px/1.4 system-ui, sans-serif;
  letter-spacing: .24em;
  margin: 8px 0 12px;
}
.deniz-auth-surface .deniz-auth-eyebrow {
  color: #ef9f9f;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .015em;
  margin-bottom: 5px;
}
.deniz-auth-surface .deniz-auth-welcome {
  color: #ffffff;
  font-size: clamp(23px,3.1vw,29px);
  font-weight: 900;
  line-height: 1.5;
}
.deniz-auth-surface .deniz-auth-description {
  font-size: 13px;
  color: #bbd0d2;
  line-height: 1.9;
  font-weight: 400;
}
.deniz-auth-surface .deniz-auth-footnote {
  color: #b2c3ca;
  text-align: center;
  font-size: 11px;
  font-weight: 400;
  opacity: .8;
  line-height: 1.9;
  margin-top: 16px;
}

/* Existing Digits headings / labels / links. */
.deniz-auth-surface .deniz-auth-card .digits-form_heading,
.deniz-auth-surface .deniz-auth-card .dig_sml_box_msg_head,
.deniz-auth-surface .deniz-auth-card .digits-form_tab-bar .digits-form_tab-item {
  color: #ffffff !important;
}
.deniz-auth-surface .deniz-auth-card .digits-form_heading {
  font-size: 19px !important;
  text-align: center !important;
  margin: 0 0 20px !important;
  line-height: 1.6;
}
.deniz-auth-surface .deniz-auth-card .digits-form_body { margin-top: 15px; }
.deniz-auth-surface .deniz-auth-card .digits-form_tab-bar { justify-content: center; }
.deniz-auth-surface .deniz-auth-card .digits-form_tab-bar .digits-tab_active {
  color: #ffb0b0 !important;
  border-bottom-color: #cb0101 !important;
}
.deniz-auth-surface .deniz-auth-card .digits-form_tab-bar .digits-form_tab-item {
  font-size: 15px !important;
  font-weight: 700 !important;
}
.deniz-auth-surface .deniz-auth-card .digits-form_input label,
.deniz-auth-surface .deniz-auth-card .digits-form_hint,
.deniz-auth-surface .deniz-auth-card .digits-form_link,
.deniz-auth-surface .deniz-auth-card .dig_sml_box_msg,
.deniz-auth-surface .deniz-auth-card .signdesc {
  color: #d9e3e5 !important;
}
.deniz-auth-surface .deniz-auth-card a { color: #ffb0b0; }
.deniz-auth-surface .deniz-auth-card .digits-form_input_row { margin-bottom: 17px; }

/* Inputs: single phone number and DIGITS-native OTP field are unchanged functionally. */
.deniz-auth-surface .deniz-auth-card .digits-form_input input:not([type='checkbox']):not([type='radio']):not(.countrycode):not(.deniz-otp-native),
.deniz-auth-surface .deniz-auth-card .minput input:not([type='checkbox']):not([type='radio']):not([type='hidden']):not(.deniz-otp-native) {
  background: rgba(255,255,255,.085) !important;
  color: #fff !important;
  border: 1px solid rgba(192,220,224,.23) !important;
  border-radius: 13px !important;
  min-height: 53px;
  box-shadow: none !important;
  transition: box-shadow .22s ease, background .22s ease, border-color .22s ease;
}
.deniz-auth-surface .deniz-auth-card input::placeholder {
  color: rgba(225,237,240,.60) !important;
  opacity: 1 !important;
}
.deniz-auth-surface .deniz-auth-card .digits-form_input input:focus,
.deniz-auth-surface .deniz-auth-card .minput input:focus {
  border-color: #cb0101 !important;
  box-shadow: 0 0 0 4px rgba(203,1,1,.21) !important;
  outline: none !important;
}
.deniz-auth-surface .deniz-auth-card input.countrycode {
  color: #eefafa !important;
  background: transparent !important;
}

/* Buttons: preserve native click handlers and native disabled/loading behavior. */
.deniz-auth-surface .deniz-auth-card .digits-form_button:not(.digits-form_passwordless_login),
.deniz-auth-surface .deniz-auth-card .button[type='submit'],
.deniz-auth-surface .deniz-auth-card .loginviasms,
.deniz-auth-surface .deniz-auth-card .dig_verify_otp {
  border: 0 !important;
  background: linear-gradient(110deg, #cb0101 0%, #b10101 54%, #920101 100%) !important;
  color: #fff !important;
  border-radius: 13px !important;
  box-shadow: 0 11px 25px rgba(203,1,1,.24) !important;
  text-shadow: none !important;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.deniz-auth-surface .deniz-auth-card .digits-form_button:not(:disabled):hover,
.deniz-auth-surface .deniz-auth-card .button[type='submit']:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(203,1,1,.34) !important;
  filter: brightness(1.07);
}
.deniz-auth-surface .deniz-auth-card .digits-form_button:focus-visible,
.deniz-auth-surface .deniz-auth-card .button[type='submit']:focus-visible { outline: 3px solid #ff8e8e !important; outline-offset: 3px; }
.deniz-auth-surface .deniz-auth-card .digits-form_button[disabled],
.deniz-auth-surface .deniz-auth-card button:disabled { cursor: not-allowed !important; opacity: .55; }
.deniz-auth-surface .deniz-auth-card .digits-form_passwordless_login { border-color: rgba(255,255,255,.35); color: #fff; }
.deniz-auth-surface .deniz-auth-card .digits-form_login_separator,
.deniz-auth-surface .deniz-auth-card .dig_login_signup_bar { color: #d4e0e4 !important; }

/* The modern full-page footer stays outside of the new card. */
.deniz-auth-surface .digits_site_footer_box { color: rgba(240,252,253,.70); position: relative; z-index: 3; }
.deniz-auth-surface .digits_site_footer_box .digits_site_logo { opacity: .75; }
.deniz-auth-surface .protected_by_digits { color: rgba(240,252,253,.7); }

/* Classic Digits modal compatibility (not an Elementor popup). */
.deniz-auth-popup.deniz-auth-surface { overflow-y: auto; }
.deniz-auth-popup .dig-modal-con.deniz-auth-card,
.deniz-auth-popup .dig_ma-box.deniz-auth-card { color: #fff !important; }
.deniz-auth-popup .deniz-auth-card .digloginpage,
.deniz-auth-popup .deniz-auth-card .register,
.deniz-auth-popup .deniz-auth-card .forgot { color: #fff; }
.deniz-auth-popup .deniz-auth-card .dig-login-otp,
.deniz-auth-popup .deniz-auth-card .dig_verify_mobile_otp_container { color: #fff; }
.deniz-auth-popup .dig_login_cancel { z-index: 9; }

/* Separate visual OTP boxes; the real Digits input overlays them invisibly.
   Digits still owns values, autofill, resend/verify events and any validation. */
.deniz-auth-surface .deniz-otp-host {
  position: relative !important;
  width: 100%;
  min-height: 67px;
  margin: 10px auto;
  box-sizing: border-box;
}
.deniz-auth-surface .deniz-otp-host > .deniz-otp-native {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 3 !important;
  width: 100% !important;
  height: 67px !important;
  max-height: 100% !important;
  opacity: 1 !important;
  -webkit-text-fill-color: transparent !important;
  background: transparent !important;
  color: transparent !important;
  caret-color: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  cursor: text !important;
}
.deniz-auth-surface .deniz-otp-grid {
  display: grid;
  grid-template-columns: repeat(var(--deniz-otp-count, 6), minmax(0,1fr));
  gap: clamp(4px,1.5vw,10px);
  direction: ltr;
  height: 67px;
  pointer-events: none;
}
.deniz-auth-surface .deniz-otp-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 62px;
  border: 1px solid rgba(210,231,233,.29);
  border-radius: 12px;
  background: rgba(255,255,255,.095);
  color: #fff;
  font: 700 24px/1 system-ui, sans-serif;
  direction: ltr;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  transition: background .16s, transform .16s, border-color .16s, box-shadow .16s;
}
.deniz-auth-surface .deniz-otp-cell.is-filled {
  border-color: rgba(239,123,123,.70);
  background: rgba(203,1,1,.17);
  animation: deniz-digit-pop .23s ease-out;
}
.deniz-auth-surface .deniz-otp-cell.is-current {
  border-color: #f78a8a;
  box-shadow: 0 0 0 3px rgba(203,1,1,.18), 0 0 18px rgba(203,1,1,.13);
}
@keyframes deniz-digit-pop { from { transform: scale(.87); } to { transform: scale(1); } }
.deniz-auth-checking .deniz-otp-grid { animation: deniz-otp-breathe 1s ease-in-out infinite alternate; }
@keyframes deniz-otp-breathe { to { opacity: .55; transform: scale(.98); } }
.deniz-auth-otp-error .deniz-otp-grid { animation: deniz-otp-shake .28s ease; }
.deniz-auth-otp-error .deniz-otp-cell { border-color: #ff7f95; }
@keyframes deniz-otp-shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

/* Successful server verification, not simply reaching a certain OTP length. */
.deniz-auth-surface .deniz-auth-verified {
  position: absolute;
  inset: 0;
  z-index: 30;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  padding: 25px;
  box-sizing: border-box;
  background: rgba(29,16,20,.97);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: deniz-verified-entry .22s ease-out both;
}
.deniz-auth-surface .deniz-auth-verified strong { font-size: 20px; line-height: 1.8; }
.deniz-auth-surface .deniz-auth-verified span { color: #b9d8d7; font-size: 12px; }
.deniz-auth-surface .deniz-auth-checkcircle {
  width: 83px;
  height: 83px;
  border-radius: 50%;
  border: 2px solid #45d4a1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(40,209,146,.095);
  box-shadow: 0 0 0 11px rgba(40,209,146,.055);
  animation: deniz-verified-circle .45s cubic-bezier(.2,1.8,.4,1) both;
}
.deniz-auth-surface .deniz-auth-checkcircle svg { width: 60px; height: 60px; overflow: visible; }
.deniz-auth-surface .deniz-auth-checkcircle svg path {
  stroke: #50e1b0;
  stroke-width: 5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 72;
  stroke-dashoffset: 72;
  animation: deniz-checkdraw .36s .12s ease-out forwards;
}
@keyframes deniz-checkdraw { to { stroke-dashoffset: 0; } }
@keyframes deniz-verified-entry { from { opacity: 0; } to { opacity: 1; } }
@keyframes deniz-verified-circle { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 600px) {
  .deniz-auth-page.deniz-auth-surface { padding: 18px 0; min-height: 100svh; }
  .deniz-auth-surface .deniz-auth-card {
    width: calc(100% - 26px) !important;
    padding: 27px 23px 25px !important;
    border-radius: 23px !important;
  }
  .deniz-auth-surface .deniz-auth-logo { max-height: 52px !important; max-width: 140px !important; }
  .deniz-auth-surface .deniz-auth-welcome { font-size: 24px; }
  .deniz-auth-surface .deniz-auth-description { font-size: 12px; }
  .deniz-auth-surface .deniz-auth-card .digits-form_heading { font-size: 18px !important; }
  .deniz-auth-surface .deniz-otp-cell { border-radius: 9px; height: 56px; font-size: 21px; }
  .deniz-auth-surface .deniz-otp-grid { height: 60px; }
  .deniz-auth-surface .deniz-otp-host { min-height: 60px; }
  .deniz-auth-surface .deniz-otp-host > .deniz-otp-native { height: 60px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .deniz-auth-surface, .deniz-auth-surface *,
  .deniz-auth-surface::before, .deniz-auth-surface::after,
  .deniz-auth-surface *::before, .deniz-auth-surface *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* 1.0.1: remove duplicate footer branding and redundant initial labels. */
.deniz-auth-surface .digits_site_footer_box .digits_site_logo,
.deniz-auth-surface .deniz-auth-card .deniz-auth-redundant-label {
  display: none !important;
}
.deniz-auth-surface .deniz-auth-card .digits-form_heading.deniz-auth-compact-heading {
  margin: 0 !important;
  min-height: 0 !important;
}
/* Collapse only an empty logo footer, retaining any footer links or notices. */
.deniz-auth-surface .digits_site_footer_box:has(> .digits_site_logo:only-child) {
  padding: 0 !important;
}
/* Align the empty phone field too: placeholder alignment alone varies by browser.
   Filled numbers retain Digits' original direction and country-code positioning. */
.deniz-auth-surface .deniz-auth-card input.dig-mobile_field:placeholder-shown,
.deniz-auth-surface .deniz-auth-card input.mobile_field:placeholder-shown,
.deniz-auth-surface .deniz-auth-card input[name="mobile_email"]:placeholder-shown {
  text-align: right !important;
}
.deniz-auth-surface .deniz-auth-card input.dig-mobile_field::placeholder,
.deniz-auth-surface .deniz-auth-card input.mobile_field::placeholder,
.deniz-auth-surface .deniz-auth-card input[name="mobile_email"]::placeholder {
  text-align: right !important;
  direction: rtl;
}

/* 1.0.2: anchor the native dismiss control inside the card, in RTL and LTR.
   Do not force display: Digits may intentionally disable dismissal. */
.deniz-auth-surface .deniz-auth-card > .deniz-auth-close {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  bottom: auto !important;
  left: auto !important;
  width: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  z-index: 40;
  cursor: pointer;
  background-position: center;
  background-repeat: no-repeat;
}
.deniz-auth-surface .deniz-auth-card > .deniz-auth-close .digits-cancel {
  position: absolute !important;
  inset: 0 !important;
  width: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  background-position: center;
}
.deniz-auth-surface .deniz-auth-card > .deniz-auth-close a {
  display: block;
  width: 100%;
  height: 100%;
  line-height: 36px;
}
.deniz-auth-surface .deniz-auth-card > .deniz-auth-close:focus-visible,
.deniz-auth-surface .deniz-auth-card > .deniz-auth-close a:focus-visible {
  outline: 2px solid #ff8e8e;
  outline-offset: 2px;
  border-radius: 6px;
}

/* 1.0.3: the phone input owns the single visible border in both states.
   Digits also highlights its surrounding row on focus; suppress that extra frame
   without changing its dimensions or clipping the country-code dropdown. */
.deniz-auth-surface .deniz-auth-card .digits-form_border:has(input.dig-mobile_field) {
  border-color: transparent !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  outline: none !important;
}
.deniz-auth-surface .deniz-auth-card .digits-form_input input.dig-mobile_field:not([type='checkbox']):not([type='radio']):not(.countrycode):not(.deniz-otp-native):focus {
  border-color: #cb0101 !important;
  border-radius: 13px !important;
  box-shadow: none !important;
  outline: none !important;
}

/* 1.0.7: remove only the OTP information icon and its tooltip.
   Validation errors, resend controls and the native back button stay intact. */
.deniz-auth-surface .deniz-auth-card .digits_otp_info,
.deniz-auth-surface .deniz-auth-card .digits_otp_info_desc {
  display: none !important;
}

/* 1.0.8: small change-number action, matching the description above it. */
.deniz-auth-surface .deniz-auth-card .digits-form_heading.deniz-change-phone-heading,
.deniz-auth-surface .deniz-auth-card .deniz-change-phone-heading .digits-form_heading_text {
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.9 !important;
}
.deniz-auth-surface .deniz-auth-card button.deniz-change-phone {
  appearance: none;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  width: auto !important;
  height: auto !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.9 !important;
  color: #bbd0d2 !important;
  cursor: pointer;
}
.deniz-auth-surface .deniz-change-phone:hover { text-decoration: underline; }
.deniz-auth-surface .deniz-change-phone:focus-visible { outline: 2px solid #ff8e8e; outline-offset: 4px; }
@media (max-width: 600px) {
  .deniz-auth-surface .deniz-auth-card .digits-form_heading.deniz-change-phone-heading,
  .deniz-auth-surface .deniz-auth-card .deniz-change-phone-heading .digits-form_heading_text,
  .deniz-auth-surface .deniz-auth-card button.deniz-change-phone { font-size: 12px !important; }
}
