/**
 * Auth / guest pages — Aegean Night
 */
@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap");

:root {
  --crm-ink: #07111f;
  --crm-deep: #0b1c33;
  --crm-sea: #12324f;
  --crm-crimson: #c8102e;
  --crm-crimson-deep: #9b0d24;
  --crm-sand: #f4efe6;
  --crm-paper: #fbf8f3;
  --crm-text: #1a2332;
  --crm-muted: #5c6b7a;
  --crm-line: rgba(26, 35, 50, 0.12);
}

body.crm-guest-body {
  background: var(--crm-ink);
  font-family: "Figtree", sans-serif !important;
  color: var(--crm-text);
}

/* Hide top dark navbar on auth screens */
body.crm-guest-body > .navbar {
  display: none !important;
}

.crm-auth-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 3rem);
  isolation: isolate;
}

.crm-auth-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 10% 0%, #1a3a55 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 100%, #3a0f1a 0%, transparent 50%),
    linear-gradient(155deg, var(--crm-ink) 0%, var(--crm-deep) 48%, #15283f 100%);
  animation: crmAtmosphereDrift 18s ease-in-out infinite alternate;
}

.crm-auth-atmosphere__wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 17, 31, 0.2) 0%, transparent 40%),
    repeating-linear-gradient(
      -18deg,
      transparent 0,
      transparent 28px,
      rgba(255, 255, 255, 0.015) 28px,
      rgba(255, 255, 255, 0.015) 29px
    );
}

.crm-auth-atmosphere__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
}

.crm-auth-atmosphere__orb--a {
  width: min(48vw, 420px);
  height: min(48vw, 420px);
  top: -8%;
  left: -6%;
  background: rgba(200, 16, 46, 0.35);
  animation: crmOrbFloat 12s ease-in-out infinite alternate;
}

.crm-auth-atmosphere__orb--b {
  width: min(55vw, 520px);
  height: min(55vw, 520px);
  right: -10%;
  bottom: -18%;
  background: rgba(40, 120, 160, 0.28);
  animation: crmOrbFloat 14s ease-in-out infinite alternate-reverse;
}

.crm-auth-atmosphere__grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(244, 239, 230, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 239, 230, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 35% 40%, #000 20%, transparent 75%);
}

.crm-auth-atmosphere__crescent {
  position: absolute;
  width: min(42vw, 340px);
  height: auto;
  top: 8%;
  right: 8%;
  color: #f4efe6;
  animation: crmCrescentIn 1.4s ease-out both;
}

.crm-auth-shell {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

.crm-auth-hero {
  color: var(--crm-sand);
  animation: crmRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.crm-auth-hero__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.1rem;
}

.crm-auth-hero__logo {
  width: clamp(72px, 10vw, 96px);
  height: clamp(72px, 10vw, 96px);
  object-fit: contain;
  border-radius: 0;
  background: transparent !important;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.crm-auth-hero__title {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.03em;
  font-size: clamp(3rem, 7.5vw, 5.4rem);
}

.crm-auth-hero__title-main {
  display: block;
  color: #fff8f0;
}

.crm-auth-hero__title-crm {
  display: block;
  color: var(--crm-crimson);
  margin-top: 0.08em;
}

.crm-auth-hero__tagline {
  margin: 1.15rem 0 0;
  max-width: 22ch;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(244, 239, 230, 0.78);
  animation: crmRise 1.05s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.crm-auth-panel {
  background: var(--crm-paper);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  animation: crmRise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.crm-auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.crm-auth-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--crm-muted);
}

.crm-auth-field .form-control {
  height: 48px;
  border-radius: 3px;
  border: 1px solid var(--crm-line);
  background: #fff;
  padding: 0.65rem 0.9rem;
  font-size: 0.98rem;
  color: var(--crm-text);
  box-shadow: none !important;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.crm-auth-field .form-control::placeholder {
  color: #9aa7b5;
}

.crm-auth-field .form-control:focus {
  border-color: var(--crm-crimson);
  background: #fff;
}

.crm-auth-field.has-error .form-control {
  border-color: var(--crm-crimson);
}

.crm-auth-error {
  display: block;
  margin-top: 0.4rem;
  color: var(--crm-crimson-deep);
  font-size: 0.85rem;
}

.crm-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.crm-auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--crm-muted);
  cursor: pointer;
}

.crm-auth-remember input {
  width: 15px;
  height: 15px;
  accent-color: var(--crm-crimson);
}

.crm-auth-forgot {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--crm-sea);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.crm-auth-forgot:hover {
  color: var(--crm-crimson);
  border-bottom-color: rgba(200, 16, 46, 0.45);
  text-decoration: none;
}

.crm-auth-submit {
  margin-top: 0.35rem;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 3px;
  background: linear-gradient(180deg, #d31435 0%, var(--crm-crimson-deep) 100%);
  color: #fff;
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.crm-auth-submit:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.crm-auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.crm-auth-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* recaptcha / helper leftovers */
.crm-auth-panel .help-block {
  color: var(--crm-crimson-deep);
  font-size: 0.85rem;
}

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

@keyframes crmAtmosphereDrift {
  from { filter: saturate(1); }
  to { filter: saturate(1.12); }
}

@keyframes crmOrbFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(18px, -14px) scale(1.06); }
}

@keyframes crmCrescentIn {
  from { opacity: 0; transform: translateY(12px) rotate(-6deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

@media (max-width: 900px) {
  .crm-auth-shell {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .crm-auth-hero {
    text-align: left;
  }

  .crm-auth-hero__tagline {
    max-width: none;
  }

  .crm-auth-atmosphere__crescent {
    width: min(55vw, 220px);
    opacity: 0.7;
  }
}

@media (max-width: 575px) {
  .crm-auth-page {
    padding: 1.25rem 1rem 1.75rem;
    align-items: flex-start;
  }

  .crm-auth-hero__title {
    font-size: clamp(2.6rem, 14vw, 3.4rem);
  }

  .crm-auth-panel {
    padding: 1.25rem 1.1rem 1.5rem;
  }
}
