/* ═══════════════════════════════════════════════════
   KASALOMA CRM — LOGIN  |  Professional redesign
   ═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* ─── Tokens ─── */
:root {
  --navy:      #0B1E3D;
  --navy-mid:  #132848;
  --navy-light:#1E3A5F;
  --accent:    #2563EB;
  --accent-h:  #1D4ED8;
  --border:    #DDE5EF;
  --muted:     #64748B;
  --text:      #0F172A;
  --bg-right:  #F5F8FC;
  --radius:    14px;
}

body.kcrm-login-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  background: var(--navy);
  color: var(--text);
}
a { text-decoration: none; }

/* ═══════════════════════════════════════════════════
   SHELL — two columns
═══════════════════════════════════════════════════ */
.kcrm-login-shell {
  display: grid;
  grid-template-columns: 1fr minmax(460px, 500px);
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════
   LEFT PANEL
═══════════════════════════════════════════════════ */
.kcrm-login-visual {
  background: var(--navy);
  padding: 48px 56px;
  display: flex;
  align-items: stretch;
  position: relative;
  overflow: hidden;
}

/* subtle radial glows */
.kcrm-login-visual::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  top: -180px; right: -160px;
  background: radial-gradient(circle, rgba(37,99,235,.18) 0%, transparent 65%);
  pointer-events: none;
}
.kcrm-login-visual::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  bottom: -100px; left: -80px;
  background: radial-gradient(circle, rgba(14,165,233,.1) 0%, transparent 65%);
  pointer-events: none;
}

/* thin grid overlay */
.kcrm-login-visual-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 48px 48px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 20px;
  padding: 48px 52px;
}

/* Logo lockup — left panel */
.kcrm-login-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  margin-bottom: 52px;
}
/* [LOGO | CRM] pill */
.kcrm-login-logo-link .kcrm-logo-lockup-img {
  height: 26px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}
.kcrm-login-logo-link .kcrm-logo-div {
  width: 1px; height: 20px;
  background: rgba(255,255,255,.3);
  margin: 0 11px;
}
.kcrm-login-logo-link .kcrm-logo-label {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}

