:root {
  --default-font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  font-family: var(--default-font-family);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Dashboard logo ~30% smaller */
.authentication-cover-content img[src*="trust-originality-logo.svg"] {
  max-width: 70%;
  width: auto;
  height: auto;
  max-height: 2.625rem;
  display: block;
  margin-inline: auto;
}

/* Header & sidebar: scale SVG logo proportionally */
.app-header .horizontal-logo .header-logo img[src*="trust-originality-logo.svg"],
.app-sidebar .main-sidebar-header .header-logo img[src*="trust-originality-logo.svg"] {
  width: auto;
  height: auto;
  max-height: 2rem;
  object-fit: contain;
}

@media (max-width: 991.98px) {
  .app-header .horizontal-logo .header-logo img[src*="trust-originality-logo.svg"] {
    max-height: 1.75rem;
    height: 1.75rem;
    width: auto;
  }
}

#mainHeaderProfile .header-link-icon i {
  line-height: 1;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--custom-white, #fff);
  border: 1px solid var(--default-border, rgba(0, 0, 0, 0.1));
  border-radius: 8px;
  color: var(--default-text-color, #333);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  min-width: 118px;
  min-height: 36px;
  height: auto;
  padding: 7px 32px 9px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lang-select option {
  font-size: 14px;
  line-height: 1.35;
}

.lang-select:hover,
.lang-select:focus {
  border-color: rgb(var(--primary-rgb, 152, 95, 253));
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 152, 95, 253), 0.15);
  outline: none;
}

.header-element.header-language {
  display: flex;
  align-items: center;
}

.login-lang-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

/* Mobile app promo */
.mobile-app-promo-alert {
  background: linear-gradient(135deg, rgba(36, 56, 141, 0.08), rgba(112, 34, 131, 0.08));
}
.mobile-app-promo-favicon {
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(36, 56, 141, 0.15);
}
.panel-app-store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.panel-app-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: var(--custom-white, #fff);
  border: 1px solid var(--default-border, rgba(0, 0, 0, 0.08));
  font-size: 0.78rem;
}
.panel-app-store-badge i {
  font-size: 1.25rem;
}
.panel-app-store-badge span {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.panel-app-store-badge em {
  font-style: normal;
  font-size: 0.65rem;
  color: #b45309;
  font-weight: 700;
}
a.panel-app-store-badge {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
a.panel-app-store-badge:hover {
  border-color: rgba(36, 56, 141, 0.35);
  box-shadow: 0 4px 12px rgba(36, 56, 141, 0.12);
}
.mobile-app-promo--compact {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}
.authentication-cover-content .mobile-app-promo--compact {
  text-align: left;
}
.mobile-app-promo--compact .mobile-app-promo-icon img {
  border-radius: 10px;
}

.side-menu__item--locked {
  opacity: 0.72;
}

.side-menu__item--locked .side-menu__label::after {
  content: "";
}

/* Panel auth pages (login, register, password reset) — mobile layout */
body.auth-page {
  margin-bottom: 0;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

body.auth-page .authentication.authentication-cover-main {
  min-height: 100dvh;
  padding-top: calc(3.25rem + env(safe-area-inset-top, 0));
  padding-inline: max(0.75rem, env(safe-area-inset-right, 0)) max(0.75rem, env(safe-area-inset-left, 0));
}

body.auth-page .login-lang-switch {
  top: max(0.75rem, env(safe-area-inset-top, 0));
  right: max(0.75rem, env(safe-area-inset-right, 0));
}

[dir="rtl"] body.auth-page .login-lang-switch {
  right: auto;
  left: max(0.75rem, env(safe-area-inset-left, 0));
}

body.auth-page .authentication .row.align-items-center.h-100 {
  min-height: auto;
  height: auto !important;
}

body.auth-page .card.custom-card {
  margin-block: 0.5rem 1.5rem !important;
}

body.auth-page .card.custom-card .card-body {
  padding: 1.25rem !important;
}

@media (min-width: 576px) {
  body.auth-page .card.custom-card .card-body {
    padding: 2rem !important;
  }
}

@media (min-width: 992px) {
  body.auth-page .authentication.authentication-cover-main {
    padding-top: 0;
    padding-inline: 0;
  }

  body.auth-page .card.custom-card {
    margin-block: 1.5rem !important;
  }

  body.auth-page .card.custom-card .card-body {
    padding: 3rem !important;
  }
}

body.auth-page .form-control {
  font-size: 16px;
}

body.auth-page .lang-select {
  font-size: 14px;
  line-height: 1.35;
}

body.auth-page .auth-mobile-logo {
  display: block;
  margin-inline: auto;
  max-width: min(220px, 72vw);
  max-height: 2.75rem;
  width: auto;
  height: auto;
}

@media (max-width: 1199.98px) {
  body.auth-page .login-lang-switch {
    position: static;
    display: flex;
    justify-content: flex-end;
    padding: max(0.75rem, env(safe-area-inset-top, 0)) max(0.75rem, env(safe-area-inset-right, 0)) 0
      max(0.75rem, env(safe-area-inset-left, 0));
    margin-bottom: 0.25rem;
  }

  body.auth-page .authentication.authentication-cover-main {
    padding-top: 0;
  }
}

body.auth-page .auth-options-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

@media (min-width: 420px) {
  body.auth-page .auth-options-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
}

body.auth-page .auth-forgot-link {
  font-size: 0.75rem;
  white-space: nowrap;
}

body.auth-page .btn-primary,
body.auth-page .btn-outline-dark,
body.auth-page form .btn[type="submit"],
body.auth-page .d-grid .btn {
  min-height: 44px;
  padding-block: 0.65rem;
  line-height: 1.25;
}

body.auth-page .btn-outline-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: normal;
  line-height: 1.3;
  padding-inline: 1rem;
}

body.auth-page .authentication.authentication-cover-main .show-password-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.auth-page #captchaSection .d-flex {
  align-items: stretch;
}

body.auth-page #captchaSection .form-control {
  flex: 1 1 8rem;
  min-width: 0;
}

