/* Shared geometric status icons for both the app and the operations panel. */

:root {
  --modern-check-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.15' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5 10 17l8.5-9.5'/%3E%3C/svg%3E");
  --modern-check-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.15' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5 10 17l8.5-9.5'/%3E%3C/svg%3E");
  --modern-check-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318212d' stroke-width='2.15' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5 10 17l8.5-9.5'/%3E%3C/svg%3E");
  --modern-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b5b88' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.modern-glyph-icon {
  width: 1.12em;
  height: 1.12em;
  display: inline-block;
  flex: 0 0 auto;
  box-sizing: border-box;
  overflow: visible;
  vertical-align: -.19em;
}

/* Icon-only containers get deterministic geometric centering and larger symbols. */
.modern-icon-only {
  --modern-icon-size: 1.45em;
  display: grid !important;
  place-items: center !important;
  line-height: 0 !important;
}

/* These fallbacks coexist with real SVGs. The glyph-centering utility must
 * never reveal a second icon in the blue/refined foundations. */
.phone.next-ui-theme :is(.legacy-status-glyph, .legacy-receive-glyph, .legacy-energy-glyph) {
  display: none !important;
}

.modern-icon-only > .modern-glyph-icon {
  width: var(--modern-icon-size);
  height: var(--modern-icon-size);
  display: block;
  margin: 0;
  vertical-align: 0;
}

.modern-check-only,
.modern-retry-only {
  --modern-icon-size: 1.55em;
}

.modern-play-only {
  --modern-icon-size: 1.35em;
}

.modern-play-only > .modern-play-icon {
  transform: translateX(.12em);
}

.modern-chevron-down-only,
.modern-alert-only,
.modern-more-only {
  --modern-icon-size: 1.35em;
}

.modern-dot-only {
  --modern-icon-size: .8em;
}

/* Processing uses a spinner inside a stable tile; retry actions remain static. */
.scf-funded-operation.processing > span.modern-progress-only {
  --modern-icon-size: 23px;
  animation: none !important;
  transform: none !important;
}

.scf-funded-operation.processing > span.modern-progress-only > .modern-progress-icon {
  transform-origin: 50% 50%;
  animation: modern-progress-spin .9s linear infinite;
}

@keyframes modern-progress-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .scf-funded-operation.processing > span.modern-progress-only > .modern-progress-icon {
    animation: none;
  }
}

/* Every app cross control stays circular across themes and dynamic sheets.
 * Preserve each control's existing colors, icon geometry and hit area. */
body:not(.admin-app) button:is(.modern-close-only, :has(> svg > use[href="#i-close"])) {
  border-radius: 50% !important;
  flex-shrink: 0;
}

/* Close controls and destructive actions share the glyph, not the same scale. */
button[aria-label*="بستن"].modern-close-only,
button[aria-label*="پنهان"].modern-close-only {
  --modern-icon-size: 19px;
}

.mock-profile-delete.modern-close-only {
  --modern-icon-size: 21px;
}

.admin-app .correction-tag button.modern-close-only {
  --modern-icon-size: 14px;
}

/* Large success confirmations need a dedicated scale, not the inline icon size. */
.phone :is(.review-approved-step, .success-login-step, .account-opened-step, .new-complete-step) .activation-success-mark > svg,
.phone .success-view .success-mark > svg,
.phone.next-ui-theme .customer-operation-step .operation-status-mark.success .modern-status-icon {
  width: 40px;
  height: 40px;
  display: block;
  margin: auto;
  overflow: visible;
}

/* The same check geometry stays centered without font baselines or offsets. */
.phone :is(.modern-check-icon, svg:has(> use[href="#i-check"])) {
  display: block;
  overflow: visible;
  flex-shrink: 0;
  padding: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: none;
}

.phone :is(
  .device-method > i,
  .deposit-option > i,
  .card-address-option > i,
  .delivery-option > b,
  .pos-type-options i,
  .returning-method-option > i,
  .consent-row > span > b,
  .delivery-confirm > span > b,
  .service-picker-check,
  .completion-list > span > i
) > svg:has(> use[href="#i-check"]) {
  width: 14px;
  height: 14px;
}

/* OTP delivery used a font check in this circle, which the DOM scanner cannot
 * see. Keep its color/shape, but paint a centered vector from the same path. */
.phone.next-ui-theme .otp-delivery-status > i::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  padding: 0;
  background-image: var(--modern-check-light);
  background-position: center;
  background-size: 12px 12px;
  background-repeat: no-repeat;
  font-size: 0;
  line-height: 0;
}

/* Native and text carets are replaced by one clear vector treatment. */
.phone.next-ui-theme select:not([multiple]),
.admin-app select:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  padding-left: 38px !important;
  background-image: var(--modern-select-chevron) !important;
  background-position: left 12px center !important;
  background-size: 16px 16px !important;
  background-repeat: no-repeat !important;
}

/* App icon controls: larger symbols with fixed, visible hit-area proportions. */
.phone.next-ui-theme :is(.search-field > svg, .field > div > svg:first-child) {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
}

.phone.next-ui-theme .card-serial-help-button > span:first-child > svg:has(> use[href="#i-search"]) {
  width: 21px;
  height: 21px;
  display: block;
  margin: auto;
}

