/* AkshAlgo brand chrome — icon-first; CSS wordmark; Upstox-style app tile. */

/*
 * Product primary = logo field teal (COLORS.md v1.1).
 * Overrides Metronic/Bootstrap blue so search strips, buttons, links,
 * and bg-primary-subtle match the brand in light and dark.
 */
:root,
[data-bs-theme="light"] {
  --ak-brand-field: #0B6B63;
  --ak-brand-bindu: #2DD4BF;
  --ak-brand-on-primary: #FFFFFF;

  --bs-primary: #0B6B63;
  --bs-primary-rgb: 11, 107, 99;
  --bs-primary-text-emphasis: #074840;
  --bs-primary-bg-subtle: #E6F4F2;
  --bs-primary-border-subtle: #A9D5D0;
  --bs-primary-active: #074840;
  --bs-primary-light: #E6F4F2;
  --bs-primary-inverse: #FFFFFF;
  --bs-primary-clarity: rgba(11, 107, 99, 0.18);
  --bs-text-primary: #0B6B63;
  --bs-component-active-bg: #0B6B63;
  --bs-component-hover-color: #0B6B63;
  --bs-component-checked-bg: #0B6B63;
  --bs-link-color: #0B6B63;
  --bs-link-color-rgb: 11, 107, 99;
  --bs-link-hover-color: #095A53;
  --bs-link-hover-color-rgb: 9, 90, 83;
  --bs-focus-ring-color: rgba(11, 107, 99, 0.25);
  --bs-menu-link-color-hover: #0B6B63;
  --bs-menu-link-color-show: #0B6B63;
  --bs-menu-link-color-here: #0B6B63;
  --bs-menu-link-color-active: #0B6B63;
  --bs-scrolltop-bg-color: #0B6B63;
  --bs-scrolltop-bg-color-hover: #095A53;
  --bs-ribbon-label-bg: #0B6B63;
  --bs-ribbon-label-border-color: #074840;
}

[data-bs-theme="dark"] {
  --ak-brand-field: #0B6B63;
  --ak-brand-bindu: #2DD4BF;
  --ak-brand-on-primary: #07090C;

  --bs-primary: #2DD4BF;
  --bs-primary-rgb: 45, 212, 191;
  --bs-primary-text-emphasis: #5EEAD4;
  --bs-primary-bg-subtle: #0C1F1D;
  --bs-primary-border-subtle: #1A5C55;
  --bs-primary-active: #5EEAD4;
  --bs-primary-light: #122826;
  --bs-primary-inverse: #07090C;
  --bs-primary-clarity: rgba(45, 212, 191, 0.22);
  --bs-text-primary: #2DD4BF;
  --bs-component-active-bg: #2DD4BF;
  --bs-component-hover-color: #2DD4BF;
  --bs-component-checked-bg: #2DD4BF;
  --bs-link-color: #2DD4BF;
  --bs-link-color-rgb: 45, 212, 191;
  --bs-link-hover-color: #5EEAD4;
  --bs-link-hover-color-rgb: 94, 234, 212;
  --bs-focus-ring-color: rgba(45, 212, 191, 0.3);
  --bs-menu-link-color-hover: #2DD4BF;
  --bs-menu-link-color-show: #2DD4BF;
  --bs-menu-link-color-here: #2DD4BF;
  --bs-menu-link-color-active: #2DD4BF;
  --bs-scrolltop-bg-color: #2DD4BF;
  --bs-scrolltop-bg-color-hover: #5EEAD4;
  --bs-ribbon-label-bg: #2DD4BF;
  --bs-ribbon-label-border-color: #0B6B63;
}