/* Headline */
.kcrm-brand-lockup h1 {
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin: 0 0 18px;
  max-width: 480px;
}
.kcrm-brand-lockup h1 span { color: #7DD3FC; }
.kcrm-brand-lockup p {
  font-size: 15.5px;
  color: rgba(255,255,255,.58);
  line-height: 1.75;
  max-width: 460px;
  margin: 0;
}

/* Feature cards */
.kcrm-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 0;
}
.kcrm-proof-card {
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  padding: 20px 18px;
  transition: background .2s;
}
.kcrm-proof-card:hover { background: rgba(255,255,255,.09); }
.kcrm-proof-card span {
  display: inline-flex;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,.1);
  border-radius: 10px;
  font-size: 18px;
  margin-bottom: 12px;
}
.kcrm-proof-card strong {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}
.kcrm-proof-card p {
  color: rgba(255,255,255,.52);
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

.kcrm-visual-footer {
  color: rgba(255,255,255,.28);
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════
   RIGHT PANEL
═══════════════════════════════════════════════════ */
.kcrm-login-panel {
  background: var(--bg-right);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
}
.kcrm-login-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(37,99,235,.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 0% 100%, rgba(11,30,61,.04) 0%, transparent 55%);
  pointer-events: none;
}

.kcrm-login-card {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

/* Logo lockup — right panel (same [LOGO | CRM] rule) */
.kcrm-login-box-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  background: var(--navy);
  border-radius: 10px;
  padding: 6px 14px 6px 8px;
  margin-bottom: 28px;
  box-shadow: 0 2px 8px rgba(11,30,61,.18);
}
.kcrm-login-box-logo-link .kcrm-logo-lockup-img {
  height: 22px;
  width: auto;
  filter: brightness(0) invert(1);
  display: block;
}
.kcrm-login-box-logo-link .kcrm-logo-div {
  width: 1px; height: 18px;
  background: rgba(255,255,255,.28);
  margin: 0 10px;
}
.kcrm-login-box-logo-link .kcrm-logo-label {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}

/* Card top text */
.kcrm-login-card-top { margin-bottom: 28px; }
.kcrm-login-card-top h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.025em;
  line-height: 1.1;
  margin: 0 0 7px;
}
.kcrm-login-card-top p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}
.kcrm-login-overline {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 11px;
  border-radius: 999px;
  background: #EFF6FF;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ─── Alerts ─── */
.kcrm-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid transparent;
}
.kcrm-alert strong { font-weight: 700; }
.kcrm-alert-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; margin-top: 4px; }
.kcrm-alert-error   { background: #FFF2F2; border-color: #FECACA; color: #991B1B; }
.kcrm-alert-error   .kcrm-alert-dot { background: #EF4444; }
.kcrm-alert-warning { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.kcrm-alert-warning .kcrm-alert-dot { background: #F59E0B; }
.kcrm-alert-success { background: #F0FDF4; border-color: #BBF7D0; color: #166534; }
.kcrm-alert-success .kcrm-alert-dot { background: #22C55E; }
.kcrm-alert-info    { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.kcrm-alert-info    .kcrm-alert-dot { background: #3B82F6; }

/* ─── Form ─── */
.kcrm-login-form { display: flex; flex-direction: column; gap: 0; }

.kcrm-field-group { margin-bottom: 16px; }
.kcrm-field-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 7px;
  letter-spacing: .01em;
}
.kcrm-field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}
.kcrm-field-head label { margin-bottom: 0; }

.kcrm-input-shell {
  position: relative;
  display: flex;
  align-items: center;
}
.kcrm-input-icon {
  position: absolute; left: 14px; z-index: 1;
  pointer-events: none; font-size: 14px; line-height: 1;
  color: var(--muted);
}
.kcrm-input-shell input {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 0 46px 0 42px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .16s, box-shadow .16s;
}
.kcrm-input-shell input::placeholder { color: #CBD5E1; }
.kcrm-input-shell input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.kcrm-toggle-pw {
  position: absolute; right: 12px;
  border: 0; background: transparent;
  color: var(--muted); font-size: 11.5px; font-weight: 600;
  cursor: pointer; padding: 6px 4px;
  font-family: inherit;
  transition: color .15s;
}
.kcrm-toggle-pw:hover { color: var(--navy); }

.kcrm-login-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.kcrm-checkbox-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; user-select: none;
}
.kcrm-checkbox-label input[type=checkbox] {
  width: 15px; height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.kcrm-mini-link {
  font-size: 12.5px; font-weight: 600;
  color: var(--accent); transition: color .15s;
}
.kcrm-mini-link:hover { color: var(--accent-h); }
.kcrm-secondary-link {
  font-size: 13px; font-weight: 600;
  color: var(--accent); transition: color .15s;
}
.kcrm-secondary-link:hover { color: var(--accent-h); }

/* Submit */
.kcrm-login-submit {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .01em;
  transition: background .16s, transform .14s, box-shadow .14s;
  box-shadow: 0 4px 16px rgba(37,99,235,.3);
  text-decoration: none;
}
.kcrm-login-submit:hover {
  background: var(--accent-h);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37,99,235,.38);
  color: #fff;
}
.kcrm-login-submit:active { transform: translateY(0); }
.kcrm-login-submit:disabled { opacity: .75; cursor: wait; transform: none; }

.kcrm-btn-loader {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  display: none;
  animation: kspin .75s linear infinite;
}
.kcrm-login-submit.is-loading .kcrm-btn-loader { display: block; }
.kcrm-login-submit.is-loading .kcrm-btn-text  { opacity: .85; }
@keyframes kspin { to { transform: rotate(360deg); } }

/* Divider */
.kcrm-login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0;
  font-size: 12px; color: #CBD5E1; font-weight: 500;
}
.kcrm-login-divider::before,
.kcrm-login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Register button */
.kcrm-register-btn {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .16s, background .16s;
}
.kcrm-register-btn:hover {
  border-color: var(--navy);
  background: #F8FAFC;
  color: var(--navy);
}

/* Bottom note */
.kcrm-login-bottom-note {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #EEF2F7;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  text-align: center;
}
.kcrm-login-bottom-note strong { color: var(--text); font-weight: 600; }

/* ═══════════════════════════════════════════════════
   TABLET
═══════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .kcrm-login-shell { grid-template-columns: 1fr; }
  .kcrm-login-visual { padding: 36px 40px; min-height: auto; }
  .kcrm-login-visual-inner { padding: 40px 44px; }
  .kcrm-proof-grid { grid-template-columns: repeat(3,1fr); }
  .kcrm-login-panel { padding: 36px 32px; }
}

/* ═══════════════════════════════════════════════════
   MOBILE APP EXPERIENCE
═══════════════════════════════════════════════════ */
@media (max-width: 767px) {
  html, body { height: 100%; }
  body.kcrm-login-body {
    background: var(--navy);
    min-height: 100dvh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  .kcrm-login-visual { display: none !important; }
  .kcrm-login-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  .kcrm-login-panel {
    flex: 1; padding: 0;
    display: flex; flex-direction: column;
    align-items: stretch; justify-content: flex-end;
    background: var(--navy); position: relative;
  }
  .kcrm-login-panel::before {
    content: '';
    position: absolute; inset: 0;
    background:
      radial-gradient(ellipse 80% 45% at 50% 0%, rgba(37,99,235,.28) 0%, transparent 60%),
      radial-gradient(ellipse 50% 35% at 85% 15%, rgba(14,165,233,.1) 0%, transparent 55%);
    pointer-events: none;
  }
  /* Brand label top centre */
  .kcrm-login-panel::after {
    content: 'KASALOMA CRM';
    position: absolute; top: 42px; left: 50%;
    transform: translateX(-50%);
    font-family: 'Inter', sans-serif;
    font-size: 10px; font-weight: 700;
    color: rgba(255,255,255,.28);
    letter-spacing: 3px; white-space: nowrap;
    pointer-events: none;
  }
  .kcrm-login-card {
    position: relative; z-index: 2;
    max-width: 100%; width: 100%; margin: 0;
    border-radius: 24px 24px 0 0;
    background: var(--bg-right);
    box-shadow: 0 -8px 40px rgba(0,0,0,.22);
    padding: 8px 22px 36px;
    padding-bottom: max(36px, env(safe-area-inset-bottom, 20px));
    animation: kSlideUp .34s cubic-bezier(.34,1.2,.64,1) both;
  }
  @keyframes kSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .kcrm-login-card::before {
    content: '';
    display: block; width: 36px; height: 4px;
    background: #CBD5E1; border-radius: 2px;
    margin: 0 auto 20px;
  }
  .kcrm-login-box-logo-link { margin-bottom: 20px; }
  .kcrm-login-card-top h2 { font-size: 21px; }
  .kcrm-input-shell input { height: 50px; font-size: 16px; }
  .kcrm-login-submit { min-height: 52px; font-size: 15px; }
  .kcrm-login-row { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 18px; }
  input[inputmode="numeric"] {
    font-size: 22px !important;
    letter-spacing: 5px; text-align: center; height: 58px !important;
  }
}
