/* =====================================================
   IPCRM Login – Custom Styles
   ===================================================== */

@font-face {
  font-family: 'IPACCTFONT';
  src: url('ipacct.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.font-ipacct,
.ipcrm-brand-text-inner,
.ipacct-logo-big {
  font-family: 'IPACCTFONT', 'Arial Black', system-ui, sans-serif;
  letter-spacing: 0.02em;
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ---------- Body ---------- */
.loginCont {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #f7f8fb;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* ---------- Login Card ---------- */
.login-card {
  display: flex;
  flex-direction: column;
  max-width: 1020px;
  width: 100%;
  background: white;
  border-radius: 1.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
  overflow: hidden;
  min-height: 460px;
}
@media (min-width: 768px) { .login-card { flex-direction: row; } }

/* ---------- Left Panel ---------- */
.left-panel {
  background: linear-gradient(160deg, #035699 0%, #023d6e 55%, #022d52 100%);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  width: 100%;
}
@media (min-width: 768px) { .left-panel { width: 42%; padding: 3rem 2.5rem; } }

/* Decorative circles */
.deco-circle { position: absolute; border-radius: 50%; pointer-events: none; }
.dc-1 { width:200px; height:200px; top:-70px;    right:-70px; background:rgba(255,255,255,0.08); }
.dc-2 { width:240px; height:240px; bottom:-90px; left:-80px;  background:rgba(255,255,255,0.06); }
.dc-3 { width:100px; height:100px; top:45%;      right:10px;  background:rgba(255,255,255,0.06); }

/* ---------- White Logo Box ---------- */
.logo-white-box {
  width: 200px;
  height: 240px;
  background: white;
  border-radius: 1.75rem;
  box-shadow: 0 16px 48px rgba(0,0,0,0.35), 0 4px 14px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  z-index: 2;
  margin-bottom: 1.2rem;
}

.logo-img-container {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1rem 0.5rem 1rem;
  overflow: hidden;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform: scale(1.12);
  opacity: 1;
  transition: transform 0.35s ease;
}
.logo-img:hover { transform: scale(1.2); }

/* IPCRM brand text */
.ipcrm-brand-text-inner {
  font-size: 3.5rem;
  line-height: 1;
  letter-spacing: 1px;
  padding-bottom: 1rem;
  flex-shrink: 0;
}
.ipcrm-brand-text-inner .ip  { color: #035699; font-weight: 400; }
.ipcrm-brand-text-inner .crm { color: #cc0202; font-weight: 900; }

/* ---------- CRM Portal Text ---------- */
.crm-portal-text {
  color: rgba(255,255,255,0.9);
  font-weight: 900;
  font-size: 3rem;
  position: relative;
  z-index: 2;
  letter-spacing: -0.02em;
  margin-top: 0.6rem;
  margin-bottom: 2.4rem;
}

/* ---------- Feature Pills ---------- */
.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  position: relative;
  z-index: 2;
  margin-top: 0.8rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  backdrop-filter: blur(4px);
  transition: all 0.2s;
}
.pill:hover { background: rgba(255,255,255,0.18); color: white; }

.pill svg, .pill-icon {
  color: #a8d4f5;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.pill-sep {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,0.35);
  border-radius: 1px;
  flex-shrink: 0;
}

/* ---------- Right Panel ---------- */
.right-panel {
  padding: 2rem 1.75rem;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
}
@media (min-width: 768px) { .right-panel { width: 58%; padding: 2.5rem 2.5rem; } }

/* ---------- Form Headings ---------- */
.form-heading    { font-size: 1.5rem; font-weight: 800; color: #0f172a; margin-bottom: 0.25rem; }
.form-subheading { font-size: 0.875rem; color: #94a3b8; margin-bottom: 1.5rem; }

/* ---------- Tab Bar ---------- */
.tab-bar {
  display: flex;
  background: #f1f5f9;
  border-radius: 0.75rem;
  padding: 0.25rem;
  margin-bottom: 1.25rem;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.tab-btn {
  flex: 1;
  padding: 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  background: transparent;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.tab-active   { background: white !important; color: #1d4ed8 !important; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.tab-inactive { background: transparent; color: #64748b; }
.tab-btn:not(.tab-active):hover { color: #475569; }

/* ---------- Auth Badge ---------- */
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0369a1;
  margin-bottom: 1.1rem;
}

/* ---------- Form Fields ---------- */
.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.field-wrap {
  position: relative;
  margin-bottom: 1rem;
  max-width: 460px;
}

.input-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: #033566;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  color: #1e293b;
  transition: all 0.2s;
  font-family: inherit;
}
.form-input:focus {
  border-color: #035699;
  box-shadow: 0 0 0 3px rgba(3,86,153,0.12);
  background: white;
  outline: none;
}

.password-toggle {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #033566;
  padding: 0.2rem;
  display: flex;
  align-items: center;
}
.password-toggle:hover { color: #023d6e; }

/* ---------- Submit Button ---------- */
.btn-submit {
  width: 100%;
  max-width: 460px;
  padding: 0.9rem;
  background: linear-gradient(135deg, #035699 0%, #023d6e 100%);
  color: white;
  font-weight: 800;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(3,86,153,0.35);
  margin-bottom: 1.5rem;
}
.btn-submit:hover    { opacity: 0.92; transform: translateY(-1px); }
.btn-submit:active   { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---------- LCO Picker ---------- */
.lco-picker-wrap {
  background: #f0f9ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  max-width: 460px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.picker-title  { font-size: 0.75rem; font-weight: 700; color: #1e40af; }
.picker-reset  { font-size: 0.75rem; color: #64748b; background: none; border: none; text-decoration: underline; cursor: pointer; display: flex; align-items: center; gap: 0.25rem; }
.server-list   { display: flex; flex-direction: column; gap: 0.5rem; max-height: 140px; overflow-y: auto; }
.server-item   { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem; background: white; border: 1px solid #e0e7ff; border-radius: 0.5rem; cursor: pointer; transition: background 0.15s; }
.server-item:hover { background: #eef2ff; }

/* ---------- Footer ---------- */
.login-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  max-width: 460px;
  font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif;
  font-weight: 900;
  font-size: 1rem;
  color: #0f172a;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.ipacct-logo-big { font-size: 1.3rem; font-weight: 900; line-height: 1; }
.ipacct-blue { color: #035699; }
.ipacct-red  { color: #cc0202; }

/* ---------- Flash Messages ---------- */
.flash-messages { margin-bottom: 1rem; }
.flash-msg { padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.85rem; font-weight: 500; border: 1px solid; margin-bottom: 0.5rem; }
.flash-error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ---------- Spinner ---------- */
.spinner { display: inline-block; width: 1rem; height: 1rem; border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: white; animation: spin 0.8s linear infinite; margin-right: 0.25rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .logo-white-box         { width: 170px; height: 210px; }
  .ipcrm-brand-text-inner { font-size: 2.8rem; }
  .crm-portal-text        { font-size: 2rem; margin-bottom: 1.5rem; }
  .pill                   { font-size: 0.72rem; padding: 0.4rem 0.75rem; }
  .field-wrap             { max-width: 100%; }
  .btn-submit             { max-width: 100%; }
  .lco-picker-wrap        { max-width: 100%; }
  .login-footer           { max-width: 100%; }
  .right-panel            { padding: 2rem 1.25rem; }
}

/* =========================================================================
   NEW RULES – Right Panel Header (Welcome back + Company Logo)
   ========================================================================= */
.right-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Borderless logo – blends into the page, landscape/rectangular, auto‑scaling */
.company-logo-right {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    flex-shrink: 0;
}

.company-logo-right img {
    display: block;
    height: auto;
    width: auto;
    max-height: 72px;     /* larger, clearly visible */
    max-width: 260px;     /* landscape/rectangular */
    object-fit: contain;  /* preserves original aspect ratio */
}

/* "Add Logo" placeholder shown when no company logo is configured */
.company-logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 0.5rem;
    color: #94a3b8;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Tablet */
@media (max-width: 1024px) {
    .company-logo-right img { max-height: 60px; max-width: 200px; }
}

/* Mobile – stays beside the welcome text, scaled down */
@media (max-width: 640px) {
    .right-panel-header     { gap: 1rem; }
    .company-logo-right img { max-height: 48px; max-width: 140px; }
}