/* MondFX standalone register — palette: #ffffff, #ef2f03, #000, #ebeef2 */

:root {
  --bg-page: #ebeef2;
  --bg-card: #ffffff;
  --action: #ef2f03;
  --action-hover: #d62a03;
  --text: #1a1a1a;
  --text-muted: #5c6570;
  --border: #d8dde4;
  --promo-text: rgba(255, 255, 255, 0.92);
  --promo-muted: rgba(255, 255, 255, 0.65);
  --radius-card: 20px;
  --radius-input: 10px;
  --shadow-card: 0 24px 48px rgba(0, 0, 0, 0.08);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.45;
}

.mfx-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  padding-top: 0.75rem;
}

/* Persian — Vazirmatn */
.mfx-page[data-lang='fa'],
.mfx-page[data-lang='fa'] input,
.mfx-page[data-lang='fa'] select,
.mfx-page[data-lang='fa'] button,
.mfx-page[data-lang='fa'] textarea {
  font-family: 'Vazirmatn', 'Tahoma', system-ui, sans-serif;
}

/* Arabic — Noto Sans Arabic */
.mfx-page[data-lang='ar'],
.mfx-page[data-lang='ar'] input,
.mfx-page[data-lang='ar'] select,
.mfx-page[data-lang='ar'] button,
.mfx-page[data-lang='ar'] textarea {
  font-family: 'Noto Sans Arabic', 'Segoe UI', system-ui, sans-serif;
}

/* —— Top bar: language —— */
.mfx-top {
  width: 100%;
  max-width: 960px;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.mfx-page[dir='rtl'] .mfx-top {
  justify-content: flex-start;
}

.mfx-lang {
  display: inline-flex;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 3px;
  gap: 2px;
}

.mfx-lang button {
  border: none;
  background: transparent;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}

.mfx-lang button[aria-pressed='true'] {
  background: var(--bg-page);
  color: var(--text);
}

/* —— Card: 50 / 50 desktop —— */
.mfx-card {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: row;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-height: min(520px, 88vh);
}

.mfx-page[dir='rtl'] .mfx-card {
  flex-direction: row-reverse;
}

.mfx-panel {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Form panel */
.mfx-panel--form {
  padding: 2rem 2rem 1.75rem;
  justify-content: center;
}

.mfx-logo {
  display: inline-block;
  margin-bottom: 1.5rem;
  max-height: 40px;
  text-decoration: none;
  color: inherit;
}

.mfx-logo img {
  display: block;
  height: auto;
  max-height: 48px;
  width: auto;
  max-width: min(200px, 100%);
}

.mfx-logo--text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.mfx-tabs {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.mfx-tab {
  padding: 0.65rem 0;
  margin-bottom: -1px;
  border: none;
  background: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
}

.mfx-tab[aria-selected='true'] {
  color: var(--text);
  border-bottom-color: var(--action);
}

.mfx-tab:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.mfx-headline {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.mfx-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 1.35rem;
}

.mfx-field {
  margin-bottom: 1rem;
}

.mfx-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.mfx-field input,
.mfx-field select {
  width: 100%;
  height: 46px;
  padding: 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 0.9375rem;
  font-family: inherit;
  background: #fafbfc;
  color: var(--text);
}

.mfx-page[dir='rtl'] .mfx-field select {
  padding-left: 2rem;
}

.mfx-field input:focus,
.mfx-field select:focus {
  outline: none;
  border-color: var(--text-muted);
  background: #fff;
}

.mfx-field--error input,
.mfx-field--error select {
  border-color: #c62828;
}

.mfx-field__err {
  font-size: 0.75rem;
  color: #c62828;
  margin: 0.25rem 0 0;
}

.mfx-name-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.mfx-name-row .mfx-field--inline {
  flex: 1 1 50%;
  min-width: 0;
  margin-bottom: 0;
}

.mfx-phone-row {
  display: flex;
  gap: 0.5rem;
}

.mfx-phone-row select {
  flex: 0 0 42%;
  max-width: 200px;
}

.mfx-phone-row input {
  flex: 1;
  min-width: 0;
}

.mfx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
}

.mfx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.25rem;
  border-radius: var(--radius-input);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s ease;
}

.mfx-btn--primary {
  background: var(--action);
  color: #fff;
  flex: 1;
  min-width: 140px;
}

.mfx-btn--primary:hover:not(:disabled) {
  background: var(--action-hover);
}

.mfx-btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mfx-btn--secondary {
  background: var(--bg-page);
  color: var(--text);
  border: 1px solid var(--border);
}

.mfx-btn--secondary:hover {
  background: #e2e6eb;
}

.mfx-btn--ghost {
  display: none;
}

.mfx-legal {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin: 1rem 0 0;
  line-height: 1.5;
}

.mfx-signin-row {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.mfx-page[dir='rtl'] .mfx-signin-row {
  text-align: center;
}

.mfx-signin-row a {
  color: var(--action);
  font-weight: 600;
  text-decoration: none;
}

.mfx-signin-row a:hover {
  text-decoration: underline;
}

.mfx-toast {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-input);
  font-size: 0.8125rem;
  display: none;
}

.mfx-toast--err {
  display: block;
  background: #ffebee;
  color: #b71c1c;
}

.mfx-toast--ok {
  display: block;
  background: #e8f5e9;
  color: #1b5e20;
}

/* Promo panel — subtle gradient, not loud */
.mfx-panel--promo {
  position: relative;
  padding: 2rem 1.75rem;
  justify-content: space-between;
  background: linear-gradient(
    155deg,
    #0a0a0a 0%,
    #121212 38%,
    #0e0e0e 72%,
    #111111 100%
  );
  color: var(--promo-text);
}

.mfx-slider {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.mfx-slide-visual {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.04);
  aspect-ratio: 400 / 220;
  max-height: 200px;
}

.mfx-slide-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mfx-slide-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--promo-text);
  line-height: 1.25;
}