/* Side menu active pill — Metronic hardcodes #1B84FF here. */
.aside-menu .menu .menu-item .menu-link.active {
  background-color: var(--bs-primary) !important;
  color: var(--ak-brand-on-primary) !important;
}
.aside-menu .menu .menu-item .menu-link.active .menu-title,
.aside-menu .menu .menu-item .menu-link.active .menu-icon,
.aside-menu .menu .menu-item .menu-link.active .menu-icon .svg-icon,
.aside-menu .menu .menu-item .menu-link.active .menu-icon i {
  color: var(--ak-brand-on-primary) !important;
}
.aside-menu .menu .menu-item .menu-link.active .menu-bullet .bullet,
.aside-menu .menu .menu-item .menu-link.active .menu-arrow:after {
  background-color: var(--ak-brand-on-primary) !important;
}

/* Solid primary buttons: readable label on brand teal. */
.btn-primary {
  --bs-btn-color: var(--ak-brand-on-primary);
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-color: var(--ak-brand-on-primary);
  --bs-btn-hover-bg: var(--bs-primary-active);
  --bs-btn-hover-border-color: var(--bs-primary-active);
  --bs-btn-active-color: var(--ak-brand-on-primary);
  --bs-btn-active-bg: var(--bs-primary-active);
  --bs-btn-active-border-color: var(--bs-primary-active);
  --bs-btn-disabled-color: var(--ak-brand-on-primary);
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
}

html[data-bs-theme="dark"] .btn-primary {
  --bs-btn-hover-color: #07090C;
  --bs-btn-active-color: #07090C;
}

.ak-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none !important;
}

.ak-brand--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}

.ak-brand--stacked.ak-brand--center {
  align-items: center;
  text-align: center;
}

.ak-brand-mark {
  display: block;
  width: auto;
  height: 40px;
  object-fit: contain;
}

/* Solid teal square app tile (like Upstox) — CSS rounds corners */
.ak-brand-mark--app {
  height: 36px;
  width: 36px;
  border-radius: 8px;
}

.ak-brand-mark--app-lg {
  height: 88px;
  width: 88px;
  border-radius: 20px;
}

.ak-brand--stacked .ak-brand-mark:not(.ak-brand-mark--app-lg) {
  height: 88px;
}

.ak-brand-wordmark {
  font-family: Inter, Helvetica, "Segoe UI", Arial, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  /* Descenders (g) clip at line-height 1 when the box is overflow-hidden. */
  line-height: 1.35;
  color: #F5F7FA;
  white-space: nowrap;
}

.ak-brand-wordmark .ak-brand-algo {
  font-weight: 500;
  opacity: 0.88;
}

.ak-brand--stacked .ak-brand-wordmark {
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.ak-brand--on-light .ak-brand-wordmark,
.ak-brand-wordmark--ink {
  color: #111111;
}

.header-brand .ak-brand {
  gap: 0.625rem;
  min-width: 0;
}

.header-brand .ak-brand-mark--app {
  height: 34px;
  width: 34px;
  border-radius: 8px;
  flex-shrink: 0;
}

.header-brand .ak-brand-wordmark {
  font-size: 1rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 992px) {
  .header-brand .ak-brand-mark--app {
    height: 38px;
    width: 38px;
    border-radius: 9px;
  }

  .header-brand .ak-brand-wordmark {
    font-size: 1.0625rem;
  }
}

.header-section .ak-brand-mark--app {
  height: 36px;
  width: 36px;
  border-radius: 8px;
}

.header-section .ak-brand-wordmark {
  font-size: 1.125rem;
}

html[data-bs-theme="dark"] .header-section .ak-brand-wordmark,
html[data-bs-theme="dark"] .header-section .ak-brand-wordmark--ink {
  color: #F5F7FA;
}

/* Order / position detail: the close mark was a faint icon on a full-screen sheet. */
.btn.btn-icon.ak-detail-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: #f1416c;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(241, 65, 108, 0.28);
}

.btn.btn-icon.ak-detail-close:hover,
.btn.btn-icon.ak-detail-close:focus {
  background-color: #d9214e;
  color: #fff;
}

@media (max-width: 767.98px) {
  .drawer.drawer-on .btn.ak-detail-close {
    animation: ak-detail-close-in 1.4s ease-out 1;
  }
}

