@import url('/assets/css/fonts.css');
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #eef1f6;
  --border: #e2e6ee;
  --border-strong: #d3d9e4;

  --text: #16213b;
  --muted: #66738a;
  --muted-2: #97a1b3;

  --primary: #2e5aac;
  --primary-dark: #21437f;
  --primary-soft: #e7edfa;

  --accent: #c98a3e;
  --accent-soft: #f7ecd9;

  --success: #1da774;
  --success-soft: #e1f6ee;
  --danger: #e1435b;
  --danger-soft: #fcebee;

  --input-bg: #f7f8fb;
  --input-bg-focus: #ffffff;
  --input-border: #dde2ec;

  --shadow: 0 10px 28px rgba(20, 30, 60, 0.07);
  --shadow-sm: 0 4px 14px rgba(20, 30, 60, 0.05);

  --radius: 20px;
  --radius-sm: 13px;
}

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

html, body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  width: min(100%, 460px);
  min-height: 100dvh;
  margin: auto;
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--primary);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-text strong {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.brand-text small {
  color: var(--muted);
  font-size: 11px;
}

.progress-wrap {
  position: relative;
  height: 32px;
  margin-bottom: 12px;
}

.progress-line {
  position: absolute;
  top: 12px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--border);
}

#progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--primary);
}

.progress-steps {
  position: relative;
  display: flex;
  justify-content: space-between;
}

.progress-step {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-2);
  background: var(--surface);
  border: 1px solid var(--border);
}

.progress-step.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.progress-step.done {
  color: #fff;
  border-color: var(--success);
  background: var(--success);
}

