/* Otoform login — dual pane (brand + controls), flat */
:root {
  --color-primary: #2563EB;
  --color-primary-hover: #1D4ED8;
  --color-secondary: #4F46E5;
  --color-accent: #14B8A6;
  --color-brand: #3730A3;
  --color-brand-deep: #312E81;
  --color-bg: #F1F5F9;
  --color-surface: #FFFFFF;
  --color-text: #0F172A;
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;
  --color-danger: #DC2626;
  --font: Vazir, "Segoe UI", Tahoma, sans-serif;
  --radius: 12px;
  --shadow: none;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

.of-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ---------- Brand pane ---------- */
.of-login__brand-pane {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  background: var(--color-brand);
  color: #fff;
  overflow: hidden;
}

.of-login__brand-pane::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .7;
  pointer-events: none;
}

.of-login__brand-pane::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  top: -120px;
  inset-inline-end: -100px;
  pointer-events: none;
}

.of-login__brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 380px;
  width: 100%;
}

.of-login__brand {
  display: inline-flex;
  padding: 1.75rem 1.5rem;
  background: #fff;
  border-radius: 1.25rem;
  text-decoration: none;
}

.of-login__brand img {
  display: block;
  height: clamp(120px, 22vh, 200px);
  width: auto;
  max-width: min(100%, 280px);
  object-fit: contain;
}

.of-login__blurb {
  margin: 1.75rem 0 0;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, .92);
  font-weight: 500;
}

/* ---------- Form pane ---------- */
.of-login__form-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 2.5rem 2.5rem;
  background: var(--color-surface);
  min-height: 100vh;
}

.of-login__form-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

html[dir="rtl"] .of-login__form-top {
  justify-content: flex-start;
}

.of-lang { position: relative; }

.of-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-muted);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}

.of-lang__btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.of-lang__btn img { width: 14px; height: 14px; border-radius: 2px; }

.of-lang__menu {
  display: none;
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: none;
  padding: .35rem;
  z-index: 20;
}

.of-lang.open .of-lang__menu { display: block; }

.of-lang__menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 0;
  background: transparent;
  padding: .55rem .65rem;
  border-radius: 8px;
  font: inherit;
  color: var(--color-text);
  cursor: pointer;
  text-align: start;
}

.of-lang__menu button:hover { background: #EFF6FF; color: var(--color-primary); }
.of-lang__menu img { width: 16px; height: 16px; }

.of-panel {
  width: min(100%, 400px);
  margin: 0 auto;
  background: transparent;
  border: 0;
  padding: 0;
}

.of-panel__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto .85rem;
  border-radius: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EEF2FF;
  color: var(--color-secondary);
  font-size: 1.5rem;
}

.of-panel__title {
  margin: 0 0 .35rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--color-text);
  text-align: center;
}

.of-panel__sub {
  margin: 0 0 1.5rem;
  font-size: .92rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  text-align: center;
}

.of-field { margin-bottom: 1rem; }

.of-field label {
  display: block;
  margin-bottom: .4rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.of-input {
  position: relative;
  display: flex;
  align-items: center;
}

.of-input input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #F8FAFC;
  color: var(--color-text);
  font: inherit;
  font-size: .95rem;
  padding: 0 2.6rem 0 1rem;
  outline: none;
  transition: border-color .2s, background .2s;
}

html[dir="rtl"] .of-input input { padding: 0 1rem 0 2.6rem; }

.of-input input:focus {
  background: #fff;
  border-color: var(--color-primary);
  box-shadow: none;
}

.of-input__toggle {
  position: absolute;
  inset-inline-end: .75rem;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: .25rem;
  font-size: 1.15rem;
  line-height: 1;
}

.of-input__toggle:hover { color: var(--color-primary); }

.of-field .text-danger,
.of-field .field-validation-error {
  display: block;
  margin-top: .35rem;
  font-size: .78rem;
  color: var(--color-danger);
}

.of-captcha {
  margin: 1.1rem 0 1.25rem;
  padding: .85rem;
  border-radius: var(--radius);
  border: 1px dashed var(--color-border);
  background: #F8FAFC;
}

.of-captcha .cabcha,
.of-captcha .captcha-container { margin: 0; }

.of-captcha img {
  border-radius: 8px;
  max-height: 48px;
}

.of-captcha input.captcha-box,
.of-captcha input[type="text"] {
  width: 100%;
  margin-top: .55rem;
  height: 42px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0 .85rem;
  font: inherit;
  background: #fff;
  outline: none;
}

.of-captcha input.captcha-box:focus,
.of-captcha input[type="text"]:focus {
  border-color: var(--color-primary);
  box-shadow: none;
}

.of-captcha a,
.of-captcha .mdi-refresh {
  color: var(--color-primary) !important;
  text-decoration: none;
}

.of-submit {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: var(--radius);
  background: var(--color-secondary);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease;
  box-shadow: none;
}

.of-submit:hover {
  background: #4338CA;
  transform: none;
  box-shadow: none;
}

.of-meta {
  margin: 1rem 0 0;
  text-align: center;
  font-size: .75rem;
  color: var(--color-text-muted);
}

.of-alert {
  display: none;
  margin-bottom: 1rem;
  padding: .75rem .9rem;
  border-radius: 10px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  font-size: .85rem;
  line-height: 1.45;
}

.of-alert.show { display: block; }

@media (max-width: 900px) {
  .of-login {
    grid-template-columns: 1fr;
  }

  .of-login__brand-pane {
    min-height: 220px;
    padding: 2rem 1.5rem 1.5rem;
    order: -1;
  }

  .of-login__brand {
    padding: 1.1rem 1rem;
  }

  .of-login__brand img {
    height: 96px;
    max-width: 200px;
  }

  .of-login__blurb {
    margin-top: 1rem;
    font-size: .88rem;
  }

  .of-login__form-pane {
    min-height: auto;
    padding: 1.5rem 1.25rem 2rem;
  }
}

@media (max-width: 480px) {
  .of-login__brand img { height: 80px; }
  .of-panel__title { font-size: 1.3rem; }
}