@keyframes ak-detail-close-in {
  0% {
    box-shadow: 0 0 0 0 rgba(241, 65, 108, 0.65);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(241, 65, 108, 0);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(241, 65, 108, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer.drawer-on .btn.ak-detail-close {
    animation: none;
  }
}

/* ---- Daily SEBI risk disclosure (TE + EN columns, shared scroll) ---- */
.ak-risk-modal {
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(7, 72, 64, 0.18);
}

.ak-risk-modal .modal-header {
  background:
    linear-gradient(180deg, rgba(11, 107, 99, 0.08) 0%, transparent 100%);
}

.ak-risk-kicker {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ak-brand-field, #0B6B63);
}

.ak-popup-off {
  display: none !important;
}

.ak-popup-dialog {
  width: calc(100% - 1.5rem);
  max-width: 36rem;
}

.ak-popup-lang {
  display: inline-flex;
  gap: 0.15rem;
  margin-bottom: 0.35rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(11, 107, 99, 0.08);
}

.ak-popup-lang button {
  border: 0;
  background: transparent;
  color: var(--bs-gray-700);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.ak-popup-lang button.is-active {
  background: var(--ak-brand-field, #0B6B63);
  color: #fff;
}

[data-bs-theme="dark"] .ak-popup-lang {
  background: rgba(45, 212, 191, 0.12);
}

[data-bs-theme="dark"] .ak-popup-lang button {
  color: #d7e8e4;
}

[data-bs-theme="dark"] .ak-popup-lang button.is-active {
  background: #0e7a70;
  color: #fff;
}

.ak-risk-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--bs-gray-900);
  position: relative;
  padding-bottom: 0.85rem;
}

.ak-risk-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2.5rem;
  height: 3px;
  border-radius: 999px;
  background: var(--ak-brand-field, #0B6B63);
  transform: translateX(-50%);
}

.ak-risk-modal .modal-body {
  padding-top: 0.5rem;
}

.ak-risk-scroll {
  max-height: min(52vh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 0.5rem 0.5rem;
}

.ak-risk-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.ak-risk-langs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem;
  align-items: start;
}

.ak-risk-lang + .ak-risk-lang {
  border-left: 1px solid var(--bs-gray-200);
  padding-left: 1.75rem;
}

.ak-risk-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bs-gray-900);
  margin: 0 0 0.75rem;
  line-height: 1.35;
}

.ak-risk-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--bs-gray-700);
  font-size: 0.875rem;
  line-height: 1.5;
}

.ak-risk-list li + li {
  margin-top: 0.65rem;
}

.ak-risk-modal .modal-footer .btn {
  font-weight: 700;
  letter-spacing: 0.01em;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

@media (max-width: 767.98px) {
  .ak-risk-title {
    font-size: 1.45rem;
  }

  .ak-risk-langs {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .ak-risk-lang + .ak-risk-lang {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--bs-gray-200);
    padding-top: 1.25rem;
  }

  .ak-risk-scroll {
    max-height: min(60vh, 480px);
  }
}

[data-bs-theme="dark"] .ak-risk-modal .modal-header {
  background:
    linear-gradient(180deg, rgba(45, 212, 191, 0.1) 0%, transparent 100%);
}

[data-bs-theme="dark"] .ak-risk-lang + .ak-risk-lang {
  border-left-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 767.98px) {
  [data-bs-theme="dark"] .ak-risk-lang + .ak-risk-lang {
    border-top-color: rgba(255, 255, 255, 0.1);
  }
}

/* Freeze label beside a strategy name on capital allocations. */
.ak-version-pill {
  display: inline-flex;
  align-items: center;
  background: var(--ak-brand-bindu, #2DD4BF);
  color: #042821;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  line-height: 1.2;
}

/* Holiday type badges inside the shared notice shell */
.ak-holiday-type {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  margin-right: 0.25rem;
  vertical-align: 0.1em;
  white-space: nowrap;
}

.ak-holiday-type--trading {
  color: #074840;
  background: rgba(11, 107, 99, 0.14);
}

.ak-holiday-type--settlement {
  color: #5e4200;
  background: rgba(255, 199, 0, 0.22);
}

.ak-holiday-type--special {
  color: #163a66;
  background: rgba(60, 130, 246, 0.16);
}

.ak-holiday-type--other {
  color: var(--bs-gray-700);
  background: var(--bs-gray-200);
}

.ak-holiday-exchanges {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--bs-gray-500);
  line-height: 1.35;
}

[data-bs-theme="dark"] .ak-holiday-type--trading {
  color: #99f6e4;
  background: rgba(45, 212, 191, 0.16);
}

[data-bs-theme="dark"] .ak-holiday-type--settlement {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.16);
}

