@import url("/assets/helpdesk/css/cortexdesk-fonts.css");

/* Figma CortexCraft Login — node 5388:3132 (exact tokens) */
:root {
  --cc-cream: #fbf7ef;
  --cc-ink: #17150f;
  --cc-text: #374151;
  --cc-muted: #6b7280;
  --cc-faint: #9ca3af;
  --cc-border: #ece4d5;
  --cc-orange: #f8ab05;
  --cc-indigo: #4338ca;
  --cc-navy: #1c1a3a;
  --cc-mono: "IBM Plex Mono", "Liberation Mono", ui-monospace, Menlo, monospace;
  --sneat-primary: var(--cc-orange);
  --bw-brand: var(--cc-indigo);
}

body.sneat-login-page {
  margin: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: 16px !important;
  background: var(--cc-cream) !important;
  color: var(--cc-text) !important;
  -webkit-font-smoothing: antialiased;
}

html:has(body.sneat-login-page) {
  height: 100%;
  overflow: hidden;
}

/* Only login visible by default. Frappe login.js uses jQuery .toggle() (inline display). */
body.sneat-login-page section.for-forgot,
body.sneat-login-page section.for-signup,
body.sneat-login-page section.for-login-with-email-link,
body.sneat-login-page section.for-email-login {
  display: none;
}

body.sneat-login-page section.for-login {
  display: block;
  width: 100%;
}

body.sneat-login-page .page-breadcrumbs,
body.sneat-login-page .page-header-wrapper,
body.sneat-login-page .page-footer,
body.sneat-login-page .web-footer,
body.sneat-login-page .footer-logo-extension,
body.sneat-login-page .navbar,
body.sneat-login-page .page-card-head,
body.sneat-login-page .page-header,
body.sneat-login-page a[href*="frappeframework.com"],
body.sneat-login-page img[src*="frappe-framework-logo"] {
  display: none !important;
}

body.sneat-login-page .page-content-wrapper,
body.sneat-login-page main.sneat-login-main,
body.sneat-login-page .page_content {
  height: 100vh !important;
  max-height: 100vh !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
  overflow: hidden !important;
}

body.sneat-login-page .for-login .page-card,
body.sneat-login-page .for-forgot .page-card,
body.sneat-login-page .for-signup .page-card,
body.sneat-login-page .for-login-with-email-link .page-card,
body.sneat-login-page .for-email-login .page-card,
body.sneat-login-page .sneat-auth__panel .page-card {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  max-width: none !important;
  width: 100% !important;
}

body.sneat-login-page .for-login .page-card {
  display: flex !important;
  flex-direction: column;
  gap: 20px;
}

.sneat-auth {
  display: grid !important;
  /* Navy panel shifted left to fill empty cream space */
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr) !important;
  height: 100vh !important;
  max-height: 100vh !important;
  min-height: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
  background: var(--cc-cream);
}

/* Left panel — form centered horizontally with equal side space */
.sneat-auth__form-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  max-height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 72px 56px 56px;
  box-sizing: border-box;
  background: var(--cc-cream);
}

/* Cortex Desk — top left */
.sneat-auth__brand-bar {
  position: absolute;
  top: 28px;
  left: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--cc-ink);
  z-index: 2;
}

.sneat-auth__brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  object-position: left center;
}

.sneat-auth__mark {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}

.sneat-auth__brand-name {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: var(--cc-ink);
}

/* FireControl / org logo — same height as Cortex Desk (do not clip wide wordmark) */
.sneat-auth__org-brand {
  position: absolute;
  top: 28px;
  right: 56px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 40px;
  min-height: 40px;
  max-width: none;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-sizing: border-box;
}

/* Logo and name sit side by side when the organisation has uploaded a logo;
   when it has not, the name is the only child and centres on its own. */
/* Logo above, name beneath, both right-aligned. Stacking keeps the logo at
   the CortexDesk mark's exact 40px/200px size while still showing the full
   organisation name — side by side, a long name would run into that mark. */
.sneat-auth__org-brand {
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 4px;
  height: auto;
  min-height: 40px;
  max-width: 220px;
}

/* Identical box to .sneat-auth__brand-logo so an uploaded organisation logo
   sits at the same scale as the CortexDesk mark opposite it. */
.sneat-auth__org-brand-img {
  display: block;
  flex-shrink: 0;
  height: 40px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  object-position: right center;
}

.sneat-auth__org-brand-name {
  margin: 0;
  min-width: 0;
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 24px;
  color: var(--cc-ink);
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  text-align: right;
}

/* Beneath a logo the name is secondary — smaller, and free to wrap. */
.sneat-auth__org-brand-img + .sneat-auth__org-brand-name {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.02em;
}

