/* ================================================================
   AssetWise Insurance CMS — Login Page
   Inspired by PaySpace enterprise SaaS design
   Brand palette: Sienna Brown #A0522D · Dark Brown #6B3410 · Amber #CD853F
   ================================================================ */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --lp-brand:       #A0522D;
  --lp-brand-dark:  #6B3410;
  --lp-brand-deep:  #3D1A08;
  --lp-amber:       #CD853F;
  --lp-amber-light: #F5DEB3;   /* wheat */
  --lp-cream:       #FEF3E8;
  --lp-text:        #1C0A04;
  --lp-muted:       #9C7B6A;
}

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

body.login-page {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 520px 1fr;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================================================
   LEFT BRAND PANEL
   ================================================================ */

.login-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 52px 48px 40px;
  background: var(--lp-brand-deep);
  overflow: hidden;
  z-index: 1;
}

/* ── Decorative background ────────────────────────────────── */

/* Subtle grid pattern */
.login-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(205,133,63,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(205,133,63,.07) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 0;
}

/* Warm radial glow — top right */
.login-brand-panel::after {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(160,82,45,.38) 0%, transparent 65%);
  top: -120px; right: -120px;
  z-index: 0;
  pointer-events: none;
}

/* Amber glow — bottom left */
.lp-glow-bottom {
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(205,133,63,.22) 0%, transparent 65%);
  bottom: -80px; left: -60px;
  z-index: 0;
  pointer-events: none;
}

/* ── Content inside panel (z-index above decorations) ─────── */
.lp-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ── Logo block ────────────────────────────────────────────── */
.login-brand-logo-wrap {
  margin-bottom: 48px;
}

.login-brand-logo-img {
  display: block;
  max-width: 200px;
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0,0,0,.4));
}

/* Fallback: text + icon when no logo uploaded */
.login-brand-logo-fallback {
  display: flex;
  align-items: center;
  gap: 14px;
}
.login-brand-logo-fallback .lf-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--lp-brand), var(--lp-amber));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(160,82,45,.5);
}
.login-brand-logo-fallback .lf-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.3px;
  line-height: 1.1;
}
.login-brand-logo-fallback .lf-sub {
  font-size: .72rem;
  color: rgba(255,255,255,.45);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: .2px;
}

/* ── Tagline ─────────────────────────────────────────────── */
.login-brand-headline {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.28;
  letter-spacing: -.4px;
  margin-bottom: 14px;
}
.login-brand-headline em {
  font-style: normal;
  color: var(--lp-amber-light);
}

.login-brand-tagline {
  color: rgba(255,255,255,.55);
  font-size: .88rem;
  line-height: 1.75;
  max-width: 340px;
  margin-bottom: 44px;
}

/* ── Feature list ───────────────────────────────────────── */
.login-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  transition: background .18s;
}
.login-feature:hover { background: rgba(255,255,255,.085); }

.login-feature-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(160,82,45,.6), rgba(205,133,63,.45));
  border: 1px solid rgba(205,133,63,.25);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: .82rem;
  color: var(--lp-amber-light);
}

.login-feature-text strong {
  display: block;
  color: rgba(255,255,255,.9);
  font-size: .83rem;
  font-weight: 600;
  margin-bottom: 1px;
}
.login-feature-text span {
  font-size: .74rem;
  color: rgba(255,255,255,.42);
  line-height: 1.4;
}

/* ── Bottom badge ─────────────────────────────────────── */
.lp-trust-badge {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.38);
  font-size: .74rem;
}
.lp-trust-badge i {
  color: var(--lp-amber);
  font-size: .9rem;
  flex-shrink: 0;
}

/* ================================================================
   RIGHT FORM PANEL
   ================================================================ */

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 48px;
  background: #fff;
  overflow-y: auto;
  position: relative;
}

/* Subtle warm tint on right panel background */
.login-form-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 100% 0%, rgba(254,243,232,.6) 0%, transparent 60%);
  pointer-events: none;
}

.login-form-inner {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

/* ── Mobile logo (only shown when left panel is hidden) ─── */
.login-form-logo {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}
.login-form-logo img {
  max-width: 150px;
  max-height: 60px;
  object-fit: contain;
}
.login-form-logo-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.login-form-logo-fallback .lf-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--lp-brand), var(--lp-amber));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff;
  box-shadow: 0 6px 20px rgba(160,82,45,.35);
}
.login-form-logo-fallback span {
  font-size: 1rem;
  font-weight: 700;
  color: var(--lp-text);
}

/* ── Form header ────────────────────────────────────────── */
.login-form-header {
  margin-bottom: 32px;
}
.login-form-header .lh-eyebrow {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--lp-brand);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.login-form-header .lh-eyebrow::before {
  content: '';
  display: block;
  width: 18px; height: 2px;
  background: var(--lp-brand);
  border-radius: 1px;
}
.login-form-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--lp-text);
  letter-spacing: -.5px;
  margin-bottom: 6px;
  line-height: 1.15;
}
.login-form-header p {
  color: var(--lp-muted);
  font-size: .875rem;
  line-height: 1.5;
}