[data-bs-theme="dark"] .ak-holiday-type--special {
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.16);
}

/* Demo account create modal */
.ak-demo-modal {
  border: 0;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(7, 9, 12, 0.18);
}

.ak-demo-modal .modal-header {
  background:
    linear-gradient(180deg, rgba(11, 107, 99, 0.1) 0%, transparent 100%);
}

.ak-demo-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bs-primary);
}

.ak-demo-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--bs-gray-900);
  line-height: 1.25;
}

.ak-demo-lead {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--bs-gray-600);
  max-width: 36rem;
}

.ak-demo-capital-input {
  border: 1px solid var(--bs-gray-300);
  border-radius: 0.85rem;
  overflow: hidden;
  background: var(--bs-body-bg);
}

.ak-demo-capital-input .input-group-text {
  border: 0;
  background: transparent;
  font-weight: 700;
  color: var(--bs-gray-700);
  padding-left: 1rem;
}

.ak-demo-capital-input .form-control {
  border: 0;
  background: transparent;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
  box-shadow: none !important;
}

.ak-demo-capital-input:focus-within {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px var(--bs-focus-ring-color);
}

.ak-demo-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.ak-demo-preset {
  appearance: none;
  border: 1px solid var(--bs-gray-300);
  background: var(--bs-body-bg);
  color: var(--bs-gray-700);
  border-radius: 999px;
  padding: 0.55rem 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ak-demo-preset:hover {
  border-color: var(--bs-primary-border-subtle);
  color: var(--bs-primary);
}

.ak-demo-preset.is-active {
  border-color: transparent;
  background: var(--bs-primary);
  color: var(--ak-brand-on-primary);
}

.ak-demo-points {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.ak-demo-points li {
  position: relative;
  padding-left: 1.35rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--bs-gray-700);
}

.ak-demo-points li + li {
  margin-top: 0.45rem;
}

.ak-demo-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--bs-primary);
  box-shadow: 0 0 0 3px var(--bs-primary-clarity);
}

.ak-demo-note {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--bs-gray-500);
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: var(--bs-gray-100);
}

.ak-demo-modal .modal-footer .btn {
  font-weight: 700;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

@media (max-width: 575.98px) {
  .ak-demo-title {
    font-size: 1.35rem;
  }

  .ak-demo-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

[data-bs-theme="dark"] .ak-demo-modal .modal-header {
  background:
    linear-gradient(180deg, rgba(45, 212, 191, 0.12) 0%, transparent 100%);
}

[data-bs-theme="dark"] .ak-demo-capital-input {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .ak-demo-preset {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--bs-gray-300);
}

[data-bs-theme="dark"] .ak-demo-note {
  background: rgba(255, 255, 255, 0.05);
  color: var(--bs-gray-400);
}

/* --------------------------------------------------------------------------
 * Auth split layout
 * Desktop: fixed teal brand rail (full viewport) + independent form scroll.
 * flex-start on the form panel so tall signup never clips at the top.
 * -------------------------------------------------------------------------- */
html:has(body.ak-auth-page) {
  height: auto;
  background: #F3F5F7;
}

body.ak-auth-page,
body#kt_body.ak-auth-page {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
  min-height: 100dvh;
  background: #F3F5F7 !important;
  overflow-x: hidden;
}

.ak-auth-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

.ak-auth-brand-panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 148px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 80% at 50% 45%, rgba(45, 212, 191, 0.34) 0%, transparent 60%),
    linear-gradient(160deg, #14978A 0%, #0B6B63 45%, #063F3B 100%);
}

