/**
 * BrickX design system — public, auth, user dashboard
 * Uses semantic tokens from color.php (:root --bx-*)
 */

/* ── Dropdowns (Bootstrap + public nav) ── */
#header .dropdown-menu,
.navbar .dropdown-menu {
  border: 1px solid var(--bx-border-default);
  border-radius: var(--bx-radius-md);
  background: var(--bx-surface-dropdown);
  box-shadow: var(--bx-shadow-dropdown), var(--bx-inset-highlight);
  backdrop-filter: blur(var(--bx-blur));
  -webkit-backdrop-filter: blur(var(--bx-blur));
  padding: 8px;
  min-width: 12rem;
}
#header .dropdown-item,
.navbar .dropdown-item {
  color: var(--bx-text-body) !important;
  border-radius: var(--bx-radius-xs);
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--bx-transition-fast), color var(--bx-transition-fast);
}
#header .dropdown-item:hover,
#header .dropdown-item:focus,
.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background: var(--bx-hover-surface) !important;
  color: var(--bx-text-on-dark) !important;
}
#header .dropdown-divider,
.navbar .dropdown-divider {
  border-color: var(--bx-border-muted);
  margin: 6px 0;
}
#header .dropdown-header,
.navbar .dropdown-header {
  color: var(--bx-text-subtle);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* User dashboard header (theme2) */
.header-inner-pages .dropdown-menu {
  border-radius: var(--bx-radius-md);
  border: 1px solid var(--bx-border-default);
  background: var(--bx-surface-dropdown);
  box-shadow: var(--bx-shadow-dropdown);
  padding: 8px;
}
.header-inner-pages .dropdown-item {
  color: var(--bx-text-body) !important;
  border-radius: var(--bx-radius-xs);
  padding: 0.5rem 0.95rem;
}
.header-inner-pages .dropdown-item:hover {
  background: var(--bx-hover-surface-strong) !important;
  color: var(--bx-text-on-dark) !important;
}

/* Selects — native & Bootstrap form-select */
.dashboard-body-part .form-control,
.dashboard-body-part .form-select,
.auth-section .form-control,
.auth-section .form-select {
  background: var(--bx-surface-input);
  border: 1px solid var(--bx-border-strong);
  border-radius: var(--bx-radius-sm);
  color: var(--bx-text-body);
  padding: 0.6rem 0.9rem;
  transition: border-color var(--bx-transition-fast), box-shadow var(--bx-transition-fast), background var(--bx-transition-fast);
}
.dashboard-body-part .form-control:focus,
.dashboard-body-part .form-select:focus,
.auth-section .form-control:focus,
.auth-section .form-select:focus {
  background: var(--bx-surface-input-focus);
  border-color: var(--main-color);
  box-shadow: var(--bx-focus-ring);
  color: var(--bx-text-on-dark);
}
.dashboard-body-part .form-select,
.auth-section .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px 10px;
}
.dashboard-body-part select option,
.auth-section select option {
  background: #0d1b2a;
  color: var(--bx-text-body);
}

/* Selectric plugin */
.selectric-wrapper {
  border-radius: var(--bx-radius-sm);
}
.selectric {
  background: var(--bx-surface-input);
  border: 1px solid var(--bx-border-strong);
  border-radius: var(--bx-radius-sm);
}
.selectric .label {
  color: var(--bx-text-body);
  font-size: 0.9rem;
}
.selectric .button {
  background: transparent;
  color: #cbd5e1;
}
.selectric-items {
  border: 1px solid var(--bx-border-default);
  border-radius: var(--bx-radius-sm);
  background: #0f1a28;
  box-shadow: var(--bx-shadow-card-hover);
}
.selectric-items li {
  color: var(--bx-text-body);
  font-size: 0.9rem;
}
.selectric-items li.highlighted,
.selectric-items li.selected {
  background: var(--main-a20);
  color: var(--bx-text-on-dark);
}
.selectric-items li:hover {
  background: var(--bx-hover-surface);
}

