
html, body {
  margin: 0;
  background: radial-gradient(circle at top, #0c1a2b, #020a14);
  color: #eafff1;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  background: linear-gradient(180deg, #081627, #040c16);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo {
  position: absolute;
  left: 20px;
  font-size: 28px;
}

.title {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
}

.user {
  position: absolute;
  right: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: #eafff1;
  padding: 6px 12px;
  border-radius: 8px;
}

.container {
  padding: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.card {
  background: linear-gradient(180deg, #071423, #030a13);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  margin: 6px 0 16px;
  border-radius: 10px;
  /* White fields with black text for readability on all programs */
  background: #ffffff !important;
  color: #0b1220 !important;
  border: 1px solid rgba(37, 208, 125, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.03) inset;
}

input::placeholder,
textarea::placeholder {
  color: rgba(20, 35, 55, 0.45) !important;
}

option {
  background: #ffffff !important;
  color: #0b1220 !important;
}

select {
  appearance: auto;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(37, 208, 125, 0.95) !important;
  box-shadow: 0 0 0 4px rgba(37, 208, 125, 0.18) !important;
}

/* Fix browser autofill colors (Chrome/Edge) */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #0b1220 !important;
  transition: background-color 9999s ease-out 0s;
  box-shadow: 0 0 0px 1000px #ffffff inset !important;
}

.actions {
  display: flex;
  gap: 12px;
}

button.primary {
  background: linear-gradient(180deg, #2e7d32, #1b5e20);
  border: none;
  color: #eafff1;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
}

button.secondary {
  background: transparent;
  border: 1px solid rgba(80,200,120,0.6);
  color: #eafff1;
  padding: 10px 16px;
  border-radius: 10px;
}

/* Extra suite-wide coverage */
:root{ --bp-input-bg: rgba(43,103,63,0.95); --bp-input-text:#eafff3; }

select option{ background: rgba(10,22,38,0.98) !important; color: var(--bp-input-text) !important; }

input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus,
textarea:-webkit-autofill, select:-webkit-autofill{
  -webkit-text-fill-color: var(--bp-input-text) !important;
  transition: background-color 9999s ease-in-out 0s !important;
  box-shadow: 0 0 0px 1000px var(--bp-input-bg) inset !important;
}

label, .label, .fieldLabel{ color: rgba(234,255,243,0.92) !important; }

/* =========================================================
   GLOBAL FIELD READABILITY OVERRIDE
   Goal: any light/white field must have DARK text so typed
   characters + dropdown options are always readable.
   This is intentionally strong (uses !important) because the
   suite mixes many inline/section styles.
   ========================================================= */
:root{
  --bp-field-bg: #ffffff;
  --bp-field-text: #0b1220;
  --bp-field-placeholder: rgba(11,18,32,.55);
}

/* Make all form fields white with black text (matches the target layout) */
input,
textarea,
select,
.bp-input,
.bp-textarea,
.bp-select,
[data-field],
[contenteditable="true"]{
  background-color: var(--bp-field-bg) !important;
  color: var(--bp-field-text) !important;
  caret-color: var(--bp-field-text) !important;
}

/* Ensure inner text nodes in contenteditable regions are dark */
[contenteditable="true"] *{
  color: var(--bp-field-text) !important;
}

input::placeholder,
textarea::placeholder{
  color: var(--bp-field-placeholder) !important;
  opacity: 1 !important;
}

/* Select dropdown menu options */
select option,
select optgroup{
  background-color: #ffffff !important;
  color: var(--bp-field-text) !important;
}

/* WebKit autofill fix (Chrome/Edge) so autofill isn't white-on-white or neon) */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill{
  -webkit-text-fill-color: var(--bp-field-text) !important;
  caret-color: var(--bp-field-text) !important;
  transition: background-color 9999s ease-in-out 0s;
  box-shadow: 0 0 0px 1000px #ffffff inset !important;
}

/* Date/time pickers in some browsers */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"]{
  color-scheme: light;
}


/* FIX122: clean header layout + correct auth + emblem size/position */
.headerTopBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 20px;
  gap: 16px;
}
.headerLeftAuth{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 0 0 auto;
}
.headerCenterBrand{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}
.headerTitle{
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 28px;
  color: #eaf4ff;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
  white-space: nowrap;
}
.headerEmblem{
  width: 34px !important;
  height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  object-fit: contain !important;
  display:block;
}
/* Prevent any oversized emblem image from affecting layout */
img[src*="brand_emblem"]{
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
  object-fit: contain;
}

/* Keep existing auth row left-aligned, hide username label */
.authRow{ justify-content:flex-start !important; }
#acc_name{ display:none !important; }


/* FIX125: Mobile responsiveness */
@media (max-width: 900px){
  .appShell, .container, .main, .mainContent{ 
    width: 100% !important; 
    max-width: 100% !important; 
    padding-left: 12px !important; 
    padding-right: 12px !important;
  }
}

/* Header: stack nicely on mobile */
@media (max-width: 720px){
  .headerTopBar{
    padding: 10px 12px !important;
    flex-wrap: wrap;
    gap: 10px !important;
  }
  .headerLeftAuth{
    order: 1;
    width: 100%;
    justify-content: flex-start;
  }
  .headerCenterBrand{
    order: 2;
    width: 100%;
    justify-content: center;
  }
  .headerTitle{
    font-size: 22px !important;
  }
  .headerEmblem{
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
  }
}

/* Auth/register/login card: make single-column on mobile */
@media (max-width: 720px){
  .authModal, .authPanel, .authWrap, .authContainer{
    width: 100% !important;
    max-width: 100% !important;
  }
  .authShell, .authGrid, .authColumns, .twoCol, .split, .registerGrid{
    grid-template-columns: 1fr !important;
    display: grid !important;
    gap: 12px !important;
  }
  .authCard, .authCardLeft, .authCardRight, .authLeft, .authRight{
    width: 100% !important;
  }
  /* Buttons: touch friendly */
  .authRow button, .headerLeftAuth button, .pill, .btn{
    min-height: 44px;
  }
}

/* Forms: inputs full width on mobile */
@media (max-width: 720px){
  input, select, textarea{
    width: 100% !important;
    box-sizing: border-box;
  }
  .formRow, .row, .fieldRow{
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
}

/* Center panel spacing */
@media (max-width: 720px){
  .modalContent, .panel, .card, .glassCard{
    margin: 0 auto !important;
  }
  .modalContent{
    padding: 14px !important;
  }
}


/* FIX126: Mobile sidebar button + logo reliability */
#bpDogMenuBtn .bpMenuIcon{
  font-size: 28px;
  line-height: 1;
  color: #eaf4ff;
  font-weight: 800;
  user-select: none;
}

#bpDogMenuBtn{background: rgba(255,255,255,0.10) !important; border:1px solid rgba(255,255,255,0.18) !important;}

/* Sidebar usability on mobile */
@media (max-width: 720px){
  #bpSidebar{
    width: min(86vw, 360px) !important;
    max-width: 360px !important;
  }
  #bpSidebar.open{
    transform: translateX(0) !important;
  }
}

/* Ensure header logo stays visible */
.headerCenterBrand{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:10px !important;
}
.headerEmblem{
  display:inline-block !important;
  object-fit: contain !important;
}

/* FIX127: Mobile header layout (hamburger left, auth right, emblem centered) */
@media (max-width: 720px){
  .headerTopBar{
    position: relative;
    padding-left: 74px !important; /* room for hamburger */
    padding-right: 16px !important;
  }
  .headerLeftAuth{
    position: absolute;
    right: 12px;
    top: 10px;
    width: auto !important;
    justify-content: flex-end !important;
  }
  .headerCenterBrand{
    width: 100% !important;
    justify-content: center !important;
  }
  .headerCenterBrand .headerTitle{
    text-align: center;
  }
}
