/* ========================================================
   Auth Split-Screen Architecture (50/50 Split with Divider)
   World-Class Luxury SaaS Design for Login & Register
   ======================================================== */

:root {
  --auth-bg: #070a14;
  --auth-surface: #0b0f1e;
  --auth-input-bg: rgba(15, 23, 42, 0.75);
  --auth-border: rgba(255, 255, 255, 0.1);
  --auth-divider: rgba(255, 255, 255, 0.14);
  --auth-primary: #6366f1;
  --auth-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #06b6d4 100%);
  --auth-text-main: #f8fafc;
  --auth-text-muted: #94a3b8;
  --auth-text-dim: #64748b;
}

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

html, body {
  height: 100%;
}

body.auth-split-body {
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--auth-bg);
  color: var(--auth-text-main);
  direction: rtl;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Master 50/50 Split Container */
.auth-split-layout {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  position: relative;
  background-color: var(--auth-bg);
}

/* ========================================================
   1. Form Half (50% Width)
   ======================================================== */
.auth-form-half {
  flex: 1;
  max-width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 56px;
  background: radial-gradient(circle at 100% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 0% 100%, rgba(6, 182, 212, 0.06) 0%, transparent 60%),
              var(--auth-bg);
  position: relative;
  z-index: 2;
  overflow-y: auto;
}

/* Vertical Dividing Line Between the Two Halves */
.auth-form-half {
  border-left: 1px solid var(--auth-divider);
  box-shadow: -1px 0 30px rgba(0, 0, 0, 0.5);
}

/* Top Navbar inside Form Half */
.auth-form-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.auth-form-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.auth-form-logo img {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.35));
}

.auth-form-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--auth-border);
  color: var(--auth-text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
}

.auth-form-back-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateX(3px);
}

/* Form Container */
.auth-form-box {
  width: 100%;
  max-width: 450px;
  margin: auto auto;
  padding: 20px 0;
}

.auth-form-box.wide-box {
  max-width: 500px;
}

.auth-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: #818cf8;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.auth-title-text {
  font-size: 2.1rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.auth-subtitle-text {
  color: var(--auth-text-muted);
  font-size: 0.94rem;
  line-height: 1.55;
  margin-bottom: 24px;
}

/* Form Fields & Controls */
.auth-field-item {
  margin-bottom: 16px;
  position: relative;
}

.auth-field-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.auth-field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-lead-icon {
  position: absolute;
  right: 16px;
  color: #64748b;
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 2;
}

.auth-input-element {
  width: 100%;
  padding: 13px 44px 13px 16px;
  background: var(--auth-input-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.94rem;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

.auth-input-element::placeholder {
  color: #475569;
}

.auth-input-element:focus {
  background: rgba(15, 23, 42, 0.95);
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 0 16px rgba(99, 102, 241, 0.15);
}

.auth-field-input-wrap:focus-within .auth-lead-icon {
  color: #818cf8;
}

/* Bulletproof Autofill Overrides */
.auth-input-element:-webkit-autofill,
.auth-input-element:-webkit-autofill:hover, 
.auth-input-element:-webkit-autofill:focus, 
.auth-input-element:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #0b1120 inset !important;
  -webkit-text-fill-color: #f8fafc !important;
  caret-color: #f8fafc !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Password Eye Button */
.auth-eye-btn {
  position: absolute;
  left: 14px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  z-index: 2;
}

.auth-eye-btn:hover {
  color: #38bdf8;
}

/* Two-column Input Grid (Fixed min-width: 0 to prevent column squeezing) */
.auth-grid-2cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  width: 100%;
}

.auth-grid-2cols > * {
  min-width: 0;
}

/* Slug URL Preview (Wraps cleanly, never breaks grid or overflows mobile) */
.auth-slug-preview-bar {
  margin-top: 7px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.22);
  font-size: 0.8rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
  text-align: left;
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
  max-width: 100%;
  box-sizing: border-box;
}

.auth-slug-url-text {
  color: #38bdf8;
  word-break: break-all;
  overflow-wrap: anywhere;
  font-family: inherit;
}

/* Progressive Password Strength Bar */
.auth-strength-meter-bar {
  margin-top: 7px;
}

.auth-strength-meter-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.strength-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}

.strength-meta-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--auth-text-dim);
}

/* Checkbox & Options */
.auth-options-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 20px;
  font-size: 0.86rem;
}

.auth-styled-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: #cbd5e1;
}

.auth-styled-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.auth-styled-checkbox input[type="checkbox"]:checked {
  background: #6366f1;
  border-color: #6366f1;
}

.auth-styled-checkbox input[type="checkbox"]:checked::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.62rem;
  color: #ffffff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.auth-inline-link {
  color: #818cf8;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-inline-link:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* Master Primary CTA Button */
.auth-btn-primary-action {
  width: 100%;
  padding: 13px 24px;
  border-radius: 12px;
  background: var(--auth-gradient);
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px -4px rgba(79, 70, 229, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(79, 70, 229, 0.65);
  filter: brightness(1.08);
}

.auth-btn-primary-action:active {
  transform: translateY(0);
}

/* Switch Route Prompt */
.auth-switch-route {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--auth-text-muted);
}

