/**
 * AllOfBD Premium Auth Pages — Stylesheet
 * Split-screen layout with Bengali hero imagery & professional form cards
 *
 * @package AllOfBD_Core
 * @version 1.0.0
 */

/* ================================================================
   1. RESET & PAGE FOUNDATION
   ================================================================ */

.allofbd-auth-page {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
  font-family: 'Inter', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f8fafc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.allofbd-auth-page *,
.allofbd-auth-page *::before,
.allofbd-auth-page *::after {
  box-sizing: border-box;
}

/* ================================================================
   2. SPLIT-SCREEN CONTAINER
   ================================================================ */

.allofbd-auth-container {
  display: grid;
  grid-template-columns: 52% 48%;
  min-height: 100vh;
  width: 100%;
}

/* ================================================================
   3. LEFT — HERO IMAGE PANEL
   ================================================================ */

.allofbd-auth-hero {
  position: relative;
  overflow: hidden;
  background-color: #0f172a;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.allofbd-auth-hero[data-view="login"]   { background-image: var(--hero-login); }
.allofbd-auth-hero[data-view="signup"]  { background-image: var(--hero-signup); }
.allofbd-auth-hero[data-view="otp"]     { background-image: var(--hero-otp); }
.allofbd-auth-hero[data-view="forgot"]  { background-image: var(--hero-forgot); }

.allofbd-auth-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.92) 0%,
    rgba(15, 23, 42, 0.55) 40%,
    rgba(15, 23, 42, 0.15) 70%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px 44px;
}

.allofbd-auth-hero-content {
  animation: fadeInUp 0.8s ease-out;
}

.allofbd-auth-hero-logo {
  width: 160px;
  height: auto;
  margin-bottom: 24px;
  filter: brightness(0) invert(1);
}

.allofbd-auth-hero-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-bottom: 28px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.allofbd-auth-hero-brand:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.allofbd-auth-hero-brand .allofbd-auth-logo-img {
  height: 42px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

.allofbd-auth-hero-content h1 {
  font-family: 'Plus Jakarta Sans', 'Hind Siliguri', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  margin: 0 0 14px 0;
  letter-spacing: -0.5px;
}

.allofbd-auth-hero-content p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  margin: 0 0 28px 0;
  max-width: 420px;
}

/* Trust indicators */
.allofbd-auth-trust-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.allofbd-auth-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.allofbd-auth-trust-item svg {
  width: 18px;
  height: 18px;
  color: #f59e0b;
  flex-shrink: 0;
}

/* ================================================================
   4. RIGHT — FORM PANEL
   ================================================================ */

.allofbd-auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  background: #ffffff;
  overflow-y: auto;
  position: relative;
}

.allofbd-auth-form-card {
  width: 100%;
  max-width: 440px;
  position: relative;
}

/* ================================================================
   5. VIEW SWITCHING
   ================================================================ */

