@font-face {
  font-family: "Hallo Thai";
  src: url("../fonts/NotoSansThaiLooped-Regular.ttf") format("truetype");
  font-display: swap;
}

body:has(#app) {
  --hc-login-canvas: #fff7e9;
  --hc-login-card: #fff;
  --hc-login-field: #fffdf8;
  --hc-login-text: #171717;
  --hc-login-muted: #716b65;
  --hc-login-line: #17171733;
  --hc-login-accent: #3547ff;
  background: var(--hc-login-canvas);
}

[data-hallo-theme="dark"] body:has(#app) {
  --hc-login-canvas: #171717;
  --hc-login-card: #242424;
  --hc-login-field: #303030;
  --hc-login-text: #fff7e9;
  --hc-login-muted: #c8c0b8;
  --hc-login-line: #fff7e933;
  --hc-login-accent: #ff91c8;
  color-scheme: dark;
}

.hc-login-branding {
  position: fixed;
  z-index: 50;
  top: 28px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 650 26px/1.2 "Hallo Thai", system-ui, sans-serif;
}

.hc-login-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--hc-login-text);
  text-decoration: none;
}

.hc-login-branding .hc-site-theme-switch {
  position: absolute;
  right: clamp(14px, 4vw, 44px);
}

#app main {
  /* Match the landing page: one calm cream canvas, no decorative gradient. */
  background: var(--hc-login-canvas);
  color: var(--hc-login-text);
  padding: 64px 16px 36px;
  font-family: "Hallo Thai", system-ui, sans-serif;
}

/* Chatwoot adds its own Tailwind gradient utility on the login shell. Keep
   this override scoped to the login UI so the dashboard is unaffected. */
#app main :is([class*="bg-gradient"], [class*="from-"], [class*="via-"], [class*="to-"]) {
  background-image: none !important;
  background-color: var(--hc-login-canvas) !important;
}

#app main > :is(div, section)[class*="min-h"] {
  background-image: none !important;
  background-color: var(--hc-login-canvas) !important;
}

#app main img:is([src$="/logo.svg"], [src$="/logo_dark.svg"]) {
  display: none;
}

/* The stock Chatwoot login component renders a second installation logo.
   The Coral Hallochat mark above is the single source of branding here. */
#app main img {
  display: none !important;
}

#app main h2 {
  display: block;
  margin: 82px 0 0;
  color: var(--hc-login-text);
  text-align: center;
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.2;
}

#app main :is(.hc-login-card, section:has([data-testid="email_input"])) {
  width: min(100%, 460px);
  margin: 24px auto 0;
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid var(--hc-login-line);
  border-radius: 26px;
  background: var(--hc-login-card);
  box-shadow: 0 18px 45px #12231b15;
}

#app form label {
  color: var(--hc-login-text);
}

#app form a {
  color: var(--hc-login-accent);
}

#app form input {
  background: var(--hc-login-field);
  border-radius: 12px;
  min-height: 48px;
  color: var(--hc-login-text);
  outline-color: var(--hc-login-line);
}

#app form input::placeholder {
  color: var(--hc-login-muted);
}

#app form input:focus-visible {
  outline: 2px solid var(--hc-login-accent);
}

#app form button:not(.bg-n-brand) {
  color: var(--hc-login-muted);
}

#app form button.bg-n-brand {
  background: #3547ff !important;
  color: #fff !important;
  border-radius: 999px;
  font-weight: 650;
}

#app form button.bg-n-brand:focus-visible {
  outline: 2px solid var(--hc-login-accent);
  outline-offset: 3px;
}

.hc-login-brand img {
  content: url("/brand-assets/hallochat-landing/assets/brand/hallochat-light-v4.svg");
  display: block;
  width: min(232px, 55vw);
  height: auto;
  filter: none;
}

[data-hallo-theme="dark"] .hc-login-brand img {
  content: url("/brand-assets/hallochat-landing/assets/brand/hallochat-dark-starburst-v3.svg");
  filter: none;
}

.hc-admin-login {
  margin: 0;
}

.hc-admin-login .hc-admin-login-main {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
}

.hc-admin-login-main h2 {
  text-align: center;
  font-weight: 500;
  line-height: 1.2;
}

.hc-admin-login-main form {
  display: grid;
  gap: 20px;
}

.hc-admin-login-field {
  display: grid;
  gap: 6px;
}

.hc-admin-login-field label {
  font-size: 14px;
  font-weight: 500;
}

.hc-admin-login-main form input {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hc-login-line);
  font: inherit;
}

.hc-admin-login-submit {
  min-height: 48px;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.hc-admin-login-submit:hover {
  filter: brightness(.95);
}

.hc-admin-login-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffe1df;
  color: #76251f;
}

@font-face {
  font-family: "DM Sans";
  src: url("./dm-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

.hc-admin-login .hc-login-brand {
  gap: 7px;
  font: 600 24px/1 "DM Sans", Tahoma, sans-serif;
  letter-spacing: -.085em;
}

.hc-admin-login .hc-login-brand img {
  width: 26px;
  height: 26px;
  filter: none;
}

.hc-admin-brand-period {
  color: #5a438d;
}

/* Public HalloChat sign-in uses the white brand theme. */
html body:has(> .hc-login-branding + #app) {
  --hc-login-canvas: #fff;
  --hc-login-card: #fff;
  --hc-login-field: #fff;
  --hc-login-text: #171717;
  --hc-login-muted: #646464;
  --hc-login-line: #17171733;
  --hc-login-accent: #171717;
  color-scheme: light;
}

html body > .hc-login-branding .hc-login-brand img {
  content: url("/brand-assets/hallochat-landing/assets/brand/hallo-logo-chat.v6.svg");
  filter: none;
  width: min(162.4px, 38.5vw);
}

body:has(> .hc-login-branding + #app) #app form button.bg-n-brand {
  background: #000 !important;
  color: #fff !important;
}

.hc-login-language {
  position: absolute;
  inset-inline-end: clamp(12px, 4vw, 40px);
  padding: 6px 9px;
  border: 1px solid var(--hc-login-line, #ddd);
  border-radius: 8px;
  color: #171717;
  text-decoration: none;
  font: 650 12px/1.2 system-ui, sans-serif;
}

.hc-login-language:hover { background: #f2f2f2; }
.hc-login-language:focus-visible { outline: 2px solid #171717; outline-offset: 2px; }

[data-hallo-theme="dark"] .hc-admin-brand-period {
  color: #c3aeff;
}

#app .hc-admin-login-main {
  font-family: "DM Sans", Tahoma, sans-serif;
}

@media (max-width: 809px) {
  .hc-admin-login .hc-login-brand {
    gap: 6px;
    font-size: 22px;
  }

  .hc-admin-login .hc-login-brand img {
    width: 24px;
    height: 24px;
  }
}