/* Alert Notification Boxes */
.auth-alert-message {
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.alert-danger-box {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.alert-info-box {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

/* Bottom Footer in Form Half */
.auth-form-bottom-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: var(--auth-text-dim);
}

/* ========================================================
   2. Visual Showcase Half (50% Width - Image & Showcase)
   ======================================================== */
.auth-visual-half {
  flex: 1;
  max-width: 50%;
  position: relative;
  background-color: #050811;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 48px;
}

/* The Showcase Background Artwork */
.auth-visual-bg-art {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
  opacity: 0.85;
  filter: contrast(1.05) saturate(1.08);
  transition: transform 0.6s ease;
}

.auth-visual-half:hover .auth-visual-bg-art {
  transform: scale(1.02);
}

/* Dark Gradient Overlays to Frame the Content */
.auth-visual-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, 
    rgba(5, 8, 17, 0.85) 0%, 
    rgba(5, 8, 17, 0.15) 30%, 
    rgba(5, 8, 17, 0.15) 70%, 
    rgba(5, 8, 17, 0.92) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Visual Content Overlays */
.auth-visual-top-content {
  position: relative;
  z-index: 3;
}

.auth-visual-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-visual-tag .tag-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  display: inline-block;
}

.auth-visual-bottom-card {
  position: relative;
  z-index: 3;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 24px 28px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.visual-quote-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 8px;
  line-height: 1.4;
}

.visual-quote-desc {
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.visual-creator-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.visual-creator-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.visual-creator-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #6366f1;
}

.visual-creator-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
}

.visual-creator-title {
  font-size: 0.76rem;
  color: #94a3b8;
}

.visual-stars-badge {
  color: #fbbf24;
  font-size: 0.85rem;
  display: flex;
  gap: 2px;
}

/* ========================================================
   Responsive Media Queries (Mobile & Desktop Perfection)
   ======================================================== */
@media (max-width: 992px) {
  .auth-split-layout {
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
  }
  .auth-form-half {
    max-width: 100%;
    width: 100%;
    border-left: none;
    padding: 32px 24px;
    min-height: 100vh;
    justify-content: flex-start;
  }
  .auth-form-box {
    max-width: 520px;
    margin: 0 auto;
  }
  .auth-visual-half {
    display: none;
  }
}

@media (max-width: 640px) {
  /* Layout */
  body.auth-split-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-split-layout {
    min-height: 100svh;
  }

  .auth-form-half {
    padding: 18px 16px 28px;
    justify-content: flex-start;
    min-height: 100svh;
  }

  .auth-form-box,
  .auth-form-box.wide-box {
    max-width: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Top Nav */
  .auth-form-top-nav {
    margin-bottom: 22px;
    align-items: center;
    gap: 8px;
  }

  .auth-form-logo img {
    height: 32px;
  }

  .auth-form-back-btn {
    padding: 6px 11px;
    font-size: 0.78rem;
    gap: 6px;
  }

  /* Badge & Heading */
  .auth-pill-badge {
    font-size: 0.74rem;
    padding: 4px 11px;
    margin-bottom: 10px;
  }

  .auth-title-text {
    font-size: 1.6rem;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
  }

  .auth-subtitle-text {
    font-size: 0.86rem;
    margin-bottom: 20px;
    line-height: 1.55;
  }

  /* Fields */
  .auth-field-item {
    margin-bottom: 14px;
  }

  .auth-input-element {
    font-size: 0.92rem;
    padding: 12px 42px 12px 14px;
  }

  .auth-grid-2cols {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Options row */
  .auth-options-line {
    margin: 14px 0 18px;
    font-size: 0.83rem;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* CTA Button */
  .auth-btn-primary-action {
    font-size: 0.97rem;
    padding: 13px 18px;
  }

  /* Switch prompt */
  .auth-switch-route {
    font-size: 0.86rem;
    margin-top: 18px;
  }

  /* Alert */
  .auth-alert-message {
    font-size: 0.84rem;
    padding: 10px 13px;
    gap: 9px;
    margin-bottom: 14px;
  }

  /* Slug URL bar */
  .auth-slug-preview-bar {
    font-size: 0.76rem;
  }

  /* Strength bar */
  .strength-meta-info {
    font-size: 0.7rem;
  }

  /* Bottom footer */
  .auth-form-bottom-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding-top: 22px;
    font-size: 0.77rem;
    margin-top: auto;
  }
}

/* Extra small (iPhone SE, Galaxy A-series narrow) */
@media (max-width: 390px) {
  .auth-form-half {
    padding: 14px 12px 24px;
  }

  .auth-title-text {
    font-size: 1.45rem;
  }

  .auth-form-back-btn span {
    display: none; /* show icon only on very small screens */
  }

  .auth-form-back-btn {
    padding: 7px 10px;
  }
}