.sneat-auth__org-brand--missing .sneat-auth__org-brand-name {
  color: var(--cc-muted);
  text-transform: none;
  font-size: 14px;
  font-weight: 500;
}

/* Content column — centered in left panel */
.sneat-auth__panel {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Welcome — Figma: gap 8 (panel gap-40 handles outer spacing) */
.sneat-auth__welcome {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  width: 100%;
}

.sneat-auth__welcome h1 {
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.9px;
  line-height: 40px;
  color: var(--cc-ink);
}

.sneat-auth__welcome p {
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--cc-muted);
}

.sneat-auth__welcome--sub {
  margin-bottom: 16px;
}

.sneat-auth__welcome--sub h1 {
  font-size: 32px;
  line-height: 36px;
  letter-spacing: -0.5px;
}

.sneat-auth__org-name {
  display: none;
}

/* Form — Figma: gap 24 between blocks */
.sneat-form.login-content,
.sneat-form.form-signin,
form.sneat-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin: 0;
}

.sneat-field {
  display: flex;
  flex-direction: column;
  gap: 7.5px;
  margin: 0;
  width: 100%;
  padding-top: 2.5px;
}

.password-field.sneat-field {
  gap: 6px;
  padding-top: 0;
}

.sneat-field .form-label {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--cc-text);
  line-height: 20px;
}

.sneat-field-hint {
  display: none !important;
}

.sneat-password-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.sneat-forgot-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--cc-indigo);
  text-decoration: none;
  line-height: 16px;
}

.sneat-forgot-link:hover {
  text-decoration: underline;
}

.sneat-input,
body.sneat-login-page .form-control.sneat-input {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  padding: 15px 17px !important;
  border: 1px solid var(--cc-border) !important;
  border-radius: 12px !important;
  background: #fff !important;
  font-family: Inter, sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: normal !important;
  color: var(--cc-ink) !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  outline: none !important;
}

body.sneat-login-page label.form-label {
  font-family: Inter, sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--cc-text) !important;
  line-height: 20px !important;
}

.password-field .sneat-input,
body.sneat-login-page .password-field .form-control.sneat-input {
  padding: 13px 48px 13px 17px !important;
  line-height: 24px !important;
}

.sneat-input::placeholder {
  color: var(--cc-faint) !important;
  opacity: 1;
}

.sneat-input:focus {
  outline: none !important;
  border-color: var(--cc-orange) !important;
  box-shadow: 0 0 0 3px rgba(248, 171, 5, 0.16) !important;
}

.sneat-password-wrap {
  position: relative;
  width: 100%;
}

.sneat-password-wrap .toggle-password {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
  color: var(--cc-faint);
  font-size: 0;
  line-height: 0;
  user-select: none;
}

.sneat-password-wrap .toggle-password img {
  width: 18px;
  height: 16px;
  display: block;
  pointer-events: none;
}

/* Inline error pill — above org brand / FireControl logo */
.sneat-login-alert {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: none;
  border-radius: 9999px;
  background: #f8e8e0;
  box-sizing: border-box;
}

.sneat-login-alert--visible,
.sneat-login-alert:not([hidden]) {
  display: flex;
  margin-bottom: 0;
}

.sneat-login-alert[hidden] {
  display: none !important;
}

.sneat-login-alert__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.sneat-login-alert__text {
  flex: 1;
  min-width: 0;
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #4b5563;
  text-align: left;
}

.sneat-login-alert__close {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  cursor: pointer;
}

.sneat-login-alert__close:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sneat-form-extras {
  display: flex;
  align-items: center;
  margin: 0;
  width: 100%;
}

.sneat-remember {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #4b5563;
}

.sneat-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid #767676;
  border-radius: 2.5px;
  background: #fff;
  accent-color: var(--cc-orange);
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  box-sizing: border-box;
  cursor: pointer;
}

.sneat-remember input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  background: var(--cc-orange);
  border-radius: 1px;
}

.sneat-remember input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.sneat-remember span {
  padding-left: 8px;
}

.forgot-password-message {
  display: none !important;
}

/* Actions — Figma: pt-8 gap-12 */
.sneat-form-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
  width: 100%;
  margin: 0;
}

.sneat-form-actions .btn-login,
.sneat-form-actions .btn-primary,
body.sneat-login-page .btn-login,
body.sneat-login-page .btn.btn-login,
body.sneat-login-page .btn-sm.btn-login {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 16px !important;
  border: none !important;
  border-radius: 9999px !important;
  background: var(--cc-orange) !important;
  color: #fff !important;
  font-family: Inter, sans-serif !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 24px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  text-shadow: none !important;
  letter-spacing: normal !important;
}

.sneat-form-actions .btn-login:hover,
.sneat-form-actions .btn-primary:hover {
  filter: brightness(1.04);
}

.sneat-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 8px 0;
  font-family: var(--cc-mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--cc-faint);
  text-transform: uppercase;
}