.ak-auth-watermark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ak-auth-watermark img {
  display: block;
  width: min(42vw, 132px);
  height: min(42vw, 132px);
  object-fit: contain;
  opacity: 0.28;
}

.ak-auth-form-panel {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 1.75rem 1.25rem 2.75rem;
  background: #F3F5F7;
}

.ak-auth-card {
  width: 100%;
  max-width: 440px;
  margin: auto;
  padding: 2.25rem 2rem 2rem;
  border-radius: 1.25rem;
  background: #FFFFFF;
  box-shadow: 0 18px 48px rgba(7, 36, 33, 0.10);
}

.ak-auth-card--maintenance .ak-auth-subtitle {
  margin-bottom: 1.25rem;
}

.ak-auth-maintenance-window {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(11, 107, 99, 0.18);
  background: rgba(11, 107, 99, 0.06);
}

.ak-auth-maintenance-window-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0B6B63;
}

.ak-auth-maintenance-window-value {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #072421;
}

.ak-auth-maintenance-copy {
  margin: 0 0 1.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #6B7280;
}

@media (min-width: 992px) {
  .ak-auth-brand-panel {
    position: fixed;
    inset: 0 auto 0 0;
    width: 42%;
    height: 100vh;
    height: 100dvh;
  }

  .ak-auth-watermark img {
    width: min(26vw, 400px);
    height: min(26vw, 400px);
    opacity: 0.22;
  }

  .ak-auth-form-panel {
    margin-left: 42%;
    width: 58%;
    min-height: 100vh;
    min-height: 100dvh;
    /* flex-start + card margin:auto = center short forms, no top-clip on tall ones */
    align-items: flex-start;
    justify-content: center;
    padding: max(2.5rem, 5vh) 3rem;
  }
}

.ak-auth-form-brand {
  margin-bottom: 1.75rem;
}

.ak-auth-form-brand .ak-brand-wordmark {
  color: #0B6B63;
  text-shadow: none;
}

.ak-auth-title {
  margin: 0 0 0.4rem;
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #0B6B63;
}

.ak-auth-subtitle {
  margin: 0 0 1.75rem;
  max-width: 22rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: #6B7280;
  line-height: 1.45;
}

.ak-auth-label {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0B6B63;
}

.ak-auth-label-hint {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9CA3AF;
  letter-spacing: 0.01em;
}

.ak-auth-field {
  position: relative;
}

.ak-auth-field .form-control,
.ak-auth-card .form-control {
  height: 3.1rem;
  border-radius: 0.75rem;
  border-color: #D1D5DB;
  background: #FFFFFF;
}

.ak-auth-field .form-control {
  padding-left: 2.85rem;
}

.ak-auth-field .form-control.ak-auth-field--password {
  padding-right: 2.85rem;
}

.ak-auth-field-icon {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  pointer-events: none;
  line-height: 1;
}

.ak-auth-field-icon .ki-duotone {
  font-size: 1.35rem;
}

.ak-auth-field-toggle {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #9CA3AF;
  padding: 0.35rem;
  line-height: 1;
}

.ak-auth-field-toggle:hover {
  color: #0B6B63;
}

.ak-auth-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 0.35rem 0 1.5rem;
}

.ak-auth-submit {
  width: 100%;
  height: 3.15rem;
  border-radius: 0.8rem;
  font-weight: 700;
  font-size: 1rem;
}

.ak-auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.925rem;
  font-weight: 500;
  color: #6B7280;
}

.ak-auth-secure {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  color: #9CA3AF;
  font-size: 0.8rem;
  font-weight: 500;
}

.ak-auth-secure::before,
.ak-auth-secure::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(107, 114, 128, 0.35);
}

