/* ============================================================
   Brand Login — صفحه ورود مستقل از قالب برای دروپال ۱۰/۱۱
   ------------------------------------------------------------
   شخصی‌سازی سریع: رنگ‌ها و متغیرهای :root را ویرایش کنید.
   ============================================================ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* گرادیان پنل برند — پالت رسمی دروپال (drupal.org style guide) */
  --bl-grad-a: #031b2d;
  --bl-grad-b: #064771;
  --bl-grad-c: #0678be;
  --bl-grad-d: #0d7dc1;
  /* رنگ اصلی دکمه و لینک‌ها — آبی رسمی دروپال */
  --bl-primary: #0678be;
  --bl-primary-2: #064771;
  /* رنگ‌های متن و فیلدها */
  --bl-ink: #0f172a;
  --bl-body: #334155;
  --bl-muted: #64748b;
  --bl-line: #e2e8f0;
  --bl-field-bg: #f8fafc;
  --bl-font: 'Vazirmatn', 'Vazirmatn RD', 'Segoe UI', Tahoma, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body { margin: 0; padding: 0; }

body.bl-page {
  font-family: var(--bl-font);
  color: var(--bl-ink);
  background: #fff;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(6, 120, 190, .2); }

/* ------------------ Layout ------------------ */

.bl-shell {
  display: flex;
  min-height: 100vh;
}

.bl-brand {
  position: relative;
  flex: 0 1 46%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(140deg, var(--bl-grad-a) 0%, var(--bl-grad-b) 38%, var(--bl-grad-c) 72%, var(--bl-grad-d) 100%);
}

.bl-main {
  flex: 1 1 54%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 32px 36px;
  background: #fff;
}

/* ------------------ Brand panel ------------------ */

.bl-brand__blobs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  pointer-events: none;
}
.bl-brand__blobs span:nth-child(1) {
  width: 420px;
  height: 420px;
  top: -110px;
  inset-inline-start: -90px;
  background: rgba(6, 120, 190, .5);
  animation: bl-float 16s ease-in-out infinite alternate;
}
.bl-brand__blobs span:nth-child(2) {
  width: 320px;
  height: 320px;
  bottom: 10%;
  inset-inline-end: -70px;
  background: rgba(83, 176, 235, .4);
  animation: bl-float 21s ease-in-out infinite alternate-reverse;
}
.bl-brand__blobs span:nth-child(3) {
  width: 260px;
  height: 260px;
  top: 42%;
  inset-inline-start: 30%;
  background: rgba(124, 188, 72, .26);
  animation: bl-float 26s ease-in-out infinite alternate;
}

@keyframes bl-float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(46px, -34px) scale(1.07); }
}

.bl-brand__inner {
  position: relative;
  z-index: 2;
  max-width: 520px;
}

.bl-brand__logo img {
  height: 54px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

.bl-brand__initial {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #53b0eb, #0678be);
  box-shadow: 0 10px 24px -8px rgba(6, 120, 190, .5);
}

.bl-brand__title {
  margin: 24px 0 12px;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -.3px;
}

.bl-brand__slogan {
  margin: 0;
  max-width: 42ch;
  color: #cfe7f6;
  font-size: 15px;
  line-height: 2;
}

.bl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.bl-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12.5px;
  color: #e0e7ff;
}
.bl-chip svg {
  width: 15px;
  height: 15px;
  stroke: #a8d4ef;
}

.bl-brand__wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 130px;
  pointer-events: none;
  z-index: 1;
}
.bl-brand__wave svg {
  display: block;
  width: 100%;
  height: 100%;
}
.bl-brand__wave--1 { animation: bl-wave 17s linear infinite; }
.bl-brand__wave--2 {
  bottom: -12px;
  opacity: .6;
  animation: bl-wave 29s linear infinite reverse;
}

@keyframes bl-wave {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ------------------ Form panel ------------------ */

.bl-card {
  width: 100%;
  max-width: 432px;
  animation: bl-rise .65s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes bl-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.bl-card__title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
}

.bl-card__subtitle {
  margin: 0 0 28px;
  color: var(--bl-muted);
  font-size: 14px;
  line-height: 2;
}

/* ------------------ Form elements ------------------ */

.bl-form .form-item {
  position: relative;
  margin: 0 0 18px;
}

.bl-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--bl-body);
}

.bl-form .form-required {
  color: #e11d48;
  margin-inline-start: 3px;
}

.bl-form input[type="text"],
.bl-form input[type="email"],
.bl-form input[type="password"] {
  width: 100%;
  padding: 13px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--bl-ink);
  background-color: var(--bl-field-bg);
  border: 1.5px solid var(--bl-line);
  border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.bl-form input[type="text"]:focus,
.bl-form input[type="email"]:focus,
.bl-form input[type="password"]:focus {
  outline: none;
  background-color: #fff;
  border-color: var(--bl-primary);
  box-shadow: 0 0 0 4px rgba(6, 120, 190, .13);
}

/* آیکن داخل فیلدها */
.bl-form input[name="name"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 19px 19px;
}
.bl-form input[type="password"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 19px 19px;
}
.bl-form input[name="mail"],
.bl-form input[type="email"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 19px 19px;
}

[dir="rtl"] .bl-form input[name="name"],
[dir="rtl"] .bl-form input[type="password"],
[dir="rtl"] .bl-form input[name="mail"],
[dir="rtl"] .bl-form input[type="email"] {
  padding-inline-start: 46px;
  background-position: right 15px center;
}

[dir="ltr"] .bl-form input[name="name"],
[dir="ltr"] .bl-form input[type="password"],
[dir="ltr"] .bl-form input[name="mail"],
[dir="ltr"] .bl-form input[type="email"] {
  padding-inline-start: 46px;
  background-position: left 15px center;
}

