
/* === Dana Font Force - Round 3 Auth === */


html, body, button, input, select, textarea, .auth-page, .auth-card, .auth-form, .btn {
  font-family: "Dana", "Dana FaNum", "Dana", Tahoma, Arial, sans-serif !important;
}


@font-face {
  font-family: 'Dana';
  src: url('../font/dana/Dana-FaNum-Thin.ttf') format('truetype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dana';
  src: url('../font/dana/Dana-FaNum-ExtraLight.ttf') format('truetype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dana';
  src: url('../font/dana/Dana-FaNum-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dana';
  src: url('../font/dana/Dana-FaNum-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dana';
  src: url('../font/dana/Dana-FaNum-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dana';
  src: url('../font/dana/Dana-FaNum-DemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dana';
  src: url('../font/dana/Dana-FaNum-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dana';
  src: url('../font/dana/Dana-FaNum-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dana';
  src: url('../font/dana/Dana-FaNum-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dana';
  src: url('../font/dana/Dana-FaNum-UltraBold.ttf') format('truetype');
  font-weight: 950;
  font-style: normal;
  font-display: swap;
}



:root {
  --ui-bg: #faf9f6;
  --ui-surface: #ffffff;
  --ui-surface-soft: #fdfcf9;
  --ui-gold: #d19a00;
  --ui-gold-hover: #b98400;
  --ui-gold-dark: #8d6600;
  --ui-gold-soft: #fff8e7;
  --ui-gold-border: #e4c36a;
  --ui-text: #242424;
  --ui-text-secondary: #767676;
  --ui-text-muted: #999999;
  --ui-border: #e9e5dc;
  --ui-danger: #c84b4b;
  --ui-shadow: 0 18px 55px rgba(52, 39, 8, 0.10);
  --ui-shadow-soft: 0 5px 20px rgba(52, 39, 8, 0.06);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: "Dana", "Dana FaNum", "Dana", Tahoma, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
}

.auth-page {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 48px 24px;
  background:
    radial-gradient(circle at 76% 10%, rgba(209, 154, 0, 0.06), transparent 24%),
    radial-gradient(circle at 8% 88%, rgba(209, 154, 0, 0.05), transparent 27%),
    linear-gradient(135deg, #fff 0%, #faf9f6 48%, #fffdf8 100%);
}

.auth-page::before,
.auth-page::after {
  position: absolute;
  z-index: -2;
  width: 440px;
  height: 440px;
  border: 1px solid rgba(209, 154, 0, 0.12);
  border-radius: 50%;
  content: "";
}

.auth-page::before {
  top: -260px;
  left: -130px;
  box-shadow:
    0 0 0 44px rgba(209, 154, 0, 0.028),
    0 0 0 90px rgba(209, 154, 0, 0.018);
}

.auth-page::after {
  right: -230px;
  bottom: -250px;
  box-shadow:
    0 0 0 50px rgba(209, 154, 0, 0.025),
    0 0 0 98px rgba(209, 154, 0, 0.016);
}

.auth-decoration {
  position: absolute;
  z-index: -1;
  width: 230px;
  height: 230px;
  opacity: 0.48;
  pointer-events: none;
}

.auth-decoration--top {
  top: 70px;
  right: 70px;
}

.auth-decoration--bottom {
  bottom: 54px;
  left: 64px;
  transform: scale(0.86);
}

.auth-decoration__person {
  position: absolute;
  right: 82px;
  bottom: 32px;
  width: 58px;
  height: 58px;
  border: 2px solid rgba(209, 154, 0, 0.32);
  border-radius: 50%;
}

.auth-decoration__person::after {
  position: absolute;
  top: 70px;
  right: -21px;
  width: 96px;
  height: 54px;
  border: 2px solid rgba(209, 154, 0, 0.32);
  border-radius: 54px 54px 18px 18px;
  content: "";
}

.auth-decoration__bubble {
  position: absolute;
  top: 12px;
  left: 0;
  width: 106px;
  height: 82px;
  border: 2px solid rgba(209, 154, 0, 0.32);
  border-radius: 52px;
}

.auth-decoration__bubble::after {
  position: absolute;
  right: 17px;
  bottom: -12px;
  width: 24px;
  height: 24px;
  border-right: 2px solid rgba(209, 154, 0, 0.32);
  border-bottom: 2px solid rgba(209, 154, 0, 0.32);
  background: #fffdf8;
  content: "";
  transform: rotate(38deg);
}

.auth-decoration__dots,
.auth-decoration__dots::before,
.auth-decoration__dots::after {
  position: absolute;
  top: 47px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(209, 154, 0, 0.42);
  content: "";
}

.auth-decoration__dots {
  left: 48px;
}

.auth-decoration__dots::before {
  top: 0;
  left: -19px;
}

.auth-decoration__dots::after {
  top: 0;
  left: 19px;
}

.auth-shell {
  width: min(100%, 610px);
}

.auth-shell--wide {
  width: min(100%, 760px);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 22px;
  text-align: center;
}

.auth-logo {
  width: 88px;
  height: 88px;
  margin-bottom: 7px;
  color: var(--ui-gold);
  filter: drop-shadow(0 8px 15px rgba(209, 154, 0, 0.13));
}

.auth-logo svg {
  width: 100%;
  height: 100%;
}

.auth-brand__name {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.auth-card {
  position: relative;
  overflow: hidden;
  padding: 42px 48px 36px;
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(14px);
}

.auth-card::before {
  position: absolute;
  top: 0;
  right: 50%;
  width: 120px;
  height: 3px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(90deg, transparent, var(--ui-gold), transparent);
  content: "";
  transform: translateX(50%);
}

.auth-back {
  position: absolute;
  top: 24px;
  right: 26px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--ui-border);
  border-radius: 50%;
  background: #fff;
  color: var(--ui-text-secondary);
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.auth-back:hover {
  border-color: var(--ui-gold-border);
  color: var(--ui-gold-dark);
  transform: translateX(2px);
}

.auth-back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-header {
  margin-bottom: 27px;
  text-align: center;
}

.auth-title {
  margin: 0 0 7px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -0.8px;
}

.auth-subtitle {
  margin: 0;
  color: var(--ui-text-secondary);
  font-size: 15px;
}

.auth-stepper {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 1.7fr minmax(92px, 1fr);
  align-items: start;
  margin: 0 auto 31px;
  direction: rtl;
}

.auth-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: var(--ui-text-muted);
  text-align: center;
}

.auth-step__circle {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #d9d6ce;
  border-radius: 50%;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.auth-step__label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.auth-step.is-active {
  color: var(--ui-gold-dark);
}

.auth-step.is-active .auth-step__circle {
  border-color: var(--ui-gold);
  background: var(--ui-gold);
  box-shadow: 0 5px 16px rgba(209, 154, 0, 0.22);
  color: #fff;
}

.auth-step.is-done {
  color: var(--ui-gold-dark);
}

.auth-step.is-done .auth-step__circle {
  border-color: var(--ui-gold);
  background: var(--ui-gold-soft);
  color: var(--ui-gold-dark);
}

.auth-step__line {
  height: 1px;
  margin-top: 17px;
  background: var(--ui-border);
}

.auth-step__line.is-filled {
  background: linear-gradient(90deg, var(--ui-gold), var(--ui-gold-border));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group--full {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ui-text);
  font-size: 14px;
  font-weight: 700;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 21px;
  height: 21px;
  color: var(--ui-text-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.input-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-control {
  width: 100%;
  height: 54px;
  padding: 0 48px 0 16px;
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-md);
  outline: 0;
  background: #fff;
  color: var(--ui-text);
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control::placeholder {
  color: #b1b1b1;
}

.form-control:hover {
  border-color: #ddd6c4;
}

.form-control:focus {
  border-color: var(--ui-gold);
  box-shadow: 0 0 0 4px rgba(209, 154, 0, 0.11);
}

.form-control:focus + .input-icon,
.input-wrap:focus-within .input-icon {
  color: var(--ui-gold-dark);
}

.form-control--ltr {
  direction: ltr;
  padding-right: 48px;
  text-align: right;
}

.form-help {
  display: block;
  margin-top: 7px;
  color: var(--ui-text-muted);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: linear-gradient(135deg, #e3ad12 0%, var(--ui-gold) 58%, #bd8200 100%);
  box-shadow: 0 10px 24px rgba(209, 154, 0, 0.21);
  color: #fff;
}

.btn--primary:hover {
  box-shadow: 0 13px 28px rgba(209, 154, 0, 0.27);
}

.btn--outline {
  border-color: var(--ui-gold-border);
  background: #fff;
  color: var(--ui-gold-dark);
}

.btn--outline:hover {
  background: var(--ui-gold-soft);
}

.auth-switch {
  margin: 20px 0 0;
  color: var(--ui-text-secondary);
  text-align: center;
  font-size: 14px;
}

.auth-switch a {
  color: var(--ui-gold-dark);
  font-weight: 800;
}

.auth-switch a:hover {
  color: var(--ui-gold-hover);
}

.auth-divider {
  height: 1px;
  margin: 25px 0 20px;
  background: linear-gradient(90deg, transparent, var(--ui-border), transparent);
}

.auth-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 12px;
  text-align: center;
}

.auth-trust svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: var(--ui-gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.otp-message {
  margin-bottom: 24px;
  color: var(--ui-text-secondary);
  text-align: center;
}

.otp-mobile {
  direction: ltr;
  color: var(--ui-text);
  font-weight: 800;
  unicode-bidi: isolate;
}

.otp-group {
  display: flex;
  justify-content: center;
  gap: 13px;
  margin: 8px 0 22px;
  direction: ltr;
}

.otp-input {
  width: 68px;
  height: 72px;
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  outline: none;
  background: #fff;
  color: var(--ui-text);
  font-size: 29px;
  font-weight: 800;
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.otp-input:hover {
  border-color: #ddd6c4;
}

.otp-input:focus {
  border-color: var(--ui-gold);
  box-shadow: 0 0 0 4px rgba(209, 154, 0, 0.11);
  transform: translateY(-2px);
}

.otp-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 25px;
  color: var(--ui-text-secondary);
  font-size: 13px;
}

.otp-timer svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ui-gold);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.otp-time {
  direction: ltr;
  color: var(--ui-gold-dark);
  font-weight: 800;
  unicode-bidi: isolate;
}

.otp-actions {
  display: grid;
  gap: 12px;
}

.otp-resend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
  color: var(--ui-text-secondary);
  font-size: 13px;
}

.otp-resend button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #aaa;
  cursor: not-allowed;
  font-weight: 700;
}

.auth-footer-link {
  display: block;
  margin-top: 18px;
  color: var(--ui-text-muted);
  font-size: 12px;
  text-align: center;
}

.auth-footer-link:hover {
  color: var(--ui-gold-dark);
}

:focus-visible {
  outline: 3px solid rgba(209, 154, 0, 0.20);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .auth-decoration {
    opacity: 0.24;
    transform: scale(0.78);
  }

  .auth-decoration--top {
    top: 10px;
    right: -50px;
  }

  .auth-decoration--bottom {
    bottom: -15px;
    left: -45px;
  }
}

@media (max-width: 640px) {
  .auth-page {
    display: block;
    min-height: 100svh;
    padding: 26px 14px;
  }

  .auth-page::before,
  .auth-page::after,
  .auth-decoration {
    display: none;
  }

  .auth-shell,
  .auth-shell--wide {
    width: 100%;
    max-width: 100%;
  }

  .auth-brand {
    margin-bottom: 18px;
  }

  .auth-logo {
    width: 78px;
    height: 78px;
  }

  .auth-brand__name {
    font-size: 21px;
  }

  .auth-card {
    min-height: calc(100svh - 150px);
    padding: 36px 20px 27px;
    border-radius: 20px;
    box-shadow: var(--ui-shadow-soft);
  }

  .auth-back {
    position: fixed;
    z-index: 4;
    top: 22px;
    right: 17px;
    width: 39px;
    height: 39px;
  }

  .auth-header {
    margin-bottom: 25px;
  }

  .auth-title {
    font-size: 25px;
  }

  .auth-subtitle {
    font-size: 14px;
  }

  .auth-stepper {
    grid-template-columns: minmax(80px, 1fr) 1fr minmax(80px, 1fr);
    margin-bottom: 28px;
  }

  .auth-step__label {
    font-size: 11px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-group--full {
    grid-column: auto;
  }

  .form-control {
    height: 57px;
  }

  .btn {
    min-height: 57px;
  }

  .otp-group {
    gap: 9px;
  }

  .otp-input {
    width: min(17vw, 67px);
    height: min(19vw, 72px);
    min-height: 62px;
    font-size: 26px;
  }
}

@media (max-width: 390px) {
  .auth-page {
    padding-inline: 10px;
  }

  .auth-card {
    padding-inline: 16px;
  }

  .auth-stepper {
    grid-template-columns: minmax(70px, 1fr) 0.7fr minmax(70px, 1fr);
  }

  .auth-step__label {
    white-space: normal;
  }

  .otp-group {
    gap: 7px;
  }
}


/* Backend integration helpers: visual style remains the same as the supplied HTML template. */
.auth-alert {
  margin: -8px 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(200, 75, 75, 0.22);
  border-radius: var(--radius-md);
  background: #fff0f0;
  color: var(--ui-danger);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.auth-hidden {
  display: none !important;
}
.auth-note {
  margin: 0 0 18px;
  color: var(--ui-text-secondary);
  font-size: 13px;
  text-align: center;
}
.otp-time[data-expired="1"] {
  color: var(--ui-danger);
}

/* === Moshaverino bugfix round 2: force Dana on auth === */




html,body,.auth-page,.auth-shell,.auth-card,button,input,select,textarea,.btn{font-family:"Dana",Tahoma,Arial,sans-serif!important}


/* === Round 6: mobile app mode for auth pages === */
html,
body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
  touch-action:manipulation;
  overscroll-behavior:none;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
body{
  min-height:100dvh;
  min-height:-webkit-fill-available;
}
input,
select,
textarea,
button{
  font-size:16px !important;
}
.auth-page,
.auth-shell,
.auth-card{
  max-width:100%;
  box-sizing:border-box;
}
@media (max-width: 768px){
  .auth-page{
    min-height:100dvh;
    padding-left:max(14px, env(safe-area-inset-left));
    padding-right:max(14px, env(safe-area-inset-right));
    padding-top:max(14px, env(safe-area-inset-top));
    padding-bottom:max(14px, env(safe-area-inset-bottom));
  }
  .auth-card{
    width:100%;
  }
  .otp-input,
  .auth-input input{
    font-size:16px !important;
  }
}

/* === Simorgh Round11 Dana definitive local font fix === */


html,body,button,input,select,textarea,.app-shell,.auth-shell,.auth-card,.chat-layout,.data-table,.btn{
  font-family:'Dana','Dana FaNum','Vazirmatn',Tahoma,Arial,sans-serif!important;
}
.chart-canvas-wrap,.chart-canvas-wrap--line,.chart-canvas-wrap--donut{
  position:relative!important;
  display:block!important;
  width:100%!important;
  min-height:320px!important;
  height:320px!important;
  overflow:visible!important;
  direction:ltr!important;
}
.chart-canvas-wrap canvas{
  display:block!important;
  width:100%!important;
  height:320px!important;
  min-height:320px!important;
  opacity:1!important;
  visibility:visible!important;
}
.card:has(.chart-canvas-wrap),.ui-card:has(.chart-canvas-wrap){overflow:visible!important;}
.chart-fallback{position:absolute;inset:0;display:grid;place-items:center;text-align:center;color:#8a7b63;background:rgba(255,255,255,.72);border-radius:22px;z-index:2;}
.chart-fallback.d-none{display:none!important;}
@media(max-width:768px){.chart-canvas-wrap,.chart-canvas-wrap canvas{height:280px!important;min-height:280px!important}}

/* === Simorgh Round12 Font Sanitizer Fix ===
   Dana font files currently served from /assets/font/dana are rejected by browser sanitizers.
   This override prevents slow failed font downloads and keeps a clean Persian system stack.
   To use Dana again, replace the font files with valid webfont files, then add @font-face back. */
:root{
  --simorgh-font-ui: "Dana", "Segoe UI", Arial, sans-serif;
}
html, body,
button, input, textarea, select, option,
.app-shell, .app-layout, .app-sidebar, .workspace, .main-content,
.auth-page, .auth-shell, .auth-card,
.card, .btn, .form-control, .form-select, .dropdown-menu,
table, th, td, .modal, .toast, .badge,
.chat-layout, .chat-panel, .message, .message-bubble{
  font-family: var(--simorgh-font-ui) !important;
}



/* === Round 21: OTP resend button state === */
.otp-resend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.otp-resend button[disabled] {
  opacity: .48;
  cursor: not-allowed;
}
.otp-resend button.is-enabled,
.otp-resend button:not([disabled]) {
  opacity: 1;
  cursor: pointer;
  color: #9b6b12;
  font-weight: 800;
}