.login-stage {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.login-card {
  width: 100%;
  padding: 26px 22px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hidden { display: none !important; }

.card-heading { margin-bottom: 22px; }

.eyebrow {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.card-heading h1 {
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.card-heading p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.9;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field { width: 100%; }

.field label,
.otp-area > label,
.role-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.input-wrap {
  position: relative;
  width: 100%;
}

.input {
  width: 100%;
  height: 52px;
  padding: 0 42px 0 15px;
  border: 1px solid var(--input-border);
  border-radius: 14px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
}

.input::placeholder {
  color: var(--muted-2);
  font-weight: 400;
}

.input:focus {
  border-color: var(--primary);
  background: var(--input-bg-focus);
}

.input:read-only {
  color: var(--muted);
  background: var(--surface-soft);
  cursor: not-allowed;
}

.input-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 14px;
  pointer-events: none;
}

.input:focus ~ .input-icon { color: var(--primary); }

.role-section { margin-top: 2px; }

.role-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.role-item { position: relative; cursor: pointer; }

.role-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-content {
  min-height: 54px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.role-item input:checked + .role-content {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.role-info strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.role-item input:checked + .role-content .role-info strong {
  color: var(--primary-dark);
}

.primary-btn {
  position: relative;
  width: 100%;
  height: 54px;
  margin-top: 22px;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.btn-arrow { font-size: 16px; }

.ghost-btn {
  width: 100%;
  height: 48px;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ghost-btn:active { background: var(--surface-soft); }

.otp-area { margin-top: 4px; }

.otp-wrap .input {
  height: 62px;
  text-align: center;
  direction: ltr;
  padding: 0 20px;
  font-size: 24px;
  letter-spacing: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.otp-wrap .input::placeholder { letter-spacing: 8px; }

.otp-hint {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.secure-note {
  margin-top: 16px;
  text-align: center;
  color: var(--muted-2);
  font-size: 10.5px;
}

.back-btn {
  position: fixed;
  z-index: 20;
  top: 22px;
  left: 20px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
}

.toast {
  position: fixed;
  z-index: 100;
  top: 18px;
  right: 50%;
  transform: translateX(50%);
  min-width: min(330px, calc(100% - 30px));
  min-height: 46px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
}

.toast.hidden { display: none; }

.toast-icon {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--muted-2);
}

.toast.success { border-color: var(--success); background: var(--success-soft); }
.toast.success .toast-icon { background: var(--success); }

.toast.error { border-color: var(--danger); background: var(--danger-soft); }
.toast.error .toast-icon { background: var(--danger); }

.toast-text { color: var(--text); }

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 10px;
}

.app-footer i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.location-selector { position: relative; width: 100%; }

.location-select-btn {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  border: 1px solid var(--input-border);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}

.location-select-btn.active {
  border-color: var(--primary);
  background: var(--input-bg-focus);
}

.location-btn-icon {
  color: var(--muted-2);
  margin-left: 12px;
  font-size: 15px;
}

.location-selected-text {
  flex: 1;
  text-align: right;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.location-selected-text.selected {
  color: var(--text);
  font-weight: 700;
}

.location-arrow {
  color: var(--muted-2);
  font-size: 16px;
}

.location-select-btn.active .location-arrow { transform: rotate(180deg); }

.accordion-list {
  display: none;
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  padding: 7px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.accordion-list.open { display: block; }

.province-item {
  border-radius: 11px;
  overflow: hidden;
  margin-bottom: 4px;
}

.province-item:last-child { margin-bottom: 0; }

.province-header {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 0;
  background: var(--surface-soft);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}

.province-header b { font-size: 11px; font-weight: 700; }

.accordion-arrow { color: var(--muted-2); font-size: 15px; }

.province-item.open .province-header {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.province-item.open .accordion-arrow { transform: rotate(180deg); }

.city-list {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 7px 5px;
  background: var(--surface);
}

.province-item.open .city-list { display: grid; }

.city-list button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 9px;
  cursor: pointer;
}

.city-list button.selected {
  color: #fff;
  font-weight: 700;
  background: var(--primary);
  border-color: var(--primary);
}

.accordion-list::-webkit-scrollbar { width: 4px; }
.accordion-list::-webkit-scrollbar-track { background: transparent; }
.accordion-list::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}

@media (min-width: 600px) {
  body { display: flex; align-items: center; justify-content: center; padding: 25px; }
  .app { min-height: auto; padding: 10px 0; }
  .login-card { padding: 30px 28px 26px; }
}

@media (max-height: 700px) {
  .app { padding-top: 18px; }
  .brand { margin-bottom: 16px; }
  .card-heading { margin-bottom: 16px; }
  .fields { gap: 12px; }
  .input { height: 48px; }
  .primary-btn { height: 50px; margin-top: 16px; }
}

@media (max-width: 360px) {
  .app { padding-left: 14px; padding-right: 14px; }
  .login-card { padding: 22px 16px 18px; }
}

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

.input:focus-visible,
.primary-btn:focus-visible,
.ghost-btn:focus-visible,
.location-select-btn:focus-visible,
.back-btn:focus-visible,
.city-list button:focus-visible,
.province-header:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.install-app-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  display: flex;
  justify-content: center;
  padding: 10px 12px 0;
}

.install-app-modal.hidden { display: none; }

.install-app-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 12px;
  box-shadow: var(--shadow);
}

.install-app-badge {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.install-app-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.install-app-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.install-app-desc {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.install-app-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.install-app-arrow { font-size: 12px; }

.install-app-cancel {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

@media (max-width: 360px) {
  .install-app-desc { display: none; }
}


/* BAMAL_ACCOUNT_TYPE_ACCORDION */
.account-type-toggle {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border: 1px solid var(--input-border);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.account-type-toggle.active {
  border-color: var(--primary);
  background: var(--input-bg-focus);
}
.account-type-arrow {
  color: var(--muted-2);
  font-size: 16px;
  transition: transform .15s;
}
.account-type-toggle.active .account-type-arrow {
  transform: rotate(180deg);
}
.account-type-accordion {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.account-type-accordion.hidden { display: none; }
.account-type-option {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.account-type-option:active { background: var(--primary-soft); }
.guest-btn-yellow {
  border-color: #e2b93e !important;
  background: #fdf6e3 !important;
  color: #8a6d1a !important;
  font-weight: 700 !important;
}


/* BAMAL_BOTTOM_NOTICE (no animation) */
.sf-bottom-notice{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 99997;
  width: calc(100% - 24px);
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f2645, #1c3f73);
  color: #fff;
  box-shadow: 0 14px 34px rgba(15, 38, 69, .35);
  font-family: inherit;
  direction: rtl;
}
.sf-bottom-notice.hidden{ display: none; }
.sf-bottom-notice-icon{
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.sf-bottom-notice-text{
  flex: 1;
  font-size: 12.5px;
  line-height: 1.9;
  font-weight: 700;
}
.sf-bottom-notice-close{
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 700px){
  .sf-bottom-notice{ bottom: 26px; }
}
