/*
 * WaselBot's sign-in screens (login, sign up, activation, password recovery, complete profile…): one shell in the
 * brand's identity — the brand panel (the promise, the live loop channel → agent → CRM, the channels that work today)
 * beside the form on wide screens, a short brand header above the form on phones — and the old Bootstrap cards those
 * screens are made of, restyled. Loaded by views/site/modern/subscription_theme.php, driven by assets/js/wb-auth.js.
 */
:root { --wa-navy: #172e6e; --wa-navy-2: #1e3a8a; --wa-deep: #0b1638; --wa-red: #dc2626; --wa-ink: #1e2d4f; --wa-muted: #64748b; --wa-line: #e7ecf4; --wa-soft: #f6f8fc; }
body.wb-auth { background: #f4f6fb !important; color: var(--wa-ink); min-height: 100vh; margin: 0; font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; }
body.wb-auth #app, body.wb-auth .section { min-height: 100vh; padding: 0 !important; margin: 0 !important; }
.wa-shell { display: grid; grid-template-columns: minmax(520px, 54%) 1fr; min-height: 100vh; direction: rtl; }

/* ---------------------------------------------------------------- the brand panel */
.wa-brand { position: relative; overflow: hidden; color: #fff; padding: 40px clamp(32px, 4vw, 64px) 36px; display: flex; flex-direction: column; gap: 22px;
  background: radial-gradient(110% 90% at 100% 0%, #2a4bb0 0%, #172e6e 46%, #0b1638 100%); isolation: isolate; }
.wa-brand:after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(80% 70% at 70% 30%, #000, transparent); mask-image: radial-gradient(80% 70% at 70% 30%, #000, transparent); }
.wa-orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(10px); pointer-events: none; }
.wa-orb.o1 { width: 560px; height: 560px; inset-inline-start: -200px; bottom: -240px; background: radial-gradient(circle, rgba(220, 38, 38, .42), transparent 66%); animation: wa-drift 16s ease-in-out infinite alternate; }
.wa-orb.o2 { width: 420px; height: 420px; inset-inline-end: -140px; top: -160px; background: radial-gradient(circle, rgba(96, 165, 250, .35), transparent 66%); animation: wa-drift 20s ease-in-out infinite alternate-reverse; }
@keyframes wa-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, -30px) scale(1.08); } }
.wa-brand .logo { align-self: flex-start; } .wa-brand .logo img { height: 44px; width: auto; display: block; }

.wa-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #dbe6ff;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(6px); }
.wa-eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); animation: wa-pulse 2s infinite; }
@keyframes wa-pulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); } 70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.wa-brand h1 { color: #fff; font-size: clamp(27px, 2.35vw, 38px); font-weight: 700; line-height: 1.45; margin: 14px 0 12px; max-width: 640px; letter-spacing: -.2px; }
.wa-brand h1 em { font-style: normal; background: linear-gradient(90deg, #ffffff 0%, #fca5a5 55%, #f87171 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wa-brand p.lead { color: rgba(255, 255, 255, .76); font-size: 15.5px; line-height: 1.95; max-width: 610px; margin: 0; font-weight: 400; }

/* the live loop */
.wa-demo { --c: #25d366; --rx: 0deg; --ry: 0deg; max-width: 600px; width: 100%; transform: perspective(1200px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease-out; }
.wa-flow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.wa-flow .st { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); transition: all .35s ease; }
.wa-flow .st.on { color: #fff; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); }
.wa-flow .st.on i { color: var(--c); }
.wa-flow .sep { color: rgba(255, 255, 255, .3); font-size: 10px; }
.wa-chat { border-radius: 22px; padding: 14px; background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .06)); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .12); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.wa-chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.wa-chat-head .ch { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; color: #fff; background: var(--c); box-shadow: 0 10px 24px -10px var(--c); transition: background .4s ease; }
.wa-chat-head .who { flex: 1; min-width: 0; } .wa-chat-head .who b { display: block; font-size: 14px; color: #fff; }
.wa-chat-head .who small { font-size: 12px; color: rgba(255, 255, 255, .6); display: inline-flex; align-items: center; gap: 6px; }
.wa-chat-head .live { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; display: inline-block; }
.wa-chat-head .speed { font-size: 12px; font-weight: 600; color: #fde68a; background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .25); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.wa-msgs { min-height: 128px; padding: 12px 2px 4px; display: flex; flex-direction: column; gap: 8px; }
.wa-b { max-width: 84%; padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.75; animation: wa-pop .35s cubic-bezier(.2, .9, .3, 1.3) both; }
.wa-b.in { align-self: flex-start; background: #fff; color: #1e2d4f; border-start-start-radius: 5px; }
.wa-b.out { align-self: flex-end; background: linear-gradient(135deg, #1e3a8a, #2848b0); color: #fff; border-start-end-radius: 5px; border: 1px solid rgba(255, 255, 255, .14); }
.wa-b .ai { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: #fca5a5; margin-bottom: 2px; }
.wa-b.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.wa-b.typing i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .8); animation: wa-dot 1s infinite ease-in-out; }
.wa-b.typing i:nth-child(2) { animation-delay: .15s; } .wa-b.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes wa-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes wa-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.wa-crm { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; margin-top: 10px; padding: 12px 14px; border-radius: 16px; background: #fff; color: #1e2d4f;
  opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .45s ease; }
.wa-crm.in { opacity: 1; transform: none; }
.wa-crm .ico { grid-row: span 2; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #16a34a, #15803d); }
.wa-crm .txt b { display: block; font-size: 13.5px; } .wa-crm .txt small { font-size: 12px; color: #64748b; }
.wa-stages { grid-column: 2; display: flex; gap: 6px; margin-top: 4px; }
.wa-stages span { flex: 1; text-align: center; font-size: 11px; font-weight: 600; padding: 4px 0; border-radius: 8px; background: #eef2f8; color: #94a3b8; transition: all .35s ease; }
.wa-stages span.done { background: #dbe6ff; color: #1e3a8a; }
.wa-stages span.on { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; box-shadow: 0 6px 14px -6px rgba(220, 38, 38, .8); }

/* the channels that work today: each one plays its own scene */
.wa-chans { display: flex; gap: 8px; flex-wrap: wrap; max-width: 620px; }
.wa-chan { --c: #fff; display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 13px; cursor: pointer; font: 600 13px 'IBM Plex Sans Arabic', sans-serif; color: rgba(255, 255, 255, .82);
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease; }
.wa-chan i { font-size: 16px; color: var(--c); }
.wa-chan:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .11); color: #fff; }
.wa-chan.on { color: #fff; background: rgba(255, 255, 255, .16); border-color: var(--c); box-shadow: 0 0 0 3px rgba(255, 255, 255, .06), 0 10px 22px -12px var(--c); }
.wa-chan:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.wa-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 680px; }
.wa-pillars > div { padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); transition: background .2s ease, transform .2s ease; }
.wa-pillars > div:hover { background: rgba(255, 255, 255, .09); transform: translateY(-2px); }
.wa-pillars i { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 9px; font-size: 15px; color: #fff; background: linear-gradient(135deg, #dc2626, #b91c1c); box-shadow: 0 8px 18px -8px rgba(220, 38, 38, .9); }
.wa-pillars b { display: block; font-size: 14px; color: #fff; margin-bottom: 3px; }
.wa-pillars small { display: block; font-size: 12.5px; line-height: 1.75; color: rgba(255, 255, 255, .66); }
.wa-trust { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-top: auto; font-size: 12.5px; color: rgba(255, 255, 255, .66); }
.wa-trust span { display: inline-flex; gap: 7px; align-items: center; } .wa-trust i { color: #86efac; }

/* ---------------------------------------------------------------- the form side */
.wa-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 28px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: radial-gradient(60% 50% at 0% 100%, rgba(220, 38, 38, .05), transparent), radial-gradient(60% 50% at 100% 0%, rgba(30, 58, 138, .07), transparent), #f4f6fb; }
.wa-main .container { max-width: 480px !important; width: 100%; padding: 0 !important; margin: 0 auto !important; }
.wa-main .container > .row { margin: 0 !important; }
.wa-main .container > .row > [class*="col-"] { flex: 0 0 100% !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
.wa-main .login-brand { display: none; }
.wa-top { position: absolute; top: 22px; inset-inline: 24px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--wa-muted); }
.wa-top a { color: var(--wa-navy-2); font-weight: 700; text-decoration: none; }
.wa-top .mlogo { display: none; } .wa-top .mlogo img { height: 34px; }
.wa-main .mt-5 { margin-top: 0 !important; }

/* the old cards, in WaselBot's look */
body.wb-auth .card { border: 1px solid rgba(231, 236, 244, .9) !important; border-radius: 26px !important; box-shadow: 0 40px 80px -48px rgba(23, 46, 110, .55), 0 2px 6px rgba(23, 46, 110, .04) !important; overflow: hidden; background: #fff; animation: wa-rise .5s ease both; }
@keyframes wa-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
body.wb-auth .card.card-primary { border-top: 1px solid var(--wa-line) !important; }
body.wb-auth .card:before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, #172e6e, #1e3a8a 55%, #dc2626); }
body.wb-auth .card .card-header { border: 0 !important; padding: 28px 32px 2px !important; min-height: 0 !important; background: none !important; display: block; }
body.wb-auth .card .card-header h4 { color: var(--wa-ink) !important; font-size: 24px !important; font-weight: 700 !important; display: flex; gap: 12px; align-items: center; margin: 0; line-height: 1.5; }
body.wb-auth .card .card-header h4 i { width: 44px; height: 44px; border-radius: 14px; display: inline-grid; place-items: center; font-size: 18px; color: #fff; background: linear-gradient(135deg, #1e3a8a, #172e6e); box-shadow: 0 12px 22px -10px rgba(23, 46, 110, .8); }
body.wb-auth .card .card-header .wa-sub { margin: 8px 0 0; font-size: 14px; color: var(--wa-muted); line-height: 1.8; }
body.wb-auth .card .card-body { padding: 20px 32px 30px !important; }
body.wb-auth label, body.wb-auth .control-label { font-size: 13.5px !important; font-weight: 700 !important; color: var(--wa-ink) !important; margin-bottom: 7px; }
body.wb-auth .form-control { height: 52px; border-radius: 14px !important; border: 1px solid var(--wa-line) !important; background: var(--wa-soft) !important; font-size: 15px; padding: 10px 15px; color: var(--wa-ink); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
body.wb-auth textarea.form-control { height: auto; }
body.wb-auth .form-control:hover { border-color: #d5deee !important; }
body.wb-auth .form-control:focus { background: #fff !important; border-color: #93b4ff !important; box-shadow: 0 0 0 4px rgba(147, 180, 255, .22) !important; }
body.wb-auth .form-control[readonly] { background: #eef2f8 !important; color: #475569; }
.wa-pass { position: relative; }
.wa-pass .form-control { padding-inline-end: 50px; }
.wa-eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 11px; background: transparent; color: #94a3b8; cursor: pointer; transition: background .15s ease, color .15s ease; }
.wa-eye:hover, .wa-eye:focus-visible { background: #eef2fb; color: var(--wa-navy-2); outline: none; }
body.wb-auth .btn { border-radius: 14px !important; font-weight: 700 !important; }
body.wb-auth .btn-primary, body.wb-auth .btn-lg.btn-primary { position: relative; overflow: hidden; border: 0 !important; height: 54px; font-size: 16px !important; color: #fff !important;
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important; box-shadow: 0 16px 28px -14px rgba(220, 38, 38, .95) !important; transition: filter .15s ease, transform .15s ease, box-shadow .15s ease; }
body.wb-auth .btn-primary:after { content: ""; position: absolute; top: 0; bottom: 0; width: 60px; inset-inline-start: -80px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg); transition: inset-inline-start .6s ease; }
body.wb-auth .btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 20px 32px -14px rgba(220, 38, 38, 1) !important; }
body.wb-auth .btn-primary:hover:after { inset-inline-start: calc(100% + 20px); }
body.wb-auth .btn-primary:active { transform: translateY(0); }
body.wb-auth .btn-outline-primary { border: 1px solid #c7d4f0 !important; color: var(--wa-navy-2) !important; background: #fff !important; }
body.wb-auth .btn-outline-primary:hover { background: #eef3ff !important; }
body.wb-auth .alert { border: 0 !important; border-radius: 14px !important; font-size: 14px; line-height: 1.8; padding: 12px 16px; text-align: start !important; margin: 16px 32px 0; }
body.wb-auth .card-body .alert { margin: 0 0 14px; }
body.wb-auth .alert-danger { background: #fef2f2 !important; color: #991b1b !important; }
body.wb-auth .alert-success { background: #f0fdf4 !important; color: #166534 !important; }
body.wb-auth .alert-info, body.wb-auth .alert-warning { background: #eef3ff !important; color: #1e3a8a !important; }
body.wb-auth a { color: var(--wa-navy-2); }
body.wb-auth .text-muted { color: var(--wa-muted) !important; }
body.wb-auth .float-right { float: left !important; }
body.wb-auth .btn-social, body.wb-auth #customBtn { border-radius: 14px !important; height: 50px; border: 1px solid var(--wa-line) !important; box-shadow: none !important; background: #fff !important; color: var(--wa-ink) !important;
  display: flex !important; align-items: center; justify-content: center; gap: 10px; transition: border-color .15s ease, background .15s ease; }
body.wb-auth .btn-social:hover, body.wb-auth #customBtn:hover { border-color: #c7d4f0 !important; background: #f8faff !important; }
body.wb-auth .btn-social > :first-child { position: static !important; border: 0 !important; width: auto !important; line-height: 1 !important; font-size: 18px; color: #1877f2; }
.wa-main .sm-gutters > [class*="col-"] { flex: 0 0 100% !important; max-width: 100% !important; }
.wa-main .sm-gutters .btn-social { width: 100%; }
.wa-main .margin_top_5px { margin-top: 0 !important; }
body.wb-auth .card-body .sm-gutters.mb-4 { position: relative; padding-top: 22px; margin-top: 4px; }
body.wb-auth .card-body .sm-gutters.mb-4:before { content: "أو"; position: absolute; top: -2px; inset-inline: 0; text-align: center; font-size: 12.5px; color: #94a3b8;
  background: linear-gradient(var(--wa-line), var(--wa-line)) no-repeat center / 100% 1px; }

/* ---------------------------------------------------------------- laptops: a little tighter */
@media (max-width: 1280px) {
  .wa-shell { grid-template-columns: minmax(480px, 52%) 1fr; }
  .wa-pillars small { display: none; }
  .wa-brand { gap: 18px; }
  .wa-chans { gap: 6px; } .wa-chan { padding: 7px 10px; font-size: 12px; gap: 6px; } .wa-chan i { font-size: 15px; }
}
/* short screens: the panel always fits one screen, the least needed goes first */
@media (min-width: 992px) { .wa-brand { min-height: 100vh; } }
@media (max-height: 980px) and (min-width: 992px) { .wa-pillars { display: none; } .wa-brand { gap: 18px; padding-top: 32px; padding-bottom: 28px; } }
@media (max-height: 840px) and (min-width: 992px) { .wa-flow { display: none; } .wa-msgs { min-height: 104px; } .wa-brand h1 { font-size: clamp(25px, 2.1vw, 32px); margin: 10px 0 8px; } }
@media (max-height: 740px) and (min-width: 992px) { .wa-brand p.lead { display: none; } .wa-trust { display: none; } }

/* ---------------------------------------------------------------- phones and tablets: a short brand header, then the form */
@media (max-width: 991.98px) {
  .wa-shell { grid-template-columns: 1fr; min-height: 0; }
  .wa-brand { padding: 22px 18px 20px; gap: 12px; border-radius: 0 0 26px 26px; }
  .wa-brand .logo img { height: 34px; }
  .wa-eyebrow, .wa-brand p.lead, .wa-demo, .wa-pillars, .wa-trust { display: none; }
  .wa-brand h1 { font-size: 20px; margin: 0; line-height: 1.6; }
  .wa-chans { gap: 6px; }
  .wa-chan { padding: 6px 9px; font-size: 12px; cursor: default; }
  .wa-chan:hover { transform: none; }
  .wa-main { position: static; height: auto; overflow: visible; justify-content: flex-start; padding: 22px 16px 32px; }
  .wa-top { display: none; }
  body.wb-auth .card .card-header { padding: 22px 20px 2px !important; }
  body.wb-auth .card .card-body { padding: 16px 20px 22px !important; }
  body.wb-auth .card .card-header h4 { font-size: 20px !important; }
  body.wb-auth .alert { margin: 14px 20px 0; }
}
/* narrow screens: the channels as icons (their names stay for screen readers) */
@media (max-width: 1150px) and (min-width: 992px), (max-width: 420px) {
  .wa-chan span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wa-chan { padding: 9px 11px; } .wa-chan i { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .wa-orb, .wa-eyebrow .dot, .wa-b, body.wb-auth .card { animation: none !important; }
  .wa-demo, .wa-crm, .wa-flow .st, .wa-stages span, .wa-chan, .wa-pillars > div, body.wb-auth .btn-primary, body.wb-auth .form-control { transition: none !important; }
  .wa-demo { transform: none !important; }
}
.wa-brand h1 .nw { white-space: nowrap; }