.ak-auth-secure strong {
  color: #0B6B63;
  font-weight: 700;
}

.ak-auth-terms {
  color: #4B5563;
  font-weight: 600;
}

/* Password-meter visibility control shares toggle placement with sign-in. */
.ak-auth-field [data-kt-password-meter-control="visibility"] {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  z-index: 2;
}

@media (max-width: 991.98px) {
  .ak-auth-watermark img {
    width: min(36vw, 110px);
    height: min(36vw, 110px);
  }
}

/* Auth — dark theme (respects app data-bs-theme / localStorage) */
html[data-bs-theme="dark"]:has(body.ak-auth-page) {
  background: #0B1214;
}

html[data-bs-theme="dark"] body.ak-auth-page,
html[data-bs-theme="dark"] body#kt_body.ak-auth-page {
  background: #0B1214 !important;
}

html[data-bs-theme="dark"] .ak-auth-form-panel {
  background: #0B1214;
}

html[data-bs-theme="dark"] .ak-auth-brand-panel {
  background:
    radial-gradient(ellipse 90% 80% at 50% 45%, rgba(45, 212, 191, 0.22) 0%, transparent 60%),
    linear-gradient(160deg, #0E7A70 0%, #074D48 48%, #041F1D 100%);
}

html[data-bs-theme="dark"] .ak-auth-card {
  background: #151C1E;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(45, 212, 191, 0.12);
}

html[data-bs-theme="dark"] .ak-auth-maintenance-window {
  border-color: rgba(45, 212, 191, 0.22);
  background: rgba(45, 212, 191, 0.08);
}

html[data-bs-theme="dark"] .ak-auth-maintenance-window-label {
  color: #5eead4;
}

html[data-bs-theme="dark"] .ak-auth-maintenance-window-value {
  color: #e5e7eb;
}

html[data-bs-theme="dark"] .ak-auth-maintenance-copy {
  color: #9ca3af;
}

html[data-bs-theme="dark"] .ak-auth-form-brand .ak-brand-wordmark {
  color: #E8F5F3;
}

html[data-bs-theme="dark"] .ak-auth-form-brand .ak-brand-wordmark .ak-brand-algo {
  color: #2DD4BF;
}

html[data-bs-theme="dark"] .ak-auth-title {
  color: #E8F5F3;
}

html[data-bs-theme="dark"] .ak-auth-subtitle {
  color: #9CA8A6;
}

html[data-bs-theme="dark"] .ak-auth-label {
  color: #2DD4BF;
}

html[data-bs-theme="dark"] .ak-auth-label-hint {
  color: #6B7876;
}

html[data-bs-theme="dark"] .ak-auth-field .form-control,
html[data-bs-theme="dark"] .ak-auth-card .form-control {
  border-color: #2A3534;
  background: #0F1618;
  color: #E8F5F3;
}

html[data-bs-theme="dark"] .ak-auth-field .form-control::placeholder,
html[data-bs-theme="dark"] .ak-auth-card .form-control::placeholder {
  color: #6B7876;
}

html[data-bs-theme="dark"] .ak-auth-field .form-control:focus,
html[data-bs-theme="dark"] .ak-auth-card .form-control:focus {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(45, 212, 191, 0.15);
}

html[data-bs-theme="dark"] .ak-auth-field-icon,
html[data-bs-theme="dark"] .ak-auth-field-toggle {
  color: #6B7876;
}

html[data-bs-theme="dark"] .ak-auth-field-toggle:hover {
  color: #2DD4BF;
}

html[data-bs-theme="dark"] .ak-auth-footer,
html[data-bs-theme="dark"] .ak-auth-terms {
  color: #9CA8A6;
}

html[data-bs-theme="dark"] .ak-auth-secure {
  color: #6B7876;
}

html[data-bs-theme="dark"] .ak-auth-secure::before,
html[data-bs-theme="dark"] .ak-auth-secure::after {
  background: rgba(156, 168, 166, 0.28);
}

html[data-bs-theme="dark"] .ak-auth-secure strong {
  color: #2DD4BF;
}

html[data-bs-theme="dark"] .ak-auth-card .form-check-input {
  background-color: #0F1618;
  border-color: #2A3534;
}

html[data-bs-theme="dark"] .ak-auth-card .form-check-input:checked {
  background-color: #0B6B63;
  border-color: #0B6B63;
}

.ak-upstox-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.4rem;
  border-radius: 999px;
  background: rgba(14, 122, 112, 0.12);
  color: #0E7A70;
  font-size: 0.8rem;
  font-weight: 700;
}

