:root {
  --crm-navy: #00204a;
  --crm-navy-2: #002d56;
  --crm-green: #1f8a3c;
  --crm-green-btn: #28a745;
  --crm-text: #212529;
  --crm-muted: #5c6770;
  --crm-border: #d7dde3;
  --crm-bg: #f4f6f8;
  --crm-card: #ffffff;
  --crm-err: #8a1f1f;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--crm-bg);
  color: var(--crm-text);
  font-family: Arial, Helvetica, sans-serif;
}

.crm-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  box-sizing: border-box;
}

.crm-login-card {
  width: 100%;
  max-width: 440px;
  background: var(--crm-card);
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 32, 74, 0.08);
  padding: 36px 32px 28px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.crm-login-card.is-closer {
  max-width: 720px;
}

.crm-closer-h {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--crm-navy);
}

.crm-closer-cols {
  display: flex;
  gap: 16px;
  margin: 12px 0 8px;
  isolation: isolate;
}

.crm-closer-col {
  flex: 1;
  min-width: 0;
}

.crm-closer-col label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--crm-navy);
}

.crm-closer-col select[multiple] {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--crm-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  box-sizing: border-box;
  color: var(--crm-text);
  background: #fff;
  overflow: auto;
  background-clip: padding-box;
}

.crm-closer-col .crm-login-btn {
  width: 100%;
  margin-top: 8px;
  height: 36px;
  font-size: 13px;
}

.crm-blended {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--crm-navy);
}

.crm-blended input {
  margin: 0;
}

.crm-login-brand {
  position: relative;
  text-align: center;
  margin-bottom: 22px;
}

.crm-login-logo-well {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(248px, 78%);
  margin: 0 auto 14px;
  padding: 8px 10px;
  background: #ffffff;
  border: 0;
  box-shadow: none;
  border-radius: 10px;
  box-sizing: border-box;
}

.crm-login-logo-well img {
  display: block;
  width: 100%;
  max-width: 248px;
  height: auto;
  object-fit: contain;
  image-rendering: auto;
  background: #ffffff;
  box-shadow: none;
}

.crm-login-co {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--crm-navy);
  line-height: 1.3;
}

.crm-login-co-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.crm-login-sub {
  margin: 0;
  font-size: 14px;
  color: var(--crm-muted);
}

.crm-login-field {
  margin: 0 0 14px;
}

.crm-login-field label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--crm-navy);
}

.crm-login-field input,
.crm-login-field select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--crm-border);
  border-radius: 6px;
  padding: 0 12px;
  font-size: 15px;
  box-sizing: border-box;
  color: var(--crm-text);
  background: #fff;
}

.crm-login-field input:focus,
.crm-login-field select:focus {
  outline: 2px solid rgba(31, 138, 60, 0.35);
  border-color: var(--crm-green);
}

.crm-login-field select:disabled {
  background: #eef1f4;
  color: #7a848c;
}

.crm-login-hint {
  margin: -2px 0 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--crm-muted);
}

#crmCloserReason:not([hidden]) {
  display: block;
  margin: 0 0 10px;
  color: var(--crm-navy);
}

.crm-login-ingroups select[multiple] {
  height: auto;
  min-height: 110px;
  padding: 8px 10px;
}

.crm-login-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.crm-login-btn {
  height: 44px;
  border: 0;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.crm-login-btn-primary {
  background: var(--crm-green-btn);
  color: #fff;
}

.crm-login-btn-primary:disabled,
.crm-login-btn-ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.crm-login-btn-ghost {
  background: #fff;
  color: var(--crm-navy);
  border: 1px solid var(--crm-border);
}

.crm-login-status,
.crm-login-error {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

.crm-login-status {
  color: var(--crm-muted);
}

.crm-login-error {
  color: var(--crm-err);
  font-weight: 700;
}

.crm-login-error[hidden],
.crm-login-status[hidden] {
  display: none;
}

.crm-login-note {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--crm-muted);
  text-align: center;
}

#crmCloserStep[hidden] {
  display: none;
}

