/**
 * DIGITAL BULL - MODERN TRENDING LOGIN PORTAL STYLES
 * Version: 3.0 (Trending SaaS Card Design)
 */

/* --------------------------------------------------------------------------
   1. MAIN LOGIN SECTION
   -------------------------------------------------------------------------- */
.db-login-section {
  padding: 5rem 1rem 6rem;
  background-color: #f6f9fd;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(234, 38, 42, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 39, 91, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.7) 0%, transparent 70%);
  min-height: calc(100vh - 430px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
}

.db-login-container {
  max-width: 1060px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.db-login-wrapper {
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
  gap: 2.25rem;
}

/* --------------------------------------------------------------------------
   2. MODERN TRENDING LOGIN CARD (AGENT & CLIENT)
   -------------------------------------------------------------------------- */
.db-login-card {
  flex: 1 1 0;
  max-width: 470px;
  min-width: 320px;
  background: #ffffff;
  border-radius: 24px;
  padding: 2.75rem 2.5rem 2.85rem;
  box-shadow: 
    0 1px 3px rgba(0, 39, 91, 0.03),
    0 16px 40px -6px rgba(0, 39, 91, 0.08),
    0 32px 64px -12px rgba(0, 39, 91, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.85);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.db-login-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 2px 6px rgba(0, 39, 91, 0.04),
    0 24px 50px -6px rgba(0, 39, 91, 0.13),
    0 40px 80px -12px rgba(0, 39, 91, 0.1);
  border-color: rgba(203, 213, 225, 0.95);
}

/* Modern Top Accent Stripe */
.db-login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 24px 24px 0 0;
  z-index: 3;
}

.db-login-card-agent::before {
  background: linear-gradient(90deg, #ea262a 0%, #ff5e62 100%);
}

.db-login-card-client::before {
  background: linear-gradient(90deg, #00275b 0%, #0062ff 100%);
}

/* Ambient Diffused Corner Glow (Soft & Modern) */
.db-card-corner-accent {
  position: absolute;
  top: -35px;
  right: -35px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 1;
}

.db-accent-agent {
  background: radial-gradient(circle, rgba(234, 38, 42, 0.6) 0%, transparent 70%);
}

.db-accent-client {
  background: radial-gradient(circle, rgba(0, 86, 214, 0.6) 0%, transparent 70%);
}

/* --------------------------------------------------------------------------
   3. CARD HEADER (TOP ROW, BADGE, ICON, TYPOGRAPHY)
   -------------------------------------------------------------------------- */
.db-login-card-header {
  position: relative;
  z-index: 2;
  margin-bottom: 1.5rem;
}

.db-login-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.db-login-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.db-login-card:hover .db-login-icon-box {
  transform: scale(1.05);
}

.db-icon-agent {
  background: linear-gradient(135deg, #ff4146 0%, #ea262a 100%);
  box-shadow: 0 10px 22px rgba(234, 38, 42, 0.32);
  color: #ffffff;
}

.db-icon-client {
  background: linear-gradient(135deg, #1d6aeb 0%, #0056d6 100%);
  box-shadow: 0 10px 22px rgba(0, 86, 214, 0.32);
  color: #ffffff;
}

/* Sleek Pill Capsule Badge */
.db-login-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.db-badge-agent {
  background: rgba(234, 38, 42, 0.08);
  color: #ea262a;
  border: 1px solid rgba(234, 38, 42, 0.18);
}

.db-badge-client {
  background: rgba(0, 86, 214, 0.08);
  color: #0056d6;
  border: 1px solid rgba(0, 86, 214, 0.18);
}

.db-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.db-badge-agent .db-badge-dot {
  background-color: #ea262a;
  box-shadow: 0 0 6px rgba(234, 38, 42, 0.6);
}

.db-badge-client .db-badge-dot {
  background-color: #0056d6;
  box-shadow: 0 0 6px rgba(0, 86, 214, 0.6);
}

.db-login-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #00275b;
  line-height: 1.2;
  margin: 0 0 0.45rem 0;
  letter-spacing: -0.02em;
}

.db-login-title span {
  color: #ea262a;
}

.db-login-subtitle {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0;
}

/* --------------------------------------------------------------------------
   4. FORM & TRENDING INPUT FIELDS
   -------------------------------------------------------------------------- */
.db-login-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  z-index: 2;
}

.db-input-group {
  position: relative;
  margin-bottom: 1.15rem;
  width: 100%;
}

.db-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color 0.2s ease, transform 0.2s ease;
  z-index: 3;
}

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

.db-input-group:focus-within .db-input-icon {
  transform: translateY(-50%) scale(1.08);
}

.db-login-card-agent .db-input-group:focus-within .db-input-icon {
  color: #ea262a;
}

.db-login-card-client .db-input-group:focus-within .db-input-icon {
  color: #0056d6;
}

.db-login-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 46px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.93rem;
  font-weight: 500;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.db-login-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.db-login-input:hover {
  border-color: #cbd5e1;
  background-color: #ffffff;
}

.db-login-card-agent .db-login-input:focus {
  border-color: #ea262a;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(234, 38, 42, 0.12);
}

.db-login-card-client .db-login-input:focus {
  border-color: #0056d6;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 86, 214, 0.12);
}

.db-login-input.db-has-toggle {
  padding-right: 48px;
}

.db-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  z-index: 3;
}

.db-toggle-password:hover {
  color: #00275b;
  background-color: rgba(0, 39, 91, 0.06);
}

.db-toggle-password svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   5. TRENDING ACTION BUTTONS WITH ARROW
   -------------------------------------------------------------------------- */
.db-btn-login-submit {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: none;
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 1.35rem;
  letter-spacing: 0.01em;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.db-btn-agent {
  background: linear-gradient(135deg, #ff3b3f 0%, #ea262a 100%);
  box-shadow: 0 10px 24px -4px rgba(234, 38, 42, 0.42);
}

.db-btn-agent:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -4px rgba(234, 38, 42, 0.52);
}

.db-btn-client {
  background: linear-gradient(135deg, #00275b 0%, #0056d6 100%);
  box-shadow: 0 10px 24px -4px rgba(0, 86, 214, 0.42);
}

.db-btn-client:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -4px rgba(0, 86, 214, 0.52);
}

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

.db-btn-arrow {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 0.25s ease;
}

.db-btn-login-submit:hover .db-btn-arrow {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   6. CENTER 'OR' DIVIDER
   -------------------------------------------------------------------------- */
.db-login-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 44px;
  flex-shrink: 0;
}

.db-divider-line {
  width: 1px;
  flex: 1;
  background: linear-gradient(to bottom, transparent, #cbd5e1 20%, #cbd5e1 80%, transparent);
}

.db-divider-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  margin: 0.75rem 0;
  box-shadow: 0 4px 14px rgba(0, 39, 91, 0.08);
  flex-shrink: 0;
  user-select: none;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   7. FOOTER LINK (CLIENT CARD)
   -------------------------------------------------------------------------- */
.db-login-footer-link {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.db-link-trending {
  color: #ea262a;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.db-link-trending:hover {
  color: #00275b;
}

.db-link-arrow {
  transition: transform 0.2s ease;
}

.db-link-trending:hover .db-link-arrow {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   8. RESPONSIVE DESIGN (MOBILE & TABLET ADAPTATION)
   -------------------------------------------------------------------------- */
@media (max-width: 880px) {
  .db-login-section {
    padding: 3rem 1rem 4rem;
    min-height: auto;
  }

  .db-login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    width: 100%;
  }

  .db-login-card {
    flex: none !important;
    flex-basis: auto !important;
    width: 100% !important;
    max-width: 440px !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: auto !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 2.25rem 1.85rem 2.5rem;
  }

  .db-login-card-header {
    width: 100%;
    flex-shrink: 0;
  }

  .db-login-form {
    flex: none !important;
    width: 100% !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
  }

  .db-login-divider {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    height: 38px;
    margin: 0.25rem 0;
  }

  .db-divider-line {
    height: 1px;
    width: auto;
    flex: 1 1 0;
    background: linear-gradient(to right, transparent, #cbd5e1 20%, #cbd5e1 80%, transparent);
  }

  .db-divider-badge {
    margin: 0 0.85rem;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .db-login-section {
    padding: 2.25rem 0.75rem 3.5rem;
  }

  .db-login-container {
    padding: 0 0.35rem;
  }

  .db-login-wrapper {
    gap: 1.25rem;
  }

  .db-login-card {
    padding: 2rem 1.25rem 2.25rem;
    border-radius: 20px;
    max-width: 100%;
  }

  .db-login-card::before {
    border-radius: 20px 20px 0 0;
  }

  .db-login-header-top {
    margin-bottom: 1rem;
  }

  .db-login-icon-box {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .db-login-icon-box svg {
    width: 20px;
    height: 20px;
  }

  .db-login-badge {
    font-size: 0.68rem;
    padding: 4px 10px;
  }

  .db-login-title {
    font-size: 1.6rem;
    margin-bottom: 0.35rem;
  }

  .db-login-subtitle {
    font-size: 0.84rem;
    line-height: 1.5;
  }

  .db-input-group {
    margin-bottom: 0.95rem;
  }

  .db-login-input {
    height: 46px;
    padding: 0 14px 0 42px;
    font-size: 0.9rem;
    border-radius: 11px;
  }

  .db-input-icon {
    left: 14px;
  }

  .db-input-icon svg {
    width: 16px;
    height: 16px;
  }

  .db-btn-login-submit {
    height: 46px;
    font-size: 0.92rem;
    margin-top: 1.15rem;
    border-radius: 11px;
  }

  .db-login-divider {
    max-width: 100%;
  }

  .db-divider-badge {
    width: 34px;
    height: 34px;
    font-size: 0.7rem;
    margin: 0 0.65rem;
  }

  .db-login-footer-link {
    font-size: 0.82rem;
    margin-top: 1.15rem;
    flex-wrap: wrap;
    gap: 0.3rem;
  }
}

@media (max-width: 360px) {
  .db-login-card {
    padding: 1.75rem 1rem 1.85rem;
    border-radius: 18px;
  }

  .db-login-card::before {
    border-radius: 18px 18px 0 0;
  }

  .db-login-title {
    font-size: 1.45rem;
  }

  .db-login-input {
    height: 44px;
    padding: 0 12px 0 38px;
    font-size: 0.86rem;
  }

  .db-input-icon {
    left: 12px;
  }

  .db-input-icon svg {
    width: 15px;
    height: 15px;
  }

  .db-btn-login-submit {
    height: 44px;
    font-size: 0.88rem;
  }
}

/* --------------------------------------------------------------------------
   9. ATTRACTIVE CARD & PORTAL ANIMATION SUITE
   -------------------------------------------------------------------------- */
.db-login-section {
  overflow-x: clip;
}

/* Dual-Card Symmetric Entrance (Fast Left & Right Slide, Releases transform for hover lift) */
.db-login-card-agent {
  animation: dbLoginCardFromLeft 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0s backwards;
}

.db-login-card-client {
  animation: dbLoginCardFromRight 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0s backwards;
}

.db-login-card-agent:hover {
  transform: translateY(-6px);
  border-color: rgba(234, 38, 42, 0.28);
  box-shadow:
    0 8px 20px rgba(234, 38, 42, 0.08),
    0 26px 52px -8px rgba(0, 39, 91, 0.14);
}

.db-login-card-client:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 86, 214, 0.28);
  box-shadow:
    0 8px 20px rgba(0, 86, 214, 0.1),
    0 26px 52px -8px rgba(0, 39, 91, 0.14);
}

@keyframes dbLoginCardFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-95px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes dbLoginCardFromRight {
  0% {
    opacity: 0;
    transform: translateX(95px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Flowing Top Accent Stripes */
.db-login-card-agent::before {
  background: linear-gradient(90deg, #ea262a 0%, #ff7b7e 50%, #ea262a 100%);
  background-size: 200% 100%;
  animation: dbLoginStripeFlow 4.5s linear infinite;
}

.db-login-card-client::before {
  background: linear-gradient(90deg, #00275b 0%, #2d7dff 50%, #00275b 100%);
  background-size: 200% 100%;
  animation: dbLoginStripeFlow 4.5s linear infinite;
}

@keyframes dbLoginStripeFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Ambient Corner Glow Breathing */
.db-card-corner-accent {
  animation: dbLoginCornerGlow 5.5s ease-in-out infinite;
}

@keyframes dbLoginCornerGlow {
  0%, 100% {
    opacity: 0.45;
    transform: scale(1);
  }
  50% {
    opacity: 0.78;
    transform: scale(1.16);
  }
}

/* Floating Icon Box & Pulsing Status Dot */
.db-login-icon-box {
  animation: dbLoginIconFloat 3.6s ease-in-out infinite;
}

.db-login-card:hover .db-login-icon-box {
  animation-play-state: paused;
  transform: scale(1.08) rotate(-4deg);
}

@keyframes dbLoginIconFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}

.db-badge-agent .db-badge-dot {
  animation: dbLoginDotPulseRed 2.2s ease-out infinite;
}

.db-badge-client .db-badge-dot {
  animation: dbLoginDotPulseBlue 2.2s ease-out infinite;
}

@keyframes dbLoginDotPulseRed {
  0% { box-shadow: 0 0 0 0 rgba(234, 38, 42, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(234, 38, 42, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 38, 42, 0); }
}

@keyframes dbLoginDotPulseBlue {
  0% { box-shadow: 0 0 0 0 rgba(0, 86, 214, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(0, 86, 214, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 86, 214, 0); }
}

/* Center 'OR' Divider Pop */
.db-divider-badge {
  animation: dbLoginDividerPop 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.1s backwards;
}

@keyframes dbLoginDividerPop {
  0% {
    opacity: 0;
    transform: scale(0.55) rotate(-20deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Staggered Inner Card Elements */
.db-login-card-header {
  animation: dbLoginInnerFadeUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) 0.06s backwards;
}

.db-login-form .db-input-group:nth-of-type(1) {
  animation: dbLoginInnerFadeUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) 0.1s backwards;
}

.db-login-form .db-input-group:nth-of-type(2) {
  animation: dbLoginInnerFadeUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) 0.14s backwards;
}

.db-btn-login-submit {
  animation: dbLoginInnerFadeUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) 0.18s backwards;
}

.db-login-footer-link {
  animation: dbLoginInnerFadeUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) 0.22s backwards;
}

@keyframes dbLoginInnerFadeUp {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Login Button Sheen Light Sweep */
.db-btn-login-submit::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: skewX(-22deg);
  pointer-events: none;
  animation: dbLoginBtnSheen 4.5s ease-in-out 1.2s infinite;
}

.db-btn-login-submit:hover::after {
  animation: none;
  left: 140%;
  transition: left 0.55s ease;
}

@keyframes dbLoginBtnSheen {
  0%, 55% { left: -120%; }
  80%, 100% { left: 145%; }
}

@media (prefers-reduced-motion: reduce) {
  .db-login-card-agent,
  .db-login-card-client,
  .db-login-card-agent::before,
  .db-login-card-client::before,
  .db-card-corner-accent,
  .db-login-icon-box,
  .db-badge-agent .db-badge-dot,
  .db-badge-client .db-badge-dot,
  .db-divider-badge,
  .db-login-card-header,
  .db-login-form .db-input-group,
  .db-btn-login-submit,
  .db-login-footer-link,
  .db-btn-login-submit::after {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .db-btn-login-submit::after {
    display: none;
  }
}