@media (max-width: 399.98px) {
  body.auth-page #captchaSection .d-flex {
    flex-direction: column;
    align-items: stretch !important;
  }

  body.auth-page #captchaQuestion {
    margin-bottom: 0.25rem;
  }
}

body.auth-page .g-recaptcha {
  transform-origin: 0 0;
  max-width: 100%;
}

@media (max-width: 400px) {
  body.auth-page .g-recaptcha {
    transform: scale(0.92);
  }
}

/* Logged-in panel — mobile layout */
@media (max-width: 991.98px) {
  body {
    margin-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .page {
    overflow-x: clip;
  }

  .main-content.app-content {
    padding: 0.75rem;
  }

  .page-container.main-body-container {
    padding-inline: 0;
  }

  .main-header-container.container-fluid {
    padding-inline: 0.65rem;
    gap: 0.25rem;
  }

  .header-content-left,
  .header-content-right {
    min-width: 0;
  }

  .header-content-right {
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .header-element.header-language .lang-select {
    min-width: 96px;
    max-width: 112px;
    font-size: 14px;
    line-height: 1.35;
    min-height: 34px;
    padding: 6px 26px 8px 8px;
  }

  .app-header .header-link,
  #mainHeaderProfile .header-link {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .page-header-breadcrumb .d-flex {
    align-items: center;
    gap: 0.35rem;
  }

  .page-header-breadcrumb .page-title {
    overflow-wrap: anywhere;
    line-height: 1.35;
  }

  .nft-main-banner-card h2 {
    overflow-wrap: anywhere;
    font-size: clamp(1.25rem, 5vw, 1.75rem);
  }

  #analysis-trend-chart,
  #analysis-type-chart {
    min-width: 0;
    overflow: hidden;
  }

  .card.custom-card > .card-header.d-flex,
  .card.custom-card > .card-header.justify-content-between {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .card.custom-card > .card-header.d-flex .btn,
  .card.custom-card > .card-header.justify-content-between .btn {
    width: 100%;
  }

  .card.custom-card > .card-header .btn {
    min-height: 44px;
  }

  .table.table-hover.text-nowrap td,
  .table.table-hover.text-nowrap th {
    white-space: normal;
  }

  .compliance-audit-header {
    flex-direction: column;
    align-items: stretch !important;
  }

  .compliance-audit-header .form-control,
  .compliance-audit-header .btn {
    width: 100%;
  }

  .compliance-audit-header input[type="date"] {
    min-width: 0;
  }

  .card.custom-card pre {
    overflow-x: auto;
    max-width: 100%;
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .card.custom-card .input-group {
    flex-wrap: wrap;
  }

  .card.custom-card .input-group .form-control {
    min-width: 0;
    flex: 1 1 12rem;
  }

  .card.custom-card .input-group .btn {
    width: 100%;
    margin-top: 0.35rem;
    min-height: 44px;
  }

  .card-footer.text-end {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .card-footer.text-end .btn {
    width: 100%;
    min-height: 44px;
    margin: 0 !important;
  }

  .card-body .d-flex.justify-content-end {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .card-body .d-flex.justify-content-end .btn {
    min-height: 44px;
  }

  .table td.font-monospace,
  .table td code,
  .card-body h7,
  .list-group-item .text-muted.fs-13 {
    word-break: break-all;
    white-space: normal;
  }

  .panel-activity-log td:last-child .btn-sm,
  .panel-activity-log td:nth-last-child(2) .btn-sm {
    display: block;
    width: 100%;
    margin: 0.2rem 0 !important;
    min-height: 40px;
  }

  .panel-activity-log td:last-child,
  .panel-activity-log td:nth-last-child(2) {
    min-width: 9rem;
    white-space: normal;
  }

  .table td .btn-sm {
    min-height: 40px;
  }

  .alert.d-flex:not(.flex-column) {
    flex-direction: column;
  }

  .alert.d-flex .btn {
    width: 100%;
    white-space: normal !important;
    margin-top: 0.35rem;
  }

  .card.custom-card > .card-body {
    padding: 1rem;
  }

  .card.custom-card > .card-header {
    padding: 0.85rem 1rem;
  }

  .nft-main-banner-card .btn-list .btn-lg {
    width: 100%;
    min-height: 44px;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  .upgrade-actions,
  .d-flex.flex-wrap.gap-2.mt-4 {
    flex-direction: column;
    align-items: stretch;
  }

  .upgrade-actions .btn,
  .d-flex.flex-wrap.gap-2.mt-4 .btn,
  .d-flex.flex-wrap.gap-2.mt-4 form {
    width: 100%;
  }

  .d-flex.flex-wrap.gap-2.mt-4 form .btn {
    width: 100%;
  }

  .footer .list-inline-item {
    display: inline-block;
    margin-bottom: 0.35rem;
  }
}

@media (max-width: 575.98px) {
  .header-element.header-language {
    display: none;
  }

  .page-header-breadcrumb .breadcrumb {
    width: 100%;
  }

  .page-header-breadcrumb .page-title {
    font-size: 1rem;
  }

  .card-body .d-flex.justify-content-end {
    flex-direction: column;
    align-items: stretch;
  }

  .card-body .d-flex.justify-content-end .btn {
    width: 100%;
  }

  .main-content.app-content {
    padding: 0.5rem;
  }
}

@media (max-width: 399.98px) {
  .header-element.header-search {
    margin-inline-end: 0;
  }
}