/* توضیح فیلدها */
.bl-form .description,
.bl-form .form-item .description {
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--bl-muted);
}

/* چک‌باکس‌ها */
.bl-form .form-type-boolean {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bl-form .form-type-boolean label,
.bl-form label.option {
  display: inline;
  margin: 0;
  font-weight: 500;
  font-size: 13.5px;
}
.bl-form input[type="checkbox"].form-checkbox {
  flex: none;
  width: 18px;
  height: 18px;
  accent-color: var(--bl-primary);
  cursor: pointer;
}

/* دکمه ارسال */
.bl-form .form-actions {
  margin: 6px 0 0;
}

.bl-form input[type="submit"] {
  width: 100%;
  padding: 14px 18px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  background-image: linear-gradient(135deg, var(--bl-primary), var(--bl-primary-2));
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 12px 26px -10px rgba(6, 120, 190, .5);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.bl-form input[type="submit"]:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 16px 32px -12px rgba(6, 120, 190, .55);
}

.bl-form input[type="submit"]:active {
  transform: translateY(0);
}

.bl-form input[type="submit"]:focus-visible {
  outline: 3px solid rgba(6, 120, 190, .5);
  outline-offset: 3px;
}

/* حالت بارگذاری دکمه */
.bl-form input[type="submit"].is-loading {
  pointer-events: none;
  color: transparent !important;
  background: var(--bl-primary-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M21 12a9 9 0 1 1-6.2-8.56'/%3E%3C/svg%3E") center / 24px no-repeat;
}

/* خطای اعتبارسنجی */
.bl-form .form-item--error input,
.bl-form input.error {
  border-color: #f87171 !important;
  background-color: #fef2f2;
}
.bl-form .form-item--error > label {
  color: #b91c1c;
}

/* نمایش رمز عبور */
.bl-input-wrap {
  position: relative;
  display: block;
}
.bl-input-wrap input[type="password"] {
  padding-inline-end: 46px;
}
.bl-pass-toggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  inset-inline-end: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}
.bl-pass-toggle:hover {
  color: var(--bl-primary);
  background: rgba(6, 120, 190, .08);
}
.bl-pass-toggle.is-on { color: var(--bl-primary); }
.bl-pass-toggle svg { width: 19px; height: 19px; }
.bl-pass-toggle:focus-visible {
  outline: 2px solid var(--bl-primary);
  outline-offset: 1px;
}

/* هشدار Caps Lock */
.bl-caps-hint {
  display: none;
  margin-top: 7px;
  font-size: 12px;
  color: #b45309;
}
.bl-caps-hint.is-visible {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bl-caps-hint svg { width: 14px; height: 14px; }

/* ------------------ Messages ------------------ */

.bl-messages { margin: 0 0 20px; }

.bl-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.9;
  animation: bl-rise .45s ease both;
}
.bl-message__text { flex: 1; }
.bl-message a { color: inherit; font-weight: 700; }

.bl-message__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
}
.bl-message__icon svg { width: 17px; height: 17px; }

.bl-message--status {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.bl-message--status .bl-message__icon {
  background: #d1fae5;
  color: #059669;
}

.bl-message--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.bl-message--error .bl-message__icon {
  background: #fee2e2;
  color: #dc2626;
}

.bl-message--warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.bl-message--warning .bl-message__icon {
  background: #fef3c7;
  color: #d97706;
}

/* ------------------ Links & footer ------------------ */

.bl-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-size: 13.5px;
}

.bl-links a {
  color: var(--bl-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color .15s ease;
}
.bl-links a:hover {
  color: var(--bl-primary-2);
  text-decoration: underline;
}
.bl-links a:focus-visible {
  outline: 2px solid var(--bl-primary);
  outline-offset: 3px;
  border-radius: 6px;
}

.bl-footer {
  margin-top: 30px;
  font-size: 12.5px;
  color: #94a3b8;
  text-align: center;
  line-height: 2;
}
.bl-footer__copy { margin: 0; }

.bl-footer__credit {
  margin: 4px 0 0;
  font-size: 12px;
}
.bl-footer__credit a {
  color: var(--bl-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color .2s ease;
}
.bl-footer__credit a:hover {
  color: var(--bl-primary-2);
  text-decoration: underline;
}
.bl-footer__credit a:focus-visible {
  outline: 2px solid var(--bl-primary);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ------------------ Responsive ------------------ */

@media (max-width: 880px) {
  .bl-shell { flex-direction: column; }

  .bl-brand {
    flex: none;
    padding: 44px 24px 88px;
  }

  .bl-brand__title {
    margin-top: 18px;
    font-size: 27px;
  }
  .bl-brand__slogan { font-size: 13.5px; }
  .bl-chips { margin-top: 22px; }
  .bl-brand__wave { height: 92px; }

  .bl-main {
    flex: 1;
    padding: 0 20px 30px;
  }

  .bl-card {
    margin-top: -52px;
    padding: 26px 20px 24px;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 20px;
    box-shadow: 0 24px 60px -24px rgba(15, 23, 42, .28);
  }

  .bl-footer { margin-top: 30px; }
}

@media (max-width: 380px) {
  .bl-chip:nth-child(3) { display: none; }
}

/* ------------------ Motion preferences ------------------ */

@media (prefers-reduced-motion: reduce) {
  .bl-brand__blobs span,
  .bl-brand__wave,
  .bl-card,
  .bl-message {
    animation: none !important;
  }
  .bl-form input,
  .bl-form input[type="submit"],
  .bl-links a {
    transition: none !important;
  }
}