.mfx-slide-text {
  font-size: 0.875rem;
  color: var(--promo-muted);
  margin: 0;
  line-height: 1.5;
  flex: 1;
}

.mfx-slider-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 0.5rem;
}

.mfx-slider-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--promo-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.15s;
}

.mfx-page[dir='rtl'] .mfx-slider-nav {
  flex-direction: row-reverse;
}

.mfx-slider-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.mfx-slider-btn:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.mfx-slider-dots {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.mfx-slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
}

.mfx-slider-dot[aria-current='true'] {
  background: var(--action);
  width: 20px;
  border-radius: 4px;
}

.mfx-risk {
  font-size: 0.65rem;
  color: var(--promo-muted);
  margin: 1rem 0 0;
  line-height: 1.45;
  opacity: 0.85;
}

/* Tab panels */
.mfx-tab-panel[hidden] {
  display: none !important;
}

/* Mobile: stack — form first, promo below */
@media (max-width: 768px) {
  .mfx-page[dir='rtl'] .mfx-card,
  .mfx-card {
    flex-direction: column;
    min-height: auto;
    max-width: 440px;
  }

  .mfx-panel--form {
    padding: 1.5rem 1.35rem 1.25rem;
    order: 1;
  }

  .mfx-panel--promo {
    order: 2;
    padding: 1.5rem 1.35rem 1.75rem;
    min-height: 280px;
  }

  .mfx-slide-visual {
    max-height: 160px;
  }

  .mfx-phone-row select {
    flex: 0 0 38%;
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .mfx-name-row {
    flex-direction: column;
    gap: 0.65rem;
  }

  .mfx-name-row .mfx-field--inline {
    margin-bottom: 0;
  }

  .mfx-phone-row {
    flex-direction: column;
  }

  .mfx-phone-row select {
    max-width: none;
  }
}

/* Success modal — OK then redirect to login */
.mfx-modal[hidden] {
  display: none !important;
}

.mfx-modal:not([hidden]) {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.mfx-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.mfx-modal__box {
  position: relative;
  max-width: 420px;
  width: 100%;
  padding: 1.5rem 1.35rem;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  text-align: start;
}

.mfx-modal__title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.mfx-modal__text {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.mfx-modal__ok {
  width: 100%;
  margin-top: 0.25rem;
}

.mfx-modal[data-lang='fa'] .mfx-modal__box {
  font-family: 'Vazirmatn', 'Tahoma', system-ui, sans-serif;
}

.mfx-modal[data-lang='ar'] .mfx-modal__box {
  font-family: 'Noto Sans Arabic', 'Segoe UI', system-ui, sans-serif;
}