.phone.next-ui-theme :is(.bottom-sheet > header > button, .transfer-header > button) > svg:has(> use[href="#i-close"]),
.phone.next-ui-theme button[aria-label*="بستن"] > svg:has(> use[href="#i-close"]),
.phone.next-ui-theme button[aria-label*="پاک‌کردن"] > svg:has(> use[href="#i-close"]) {
  width: 21px;
  height: 21px;
  display: block;
  margin: auto;
}

.phone.next-ui-theme :is(.destination-help-button, .guided-tour-control-mark, .guided-tour-progress-icon).modern-icon-only {
  --modern-icon-size: 19px;
}

.phone.next-ui-theme .destination-help-button.modern-icon-only {
  --modern-icon-size: 22px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.phone.next-ui-theme :is(
  #close-mobile-scenario,
  #close-mock-data,
  #guided-tour-progress-close,
  #guided-tour-tooltip-close
).modern-icon-only {
  --modern-icon-size: 19px;
}

.phone.next-ui-theme :is(.round-symbol, .row-symbol, .business-primary-action > span, .control-grid button > span, .smart-route-main > span).modern-icon-only {
  --modern-icon-size: 19px;
}

.phone.next-ui-theme .scf-role-map > i.modern-icon-only {
  --modern-icon-size: 15px;
}

.scenario-counter button.modern-icon-only {
  --modern-icon-size: 16px;
  width: 100%;
  height: 100%;
  padding: 0 !important;
}

/* Panel icon controls share three explicit container scales. */
.admin-app .main-nav button > i.modern-icon-only {
  --modern-icon-size: 18px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.admin-app .metric-card header > i.modern-icon-only {
  --modern-icon-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.admin-app :is(.operations-queue-strip button > i, .document-review-panel aside > button > i, .shortcuts button > i).modern-icon-only {
  --modern-icon-size: 17px;
}

.admin-app :is(.global-search > span, .inline-search > span).modern-icon-only {
  --modern-icon-size: 19px;
  flex: 0 0 20px;
}

.admin-app .icon-button > span.modern-icon-only {
  --modern-icon-size: 21px;
}

.modal > header > button.modern-icon-only,
.admin-app :is(.scf-info-modal, .scf-page-help-modal) > header > button.modern-icon-only,
.admin-guide-progress > header :is(i, button).modern-icon-only {
  --modern-icon-size: 18px;
}

.admin-app :is(.profile-menu-button > b, .admin-test-menu summary > b).modern-icon-only {
  --modern-icon-size: 16px;
  width: 20px;
  height: 20px;
}

.admin-app .evidence-preview > i.modern-icon-only {
  --modern-icon-size: 28px;
}

.admin-app :is(.check-grid article > i, .decision-readiness i, .timeline article > i, .mini-operation-timeline i, .automatic-api-note i).modern-icon-only {
  --modern-icon-size: 15px;
}

/* Equal zoom controls: plus and minus now have the same square container. */
.admin-app .document-toolbar {
  min-height: 54px;
}

.admin-app .document-toolbar > div {
  gap: 6px;
}

.admin-app .document-toolbar button.modern-icon-only {
  --modern-icon-size: 17px;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
}

.admin-app .document-toolbar b {
  min-width: 54px;
  padding: 0 7px;
  font-size: 11px !important;
  text-align: center;
}

/* Numbered pipelines remain textual, but use the same readable badge scale. */
.admin-app .detail-core-pipeline article {
  min-height: 44px;
  grid-template-columns: 28px 1fr;
  gap: 8px;
}

.admin-app .detail-core-pipeline article > i {
  width: 26px;
  height: 26px;
  font-size: 10px;
  line-height: 1;
}

.admin-app .detail-core-pipeline article:first-child::after {
  top: 34px;
  right: 12px;
  bottom: -9px;
}

.admin-app .scf-admin-pipeline i,
.admin-guide-list li::before,
.phone.next-ui-theme .scf-role-steps li > i,
.guided-tour-progress-list li::before {
  font-size: 10px;
  line-height: 1;
}

.admin-app :is(.scf-supply-chain article > i, .scf-example-card li > i, .scf-page-help-grid > button > i) {
  font-size: 11px;
  line-height: 1;
}

/* Password requirements use the icon directly rather than a circular badge. */
.password-requirements span.passed::before {
  content: "";
  width: 1.18em;
  height: 1.18em;
  display: inline-block;
  margin-left: 6px;
  vertical-align: -.16em;
  background-color: currentColor;
  -webkit-mask: var(--modern-check-mask) center / contain no-repeat;
  mask: var(--modern-check-mask) center / contain no-repeat;
}

/* These pseudo-elements are also status containers, so keep their background. */
.guided-tour-progress-list li.is-done::before,
.admin-guide-list li.is-done::before {
  content: "";
  background-image: var(--modern-check-light);
  background-position: center;
  background-size: 78%;
  background-repeat: no-repeat;
}

/* The liveness camera uses a light surface with a dark confirmation mark. */
.face-scan.verified .face-frame > b::after,
.face-camera .face-frame > b::after {
  content: "";
  width: 1em;
  height: 1em;
  display: block;
  background: var(--modern-check-dark) center / contain no-repeat;
}

/* The modern blue confirmation badge uses the app's standard light check. */
.phone.next-ui-theme .face-camera .face-frame > b::after {
  width: 20px;
  height: 20px;
  border: 0;
  background: var(--modern-check-light) center / contain no-repeat;
  transform: none;
}