#crmCloserStep:not([hidden]) {
  display: block;
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.crm-agc-pop,
.crm-agc-pop.is-open,
.crm-agc-pop:not([hidden]) {
  display: block;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 0;
  width: 1px;
  height: 1px;
  min-width: 1px;
  min-height: 1px;
  max-width: 1px;
  max-height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.crm-agc-pop-bar {
  height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
  border: 0;
}

.crm-agc-hidden,
iframe.crm-agc-hidden,
iframe.crm-agc-frame {
  display: block;
  width: 1px;
  height: 1px;
  min-width: 1px;
  min-height: 1px;
  max-width: 1px;
  max-height: 1px;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.crm-login-page.is-hosted-crm .crm-agc-pop,
.crm-login-page.is-hosted-crm .crm-agc-pop.is-open,
.crm-login-page.is-hosted-crm .crm-agc-pop:not([hidden]) {
  display: block;
  visibility: visible;
  z-index: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.crm-login-page.is-hosted-crm iframe.crm-agc-frame,
.crm-login-page.is-hosted-crm iframe.crm-agc-hidden {
  display: block;
  visibility: visible;
}

.crm-webphone-pop,
.crm-webphone-pop.is-open,
.crm-webphone-pop:not([hidden]) {
  display: block;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 0;
  width: 1px;
  height: 1px;
  min-width: 1px;
  min-height: 1px;
  max-width: 1px;
  max-height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.crm-webphone-pop-bar {
  height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
  border: 0;
}

iframe.crm-webphone-frame {
  display: block;
  width: 1px;
  height: 1px;
  min-width: 1px;
  min-height: 1px;
  max-width: 1px;
  max-height: 1px;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.crm-login-page.is-hosted-crm .crm-webphone-pop,
.crm-login-page.is-hosted-crm .crm-webphone-pop.is-open,
.crm-login-page.is-hosted-crm .crm-webphone-pop:not([hidden]) {
  display: block;
  visibility: visible;
  z-index: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.crm-login-page.is-hosted-crm iframe.crm-webphone-frame {
  display: block;
  visibility: visible;
}

.crm-app-frame {
  display: none;
}

.crm-login-page.is-hosted-crm {
  padding: 0;
  display: block;
  min-height: 100vh;
}

.crm-login-page.is-hosted-crm .crm-login-card,
.crm-login-page.is-hosted-crm .crm-login-note {
  display: none;
}

.crm-login-page.is-hosted-crm .crm-app-frame {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 2;
}

@media (max-width: 720px) {
  .crm-closer-cols {
    flex-direction: column;
  }

  .crm-login-card {
    padding: 28px 20px 22px;
  }

  .crm-login-co {
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .crm-login-page {
    padding: 16px 10px;
    align-items: flex-start;
  }

  .crm-login-card {
    margin-top: 24px;
  }
}

/* 2026-10-18: keep VICIdial's agent screen awake while hosted. At 1x1 px the cross-origin frame can be
   throttled by the browser, and queued DTMF (send_dtmf / external_dtmf) never reached the call; DTMF works
   on the native VICIdial screen. Visible-size but transparent and click-through: agents never see it. */
.crm-login-page.is-hosted-crm .crm-agc-pop,
.crm-login-page.is-hosted-crm .crm-agc-pop.is-open,
.crm-login-page.is-hosted-crm .crm-agc-pop:not([hidden]) {
  position: fixed !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 320px !important;
  height: 240px !important;
  overflow: hidden !important;
  opacity: 0.01 !important;
  pointer-events: none !important;
  z-index: 2147483000 !important;
}
.crm-login-page.is-hosted-crm iframe.crm-agc-frame,
.crm-login-page.is-hosted-crm iframe.crm-agc-hidden {
  width: 320px !important;
  height: 240px !important;
  min-width: 320px !important;
  min-height: 240px !important;
  max-width: 320px !important;
  max-height: 240px !important;
  pointer-events: none !important;
}

/* v.226 (2026-10-19): "VICIdial keypad" shows the live agent screen so agents can use VICIdial's own
   DTMF keypad; the CRM pad's tones are queued but never reach the call. Overrides the v.212 hidden rules. */
.crm-agc-keypad-bar { display: none; }
.crm-login-page.is-hosted-crm .crm-agc-pop.is-agent-keypad,
.crm-login-page.is-hosted-crm .crm-agc-pop.is-open.is-agent-keypad {
  left: auto !important;
  right: 16px !important;
  bottom: 16px !important;
  width: 860px !important;
  max-width: calc(100vw - 32px) !important;
  height: 620px !important;
  max-height: calc(100vh - 32px) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  background: #fff !important;
  border: 2px solid #1f3a5f !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35) !important;
  display: flex !important;
  flex-direction: column !important;
}
.crm-login-page.is-hosted-crm .crm-agc-pop.is-agent-keypad .crm-agc-keypad-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  background: #1f3a5f;
  color: #fff;
  font: 600 13px/1.3 system-ui, sans-serif;
  flex: 0 0 auto;
}
.crm-login-page.is-hosted-crm .crm-agc-pop.is-agent-keypad .crm-agc-keypad-bar button {
  padding: 4px 14px;
  font-weight: 700;
  cursor: pointer;
}
.crm-login-page.is-hosted-crm .crm-agc-pop.is-agent-keypad iframe.crm-agc-frame,
.crm-login-page.is-hosted-crm .crm-agc-pop.is-agent-keypad iframe.crm-agc-hidden {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  flex: 1 1 auto !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
}