.allofbd-auth-view {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.allofbd-auth-view.active {
  display: block;
}

/* ================================================================
   6. BRAND HEADER (in form)
   ================================================================ */

.allofbd-auth-form-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-bottom: 32px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.allofbd-auth-form-brand:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.allofbd-auth-form-brand .allofbd-auth-logo-img {
  height: 42px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

/* ================================================================
   7. HEADINGS & TEXT
   ================================================================ */

.allofbd-auth-view h2 {
  font-family: 'Plus Jakarta Sans', 'Hind Siliguri', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.allofbd-auth-view .allofbd-auth-subtitle {
  font-size: 15px;
  color: #64748b;
  margin: 0 0 28px 0;
  line-height: 1.5;
}

/* ================================================================
   8. FORM FIELDS
   ================================================================ */

.allofbd-field {
  margin-bottom: 20px;
}

.allofbd-field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

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

.allofbd-input-icon {
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  pointer-events: none;
  z-index: 2;
}

.allofbd-input-icon svg {
  width: 18px;
  height: 18px;
}

.allofbd-input-wrap input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 48px;
  font-size: 14.5px;
  font-weight: 500;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.allofbd-input-wrap input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.allofbd-input-wrap input:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.allofbd-input-wrap input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.allofbd-input-wrap input.error {
  border-color: #f43f5e;
  background: #fff1f2;
}

.allofbd-input-wrap input.error:focus {
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
}

/* Password toggle button */
.allofbd-toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  z-index: 2;
}

.allofbd-toggle-password:hover {
  color: #475569;
}

.allofbd-toggle-password svg {
  width: 20px;
  height: 20px;
}

/* Phone number with country code */
.allofbd-phone-wrap {
  display: flex;
  gap: 10px;
}

.allofbd-phone-prefix {
  flex: 0 0 100px;
  height: 50px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #334155;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
}

.allofbd-phone-prefix .flag-bd {
  font-size: 18px;
}

.allofbd-phone-input {
  flex: 1;
}

.allofbd-phone-input input {
  padding-left: 16px !important;
}

/* Field error message */
.allofbd-field-error {
  font-size: 12.5px;
  color: #f43f5e;
  margin-top: 6px;
  display: none;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.allofbd-field-error.visible {
  display: flex;
}

/* ================================================================
   9. PASSWORD STRENGTH METER
   ================================================================ */

.allofbd-strength-meter {
  margin-top: 8px;
  display: none;
}

.allofbd-strength-meter.visible {
  display: block;
}

.allofbd-strength-bar {
  height: 4px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
}

.allofbd-strength-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease, background 0.4s ease;
  width: 0;
}

.allofbd-strength-fill[data-level="0"] { width: 0; background: #e2e8f0; }
.allofbd-strength-fill[data-level="1"] { width: 25%; background: #f43f5e; }
.allofbd-strength-fill[data-level="2"] { width: 50%; background: #f59e0b; }
.allofbd-strength-fill[data-level="3"] { width: 75%; background: #0ea5e9; }
.allofbd-strength-fill[data-level="4"] { width: 100%; background: #10b981; }

.allofbd-strength-label {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  transition: color 0.3s;
}

.allofbd-strength-label[data-level="1"] { color: #f43f5e; }
.allofbd-strength-label[data-level="2"] { color: #f59e0b; }
.allofbd-strength-label[data-level="3"] { color: #0ea5e9; }
.allofbd-strength-label[data-level="4"] { color: #10b981; }

/* ================================================================
   10. CHECKBOX & FIELD ROW
   ================================================================ */

.allofbd-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.allofbd-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #475569;
  cursor: pointer;
  font-weight: 500;
}

.allofbd-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  border-radius: 4px;
  cursor: pointer;
}

.allofbd-field-row a {
  font-size: 13.5px;
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.allofbd-field-row a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ================================================================
   11. PRIMARY BUTTON
   ================================================================ */

.allofbd-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  padding: 0 24px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 15.5px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
  position: relative;
  overflow: hidden;
}

.allofbd-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.allofbd-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.allofbd-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}

/* Button loading spinner */
.allofbd-btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.allofbd-btn-primary.loading .allofbd-btn-text {
  opacity: 0;
}

.allofbd-btn-primary.loading .allofbd-btn-spinner {
  display: block;
  position: absolute;
}

/* ================================================================
   12. DIVIDER
   ================================================================ */

.allofbd-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
}

.allofbd-divider::before,
.allofbd-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.allofbd-divider span {
  padding: 0 16px;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ================================================================
   13. SOCIAL LOGIN BUTTONS
   ================================================================ */

.allofbd-social-buttons {
  display: flex;
  gap: 12px;
}

.allofbd-btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 16px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: #334155;
  cursor: pointer;
  transition: all 0.25s ease;
}

.allofbd-btn-social:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.allofbd-btn-social svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ================================================================
   14. AUTH SWITCH LINK
   ================================================================ */

.allofbd-auth-switch {
  text-align: center;
  font-size: 14px;
  color: #64748b;
  margin-top: 28px;
  font-weight: 500;
}

.allofbd-auth-switch a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s;
}

.allofbd-auth-switch a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ================================================================
   15. OTP INPUT BOXES
   ================================================================ */

.allofbd-otp-boxes {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 28px 0;
}

.allofbd-otp-input {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  color: #0f172a;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  outline: none;
  transition: all 0.25s ease;
  caret-color: #2563eb;
}

.allofbd-otp-input:hover {
  border-color: #cbd5e1;
}

.allofbd-otp-input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  transform: scale(1.05);
}

.allofbd-otp-input.filled {
  border-color: #2563eb;
  background: #eff6ff;
}

.allofbd-otp-input.error {
  border-color: #f43f5e;
  background: #fff1f2;
  animation: shake 0.4s ease;
}

/* OTP countdown & resend */
.allofbd-otp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.allofbd-otp-countdown {
  font-size: 13.5px;
  color: #64748b;
  font-weight: 500;
}

.allofbd-otp-countdown strong {
  color: #0f172a;
  font-family: 'JetBrains Mono', monospace;
}

.allofbd-otp-resend {
  font-size: 13.5px;
  color: #2563eb;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.allofbd-otp-resend:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.allofbd-otp-resend:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  text-decoration: none;
}

/* OTP icon */
.allofbd-otp-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.allofbd-otp-icon-circle {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
}

.allofbd-otp-icon-circle svg {
  width: 34px;
  height: 34px;
  color: #2563eb;
}

.allofbd-otp-email-masked {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-top: 4px;
}

/* ================================================================
   16. FORGOT PASSWORD — SUCCESS STATE
   ================================================================ */

.allofbd-forgot-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.allofbd-forgot-icon-circle {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

.allofbd-forgot-icon-circle svg {
  width: 34px;
  height: 34px;
  color: #f59e0b;
}

/* ================================================================
   17. STATUS MESSAGES
   ================================================================ */

.allofbd-status {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 20px;
  display: none;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}

.allofbd-status.visible {
  display: flex;
}

.allofbd-status.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.allofbd-status.error {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

.allofbd-status.info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.allofbd-status svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ================================================================
   18. BACK LINK
   ================================================================ */

.allofbd-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  margin-top: 20px;
  transition: color 0.2s;
}

.allofbd-back-link:hover {
  color: #2563eb;
}

.allofbd-back-link svg {
  width: 16px;
  height: 16px;
}

/* ================================================================
   19. TERMS TEXT
   ================================================================ */

.allofbd-terms {
  margin-bottom: 24px;
}

.allofbd-terms label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  line-height: 1.5;
  font-weight: 400;
}

.allofbd-terms input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.allofbd-terms a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.allofbd-terms a:hover {
  text-decoration: underline;
}

/* ================================================================
   20. ANIMATIONS
   ================================================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ================================================================
   21. RESPONSIVE — TABLET (≤1024px)
   ================================================================ */

@media (max-width: 1024px) {
  .allofbd-auth-container {
    grid-template-columns: 44% 56%;
  }

  .allofbd-auth-form-panel {
    padding: 32px 36px;
  }

  .allofbd-auth-hero-overlay {
    padding: 36px 32px;
  }

  .allofbd-auth-hero-content h1 {
    font-size: 24px;
  }
}

/* ================================================================
   22. RESPONSIVE — MOBILE (≤768px)
   ================================================================ */

@media (max-width: 768px) {
  .allofbd-auth-container {
    grid-template-columns: 1fr;
    grid-template-rows: 240px 1fr;
  }

  .allofbd-auth-hero {
    background-position: center 20%;
  }

  .allofbd-auth-hero-overlay {
    padding: 20px 24px;
    justify-content: flex-end;
    background: linear-gradient(
      to top,
      rgba(15, 23, 42, 0.88) 0%,
      rgba(15, 23, 42, 0.4) 50%,
      transparent 100%
    );
  }

  .allofbd-auth-hero-content h1 {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .allofbd-auth-hero-content p {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .allofbd-auth-trust-row {
    display: none;
  }

  .allofbd-auth-hero-brand {
    margin-bottom: 12px;
  }

  .allofbd-auth-hero-brand .allofbd-auth-logo-img {
    height: 32px;
  }

  .allofbd-auth-form-brand {
    margin-bottom: 24px;
  }

  .allofbd-auth-form-brand .allofbd-auth-logo-img {
    height: 36px;
  }

  .allofbd-auth-form-panel {
    padding: 28px 20px 40px;
  }

  .allofbd-auth-view h2 {
    font-size: 24px;
  }

  .allofbd-otp-boxes {
    gap: 8px;
  }

  .allofbd-otp-input {
    width: 46px;
    height: 54px;
    font-size: 20px;
    border-radius: 10px;
  }

  .allofbd-social-buttons {
    flex-direction: column;
  }

  .allofbd-btn-social {
    width: 100%;
  }
}

/* ================================================================
   23. RESPONSIVE — SMALL MOBILE (≤400px)
   ================================================================ */

@media (max-width: 400px) {
  .allofbd-auth-container {
    grid-template-rows: 200px 1fr;
  }

  .allofbd-auth-form-panel {
    padding: 24px 16px 36px;
  }

  .allofbd-auth-view h2 {
    font-size: 22px;
  }

  .allofbd-otp-input {
    width: 40px;
    height: 48px;
    font-size: 18px;
    border-radius: 8px;
  }

  .allofbd-otp-boxes {
    gap: 6px;
  }

  .allofbd-input-wrap input {
    height: 46px;
    font-size: 14px;
  }

  .allofbd-btn-primary {
    height: 46px;
    font-size: 14.5px;
  }
}