/* Auth pages */
.auth-section {
  overflow-x: hidden;
}
.auth-wrapper {
  border-radius: var(--bx-radius-2xl);
  overflow: hidden;
  box-shadow: var(--bx-shadow-auth), var(--bx-inset-highlight);
}
.auth-form-wrapper {
  background: var(--bx-surface-glass-soft);
  border-radius: var(--bx-radius-xl);
  padding: 1.75rem 1.5rem !important;
  border: 1px solid var(--bx-border-faint);
}
.auth-form-wrapper h3 {
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--bx-text-on-dark);
}
.auth-section label {
  color: var(--bx-text-label);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.auth-section .cmn-btn.w-100,
.auth-section .cmn-btn.btn-sm {
  border-radius: var(--bx-radius-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.auth-top-part .cmn-btn.btn-sm {
  border-radius: var(--bx-radius-xs);
}
.auth-footer-part {
  opacity: 0.85;
}

/* Auth layout: readable copy (avoid body-wide text-capitalize) */
html.brickx-auth-root,
body.brickx-auth-page {
  overflow-x: hidden;
  max-width: 100vw;
}
body.brickx-auth-page {
  text-transform: none;
  background: var(--body-bg, #0d1b2a);
  color: var(--bx-text-body);
}
body.brickx-auth-page #main.main-img {
  min-height: 100vh;
}
.brickx-auth-shell .auth-thumb-area {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(13, 27, 42, 0.95) 100%);
  border-left: 1px solid var(--bx-border-faint);
}
.brickx-auth-shell .auth-top-part .brickx-auth-switch-label {
  color: var(--bx-text-muted);
  font-size: 0.9rem;
}
.brickx-auth-subtitle {
  color: var(--bx-text-muted) !important;
  line-height: 1.45;
}
.brickx-auth-inline-link {
  color: var(--accent-light) !important;
  font-weight: 600;
  text-decoration: none;
}
.brickx-auth-inline-link:hover {
  color: var(--bx-text-on-dark) !important;
  text-decoration: underline;
}

/* Dashboard + profile shared section titles / page buttons */
.brickx-dashboard .brickx-section-title,
.brickx-profile-page .brickx-section-title {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--bx-text-on-dark);
}
.brickx-dashboard .brickx-btn-page,
.brickx-profile-page .brickx-btn-page {
  border-radius: var(--bx-radius-sm) !important;
  font-weight: 600 !important;
  box-shadow: 0 6px 20px var(--main-a20, rgba(26, 183, 68, 0.2));
  transition: transform 0.15s, filter 0.15s !important;
}
.brickx-dashboard .brickx-btn-page:hover,
.brickx-profile-page .brickx-btn-page:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Profile settings — image picker visibility */
.brickx-profile-page .img-choose-div > p {
  color: var(--bx-text-label);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.brickx-profile-page .img-choose-div .file-id-preview {
  border-radius: var(--bx-radius-md);
  border: 1px solid var(--bx-border-muted);
  box-shadow: var(--bx-shadow-card);
  max-height: 280px;
  object-fit: cover;
}
.brickx-profile-page .editImg {
  margin-top: 12px;
}

/* Home */
.brickx-home-shell {
  overflow-x: hidden;
}
.brickx-home-shell .embed-youtube {
  border-radius: var(--bx-radius-lg);
  overflow: hidden;
  box-shadow: var(--bx-shadow-card-hover);
  border: 1px solid var(--bx-border-faint);
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

/* Finance flows */
.brickx-finance-page .brickx-finance-hero {
  background: var(--bx-surface-glass);
  border: 1px solid var(--bx-border-default);
  border-radius: var(--bx-radius-xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}
.brickx-finance-page .brickx-finance-hero h1,
.brickx-finance-page .brickx-finance-hero .h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--bx-text-on-dark);
}
.brickx-finance-page .brickx-finance-hero p {
  margin: 0.35rem 0 0;
  color: var(--bx-text-muted);
  font-size: 0.88rem;
}
.brickx-finance-card {
  border-radius: var(--bx-radius-xl) !important;
  overflow: hidden;
  border: 1px solid var(--bx-border-muted) !important;
  background: var(--bx-surface-glass-soft) !important;
  box-shadow: var(--bx-shadow-card);
}
.brickx-finance-card .card-header {
  background: rgba(255, 255, 255, 0.04) !important;
  border-bottom: 1px solid var(--bx-border-muted) !important;
  padding: 1rem 1.25rem !important;
}
.brickx-finance-card .card-header h4,
.brickx-finance-card .card-header h5 {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--bx-text-on-dark);
}
.brickx-finance-card .card-body {
  padding: 1.25rem !important;
}
.brickx-kv {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: var(--bx-radius-md);
  overflow: hidden;
  border: 1px solid var(--bx-border-faint);
}
.brickx-kv li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--bx-border-hairline);
  color: var(--bx-text-body);
  font-size: 0.88rem;
}
.brickx-kv li:last-child {
  border-bottom: none;
}
.brickx-kv li span:first-child {
  color: var(--bx-text-muted);
  font-weight: 600;
}
.brickx-kv li span:last-child {
  text-align: right;
  font-weight: 700;
  color: var(--bx-text-on-dark);
}
.brickx-instruction-body {
  color: var(--bx-text-body);
  line-height: 1.65;
  font-size: 0.9rem;
}
.brickx-instruction-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--bx-radius-sm);
  margin-top: 12px;
  border: 1px solid var(--bx-border-muted);
}
.brickx-finance-page .cmn-btn {
  border-radius: var(--bx-radius-sm);
  font-weight: 700;
}

/* Public header CTA */
#header .btn-border,
#header .header-right .btn {
  border-radius: var(--bx-radius-pill) !important;
  font-weight: 700 !important;
  border: 2px solid rgba(255, 255, 255, 0.35) !important;
  transition: background var(--bx-transition), border-color var(--bx-transition), color var(--bx-transition),
    box-shadow var(--bx-transition);
}
#header .btn-border:hover,
#header .header-right .btn:hover {
  background: var(--main-color) !important;
  border-color: var(--main-color) !important;
  color: var(--bx-text-on-dark) !important;
  box-shadow: var(--bx-shadow-cta);
}

/* Home: plan cards */
.brickx-home-shell .invest-plan {
  border-radius: var(--bx-radius-lg);
  overflow: hidden;
  border: 1px solid var(--bx-border-faint);
  box-shadow: var(--bx-shadow-card);
  transition: transform var(--bx-transition), box-shadow var(--bx-transition);
}
.brickx-home-shell .invest-plan:hover {
  transform: translateY(-4px);
  box-shadow: var(--bx-shadow-card-hover);
}

/* Withdraw helper panel */
.brickx-withdraw-hint {
  min-height: 120px;
  color: var(--bx-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.brickx-withdraw-hint:empty::before {
  content: '';
}
