﻿/* ═══════════════════════════════════════════════════
   LOGIN PAGE — Full redesign
   ═══════════════════════════════════════════════════ */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  overflow: hidden;
  /* Login microcopy is English-only; force LTR so text aligns left,
     sentence punctuation stays in place, and feature icons sit on the
     left even though <html dir="rtl">. */
  direction: ltr;
  text-align: left;
}

/* ── Brand Panel (left in LTR, right in RTL) ── */
.login-brand {
  flex: 1.1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 50px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(14,165,233,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 80%, rgba(139,92,246,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 50%, rgba(16,185,129,0.06) 0%, transparent 50%),
    linear-gradient(160deg, #f8fbff 0%, #eef7ff 52%, #f4f8ff 100%);
}

/* Animated grid overlay */
.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(14,165,233,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,165,233,0.06) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

/* Floating orb shapes */
.login-brand::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border: 1px solid rgba(14,165,233,0.14);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-ring 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.08); }
}

body[data-theme="dark"] .login-brand {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(14,165,233,0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 80%, rgba(139,92,246,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 50%, rgba(16,185,129,0.08) 0%, transparent 50%),
    linear-gradient(160deg, #0d1529 0%, #0a0e1a 50%, #0e1527 100%);
}

body[data-theme="dark"] .login-brand::before {
  background-image:
    linear-gradient(rgba(14,165,233,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,165,233,0.05) 1px, transparent 1px);
}

body[data-theme="dark"] .brand-name h1 {
  color: #f8fafc;
}

body[data-theme="dark"] .brand-tagline,
body[data-theme="dark"] .brand-feature-text span,
body[data-theme="dark"] .login-subtitle,
body[data-theme="dark"] .login-welcome,
body[data-theme="dark"] .login-demo-label {
  color: #94a3b8;
}

body[data-theme="dark"] .brand-feature {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
  box-shadow: none;
}

body[data-theme="dark"] .brand-feature-text strong {
  color: #e2e8f0;
}

body[data-theme="dark"] .login-form-panel {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

body[data-theme="dark"] .login-lang-btn,
body[data-theme="dark"] .login-theme-btn {
  background: #ffffff;
}

body[data-theme="dark"] .login-title {
  color: #0f172a !important;
}

.brand-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 420px;
  gap: 32px;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-name {
  display: flex;
  flex-direction: column;
}

.brand-name h1 {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-name span {
  font-size: 13px;
  color: var(--accent2);
  font-weight: 500;
  margin-top: 4px;
}

.brand-tagline {
  font-size: 15px;
  color: #475569;
  line-height: 1.65;
  max-width: 340px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 12px;
  padding: 14px 18px;
  transition: background 0.2s, border-color 0.2s;
  box-shadow: 0 10px 24px rgba(15,23,42,0.05);
}

.brand-feature:hover {
  background: rgba(14,165,233,0.08);
  border-color: rgba(14,165,233,0.22);
}

.brand-feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text2);
  flex-shrink: 0;
}

.brand-feature-icon.blue  { background: rgba(14,165,233,0.15); }
.brand-feature-icon.green { background: rgba(16,185,129,0.15); }
.brand-feature-icon.gold  { background: rgba(245,158,11,0.15); }
.brand-feature-icon.purple{ background: rgba(139,92,246,0.15); }

.brand-feature-text strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
}

.brand-feature-text span {
  font-size: 12px;
  color: var(--text3);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.28);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: #34d399;
  font-weight: 500;
}

.brand-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Form Panel ── */
.login-form-panel {
  flex: 0 0 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 36px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border-inline-start: 1px solid rgba(148,163,184,0.2);
  position: relative;
}

.login-lang-btn {
  position: absolute;
  top: 20px;
  inset-inline-end: 20px;
  background: #ffffff;
  border: 1px solid rgba(148,163,184,0.24);
  border-radius: 8px;
  color: var(--text2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.login-lang-btn:hover {
  background: #eff8ff;
  border-color: rgba(14,165,233,0.28);
  color: var(--accent);
}

.login-theme-btn {
  position: absolute;
  top: 20px;
  inset-inline-start: 20px;
  background: #ffffff;
  border: 1px solid rgba(148,163,184,0.24);
  border-radius: 8px;
  color: var(--text2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.login-theme-btn:hover {
  background: #eff8ff;
  border-color: rgba(14,165,233,0.28);
  color: var(--accent);
}

.login-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: slideUp 0.35s cubic-bezier(0.34,1.15,0.64,1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-title {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em;
  margin: 0 0 6px !important;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text2);
  margin: 0;
}

.login-welcome {
  font-size: 13px;
  color: var(--text3);
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

/* ── Form fields ── */
#loginForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.login-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.login-input-wrap {
  position: relative;
}

.login-input-icon {
  position: absolute;
  top: 50%;
  inset-inline-start: 13px;
  transform: translateY(-50%);
  font-size: 15px;
  pointer-events: none;
  opacity: 0.5;
}

.login-input-wrap input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.28);
  background: #ffffff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

[dir="rtl"] .login-input-wrap input {
  padding: 12px 38px 12px 14px;
}

.login-input-wrap input::placeholder {
  color: var(--text3);
  font-size: 13px;
}

.login-input-wrap input:focus {
  border-color: rgba(14,165,233,0.55);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
  background: #ffffff;
}

/* Password toggle */
.login-pw-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: 13px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 0;
  color: var(--text2);
}
.login-pw-toggle:hover { opacity: 0.9; }

/* Sign-in button */
.login-submit-btn {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 8px 22px rgba(14,165,233,0.24);
  margin-top: 4px;
  letter-spacing: 0.01em;
}

.login-submit-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(14,165,233,0.3);
}

.login-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Error message */
.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #fca5a5;
  display: none;
  animation: shakeX 0.4s ease;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Demo accounts */
.login-demo {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(148,163,184,0.22);
}

.login-demo[hidden] { display: none; }

.login-demo-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  text-align: center;
}

.demo-accounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.demo-btn {
  padding: 7px 6px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.24);
  background: #ffffff;
  color: var(--text2);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}

.demo-btn:hover {
  background: #eff8ff;
  border-color: rgba(14,165,233,0.28);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ── Brand lockup — mirrors the CASA wordmark on casagh.com ── */
.brand-mark,
.login-mark {
  height: 52px;
  width: auto;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 8px rgba(18,97,122,0.22));
}

.login-mark { height: 56px; margin: 0 auto 14px; }

.wm-name,
.wm-sub {
  display: block;
  font-family: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
  line-height: 1;
}

.wm-name {
  font-weight: 700;
  letter-spacing: 3.5px;
  background: linear-gradient(135deg, #075985, #0284c7, #0891b2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wm-sub {
  font-size: 0.58em;
  font-weight: 600;
  letter-spacing: 6px;
  color: #3aa9be;
  margin-top: 4px;
}

/* ── Parent-company attribution ── */
.brand-parent {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text3);
}

.brand-parent a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.brand-parent a:hover { text-decoration: underline; }

/* ── Self-serve routing under the form ── */
.login-help {
  margin-top: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text3);
}

.login-help a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.login-help a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .login-brand { display: none; }
  .login-form-panel {
    flex: 1;
    border-inline-start: none;
  }
}

@media (max-width: 480px) {
  .login-form-panel { padding: 30px 20px; }
  .demo-accounts { grid-template-columns: repeat(2, 1fr); }
}