.ak-upstox-row + .ak-upstox-row {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(15, 23, 22, 0.08);
}

.ak-upstox-copy {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.6rem;
  background: #F4F7F6;
}

.ak-upstox-copy code {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: #14312E;
  font-size: 0.92rem;
  word-break: break-all;
}

.ak-upstox-copy .btn {
  flex: 0 0 auto;
}

.ak-upstox-why {
  margin: 0.55rem 0 0;
  color: #66706E;
  font-size: 0.92rem;
}

@media (min-width: 1200px) {
  .ak-upstox-form {
    position: sticky;
    top: 6rem;
  }
}

html[data-bs-theme="dark"] .ak-upstox-kicker {
  background: rgba(45, 212, 191, 0.14);
  color: #5eead4;
}

html[data-bs-theme="dark"] .ak-upstox-row + .ak-upstox-row {
  border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .ak-upstox-copy {
  background: rgba(255, 255, 255, 0.04);
}

html[data-bs-theme="dark"] .ak-upstox-copy code {
  color: #E8F5F3;
}

html[data-bs-theme="dark"] .ak-upstox-why {
  color: #9CA8A6;
}

.ak-upstox-linked-modal {
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
}

#ak_upstox_linked_modal .modal-dialog {
  max-width: 36rem;
}

.ak-upstox-linked-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
}

.ak-upstox-linked-head h2[lang="en"] {
  color: var(--bs-gray-600);
  font-size: 1.15rem;
}

.ak-upstox-linked-checks {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ak-upstox-check {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(15, 23, 22, 0.1);
  border-radius: 0.75rem;
  cursor: pointer;
}

.ak-upstox-check .form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.ak-upstox-check-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.ak-upstox-check > span {
  color: var(--bs-gray-800);
  line-height: 1.45;
}

.ak-upstox-linked-ack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  line-height: 1.3;
}

#ak_upstox_linked_ack:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

html[data-bs-theme="dark"] .ak-upstox-check {
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-bs-theme="dark"] .ak-upstox-linked-head h2[lang="en"] {
  color: #C5D4D1;
}

html[data-bs-theme="dark"] .ak-upstox-check > span {
  color: #E8F5F3;
}

.ak-broker-grid > [class*="col-"] {
  display: flex;
}

.ak-broker-grid > [class*="col-"] > .d-flex {
  flex: 1 1 auto;
  width: 100%;
}

.ak-demat-link {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}

/* Match content top pad so the last block does not sit on the footer. */
@media (min-width: 992px) {
  .content {
    padding-bottom: 30px;
  }
}
@media (max-width: 991.98px) {
  .content {
    padding-bottom: 15px;
  }
}

/*
 * Sticky app footer: short pages left #kt_footer mid-viewport because <main>
 * did not grow inside the Metronic column wrapper. Tall pages still scroll normally.
 */
body#kt_body:not(.ak-auth-page) > .flex-root,
body#kt_body:not(.ak-auth-page) > .flex-root > .page {
  min-height: 100vh;
  min-height: 100dvh;
}

#kt_wrapper {
  min-height: 100vh;
  min-height: 100dvh;
}

#kt_wrapper > main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#kt_wrapper > main > .content {
  flex: 1 0 auto;
}

#kt_footer {
  flex: 0 0 auto;
  margin-top: auto;
  width: 100%;
}