/* ── Alert boxes ─────────────────────────────────────────── */
.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid #dc2626;
  border-radius: 10px;
  padding: 12px 14px;
  color: #991b1b;
  font-size: .845rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
  animation: lp-shake .4s cubic-bezier(.36,.07,.19,.97) both;
}
.login-error i { color: #ef4444; margin-top: 1px; flex-shrink: 0; }

.login-expired {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 3px solid #d97706;
  border-radius: 10px;
  padding: 12px 14px;
  color: #92400e;
  font-size: .845rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
}
.login-expired i { color: #d97706; margin-top: 1px; flex-shrink: 0; }

/* ── Form fields ─────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 7px;
}

.input-wrap { position: relative; }

.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #bfae9a;
  font-size: .85rem;
  pointer-events: none;
  transition: color .18s;
  z-index: 1;
}

.input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid #E8DDD3;
  border-radius: 10px;
  font-size: .9rem;
  color: var(--lp-text);
  background: #FAFAF9;
  transition: all .18s cubic-bezier(.4,0,.2,1);
  outline: none;
  font-family: inherit;
}
.input-wrap input::placeholder { color: #c9b8a8; }

.input-wrap input:focus {
  border-color: var(--lp-brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(160,82,45,.12);
}
.input-wrap input:focus + .input-icon,
.input-wrap:focus-within .input-icon { color: var(--lp-brand); }

.input-wrap .toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #bfae9a;
  cursor: pointer;
  padding: 4px;
  font-size: .88rem;
  transition: color .15s;
  z-index: 1;
}
.input-wrap .toggle-pass:hover { color: var(--lp-brand); }

/* ── Submit button ──────────────────────────────────────── */
.login-btn {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--lp-brand) 0%, var(--lp-amber) 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: .93rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  letter-spacing: .2px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(160,82,45,.32);
  position: relative;
  overflow: hidden;
}

/* Shimmer overlay on hover */
.login-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .2s;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(160,82,45,.42); }
.login-btn:hover::after { opacity: 1; }
.login-btn:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(160,82,45,.25); }

/* Loading state */
.login-btn .btn-text { display: flex; align-items: center; gap: 8px; }
.login-btn .spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lp-spin .7s linear infinite;
}
.login-btn.loading .btn-text { display: none; }
.login-btn.loading .spinner { display: block; }

/* ── Divider ─────────────────────────────────────────────── */
.lp-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: #D4C5B8;
  font-size: .78rem;
}
.lp-divider::before,
.lp-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E8DDD3;
}

/* ── Footer ──────────────────────────────────────────────── */
.login-footer {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid #F0E8E0;
  text-align: center;
  color: #C5B0A0;
  font-size: .75rem;
  line-height: 1.6;
}
.login-footer strong { color: var(--lp-muted); font-weight: 600; }
.login-footer a { color: var(--lp-brand); }

/* ── Secure badge ───────────────────────────────────────── */
.lp-secure-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  color: #C5B0A0;
  font-size: .73rem;
}
.lp-secure-hint i { color: #16a34a; font-size: .8rem; }

/* ================================================================
   ANIMATIONS
   ================================================================ */

@keyframes lp-spin  { to { transform: rotate(360deg); } }
@keyframes lp-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
@keyframes lp-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-form-inner { animation: lp-fade-up .5s cubic-bezier(.4,0,.2,1) both; }

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Large — slight panel reduction */
@media (max-width: 1200px) {
  body.login-page { grid-template-columns: 460px 1fr; }
  .login-brand-panel { padding: 48px 40px 36px; }
  .login-brand-headline { font-size: 1.5rem; }
}

/* Tablet — stack: brand panel sits above form as a compact header */
@media (max-width: 960px) {
  body.login-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
  }

  .login-brand-panel {
    padding: 36px 36px 32px;
    flex-direction: row;
    align-items: center;
    gap: 32px;
  }

  .lp-content { flex-direction: row; align-items: center; gap: 36px; flex: 1; }

  /* On tablet: show only logo + tagline inline, hide features */
  .login-features { display: none; }
  .lp-trust-badge { display: none; }
  .login-brand-tagline { margin-bottom: 0; font-size: .82rem; max-width: 260px; }
  .login-brand-headline { font-size: 1.2rem; margin-bottom: 6px; }

  .lp-glow-bottom { display: none; }

  .login-form-panel { padding: 48px 32px; min-height: auto; }
}

/* Mobile — brand panel hidden, form goes full-screen with warm gradient bg */
@media (max-width: 640px) {
  body.login-page {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    background: linear-gradient(160deg, var(--lp-brand-deep) 0%, #6B3410 45%, var(--lp-brand) 100%);
  }

  .login-brand-panel { display: none; }

  .login-form-panel {
    background: transparent;
    padding: 40px 24px 32px;
    justify-content: flex-start;
    padding-top: 56px;
    overflow-y: auto;
    min-height: 100vh;
  }
  .login-form-panel::before { display: none; }

  .login-form-inner {
    background: #fff;
    border-radius: 20px;
    padding: 32px 24px 28px;
    box-shadow: 0 24px 64px rgba(0,0,0,.4);
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
    animation: lp-fade-up .45s cubic-bezier(.4,0,.2,1) both;
  }

  /* Show logo inside form card on mobile */
  .login-form-logo { display: flex; }

  .login-form-header { margin-bottom: 24px; }
  .login-footer { color: #9C7B6A; }
  .login-footer strong { color: #6B4C3B; }
  .lp-secure-hint { color: #9C7B6A; }
}

@media (max-width: 400px) {
  .login-form-panel { padding: 24px 16px; }
  .login-form-inner { padding: 28px 20px 24px; border-radius: 16px; }
  .login-brand-headline { font-size: 1rem; }
}
