/*  login page */

.login-page {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2vw, 24px);
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 12% 18%, var(--crm-brand-ring), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(111,18,38,.18), transparent 30%),
    linear-gradient(135deg, #f7edf0 0%, #f6f8fb 42%, #edf1f7 72%, #f8ecef 100%);
  background-attachment: fixed;
  background-size: cover;
  isolation: isolate;
}

.login-page::before {
  background: linear-gradient(115deg, rgba(93,15,32,.08), transparent 35%, rgba(190,31,62,.07) 70%, transparent);
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

/* The login button is available only after Turnstile succeeds and is locked
   immediately after the first accepted submission. */
.login-btn:disabled,
.login-btn[aria-disabled="true"] {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-bg-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.28), rgba(0,0,0,0.06));
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.28), rgba(0,0,0,0.06));
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(18px);
  pointer-events: none;
  z-index: -1;
}

.orb-1 {
  width: clamp(160px, 22vw, 240px);
  height: clamp(160px, 22vw, 240px);
  top: -40px;
  left: -40px;
  background: var(--crm-brand-soft);
}

.orb-2 {
  width: clamp(190px, 24vw, 280px);
  height: clamp(190px, 24vw, 280px);
  right: -40px;
  bottom: -40px;
  background: rgba(143, 18, 38, 0.07);
}

.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.login-auth-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: calc(100dvh - clamp(20px, 4vw, 48px));
  margin: 0;
}

.login-card {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 100%;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.70);
  border-radius: var(--crm-radius-lg);
  overflow: hidden;
  box-shadow: var(--crm-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.login-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 28px 22px;
  background: var(--crm-brand-gradient-deep);

}

.brand-head {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.logo-badge {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fff6f7 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
}

.logo-badge img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.brand-subtitle {
  display: block;
  margin: 0;
  text-align: center;
  color: #ffffff;
  font-size: clamp(19px, 2.2vw, 23px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.brand-metrics {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(16px, 3vw, 28px);
}

.metric-card {
  padding: 16px 16px 15px;
  border-radius: 20px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.metric-label {
  display: block;
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(255,255,255,0.72);
}

.metric-value {
  display: block;
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.3;
  font-weight: 700;
  color: #ffffff;
  overflow-wrap: anywhere;
}

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 30px 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(251,252,255,0.98) 100%);
}

.login-form-header {
  margin-bottom: clamp(18px, 3vw, 28px);
}

.login-form-header h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--crm-text);
}

.login-form-header p {
  margin: 0;
  font-size: clamp(13px, 1.25vw, 15px);
  line-height: 1.7;
  color: var(--crm-text-muted);
  overflow-wrap: anywhere;
}

.login-alert {
  margin-bottom: 18px;
}

.login-btn {
  width: 100%;
  margin-top: 6px;
}

.login-footer {
  margin-top: clamp(16px, 2vw, 24px);
  padding-top: 18px;
  border-top: 1px solid var(--crm-border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: clamp(11.5px, 1.1vw, 12.5px);
  color: #8c94a3;
  overflow-wrap: anywhere;
}

.login-page-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 10px 0;
  color: #7d8798;
  font-size: clamp(11.5px, 1.1vw, 12.5px);
  line-height: 1.4;
  text-align: center;
}

.login-turnstile {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 65px;
}

.login-turnstile .cf-turnstile {
  max-width: 100%;
}

@media (max-width: 980px) {
  .login-page {
    align-items: flex-start;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .login-auth-form {
    min-height: calc(100dvh - 36px);
  }

  .login-brand-panel {
    order: 1;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .login-form-panel {
    order: 2;
  }

  .logo-badge {
    width: 82px;
    height: 82px;
  }

  .brand-subtitle {
    max-width: 28rem;
  }
}

@media (max-width: 640px) {
  .login-page {
    display: flex;
    align-items: center;
    padding: 16px 0;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .login-shell {
    width: 92%;
    max-width: 430px;
  }

  .login-auth-form {
    display: block;
    min-height: auto;
  }

  .login-card {
    border-radius: 22px;
  }

  .brand-metrics {
    display: none;
  }

  .login-brand-panel {
    padding: 18px 16px 16px;
  }

  .brand-head {
    gap: 10px;
  }

  .logo-badge {
    width: 68px;
    height: 68px;
  }

  .brand-subtitle {
    max-width: 18rem;
    font-size: 18px;
  }

  .login-form-panel {
    padding: 20px 18px 18px;
  }

  .login-form-header {
    margin-bottom: 14px;
  }

  .login-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .login-page-footer {
    gap: 5px;
    padding-top: 12px;
  }

  .login-orb {
    display: none;
  }
}

@media (max-width: 420px) {
  .login-brand-panel,
  .login-form-panel {
    padding-left: 14px;
    padding-right: 14px;
  }
}