.sneat-divider::before,
.sneat-divider::after {
  content: "";
  flex: 1;
  height: 0;
  border-top: 1px solid var(--cc-border);
}

.sneat-divider span {
  padding: 0 16px;
}

.sneat-social,
.sneat-social .social-login-buttons,
.sneat-social .login-button-wrapper {
  width: 100%;
  margin: 0;
}

.sneat-social .btn-login-option,
body.sneat-login-page .btn-login-with-email-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  margin: 0 !important;
  padding: 17px 8px !important;
  border: 1px solid transparent !important;
  border-radius: 9999px !important;
  background: transparent !important;
  color: var(--cc-indigo) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 24px !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.sneat-social .btn-login-option:hover {
  background: rgba(67, 56, 202, 0.06) !important;
}

/* Figma login frame has no signup row */
.sneat-signup--login {
  display: none !important;
}

.sneat-signup {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--cc-muted);
}

.sneat-signup a {
  color: var(--cc-indigo);
  font-weight: 600;
}

/* Footer — pinned to bottom, centered under form */
.sneat-auth__footer {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  z-index: 2;
}

.sneat-auth__footer a {
  font-size: 14px;
  line-height: 20px;
  color: var(--cc-faint);
  text-decoration: none;
}

.sneat-auth__footer a:hover {
  color: var(--cc-muted);
}

.sneat-auth__footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: #d1d5db;
  flex-shrink: 0;
}

/* Right panel — Figma: bg #1c1a3a, px-96, justify-center */
.sneat-auth__illustration {
  position: relative;
  display: none;
  overflow: hidden;
  height: 100%;
  max-height: 100vh;
  min-height: 0;
  padding: 0 72px;
  box-sizing: border-box;
  align-items: center;
  background: var(--cc-navy);
}

@media (min-width: 992px) {
  .sneat-auth__illustration {
    display: flex;
  }
}

.sneat-auth__illustration-pattern {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.sneat-auth__illustration-glow {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background: radial-gradient(
    circle at 15% 20%,
    rgba(255, 255, 255, 0.05) 0%,
    transparent 42%
  );
  pointer-events: none;
}

/* Figma: outer gap-32; quote+attribution gap-24; badge pt-48 */
.sneat-auth__quote-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.sneat-auth__quote-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.sneat-auth__quote {
  margin: 0;
  color: #fff;
}

.sneat-auth__quote-line {
  margin: 0 !important;
  padding: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 44px;
  letter-spacing: 0;
  color: #fff;
}

.sneat-auth__quote p {
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 44px;
  letter-spacing: 0;
  color: #fff;
  max-width: 560px;
}

.sneat-auth__quote-mark {
  color: #fff;
}

.sneat-auth__attribution {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
}

.sneat-auth__avatar {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: 2px solid var(--cc-indigo);
  padding: 2px;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

.sneat-auth__avatar img {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  object-fit: cover;
  display: block;
}

.sneat-auth__person-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: #fff;
}

.sneat-auth__person-role {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--cc-indigo);
}

.sneat-auth__badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 16px;
  width: 100%;
}

.sneat-auth__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 17px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--cc-mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--cc-faint);
  width: fit-content;
}

.sneat-auth__badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--cc-orange);
  flex-shrink: 0;
}

@media (max-width: 1199px) {
  .sneat-auth {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) !important;
  }

  .sneat-auth__form-side {
    padding: 64px 40px 56px;
  }

  .sneat-auth__brand-bar {
    left: 40px;
  }

  .sneat-auth__org-brand {
    right: 40px;
    height: auto;
    min-height: 40px;
  }

  .sneat-auth__footer {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .sneat-auth__illustration {
    padding: 0 48px;
  }

  .sneat-auth__quote-line,
  .sneat-auth__quote p {
    font-size: 32px;
    line-height: 40px;
  }
}

@media (max-width: 991px) {
  .sneat-auth {
    grid-template-columns: 1fr !important;
  }

  .sneat-auth__form-side {
    padding: 64px 24px 56px;
  }

  .sneat-auth__brand-bar {
    left: 24px;
    top: 20px;
  }

  .sneat-auth__org-brand {
    right: 24px;
    top: 20px;
  }

  /* The org logo keeps the CortexDesk mark's 40px/200px box at every width —
     only the name beside it gives ground on narrow screens. */
  .sneat-auth__org-brand-name {
    font-size: 13px;
    line-height: 18px;
    max-width: 180px;
  }

  .sneat-auth__footer {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

/* Phones: the stack still fits, so the name stays — just tighter. */
@media (max-width: 600px) {
  .sneat-auth__org-brand {
    max-width: 150px;
  }

  .sneat-auth__org-brand-img {
    height: 30px;
  }
}
