/* MML Club Management v4.1.4 — global form system and accessibility pass */
:root{
  --mml-form-bg:#0d100e;
  --mml-form-bg-hover:#121713;
  --mml-form-border:#394239;
  --mml-form-border-focus:#8cff1a;
  --mml-form-text:#ffffff;
  --mml-form-muted:#b8c0ba;
  --mml-form-placeholder:#7f8982;
  --mml-positive:#8cff1a;
  --mml-negative:#ff625a;
  --mml-caution:#ffbd3e;
}

/* Make native controls consistently dark and readable. */
:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card,.extension-dialog){
  color-scheme:dark;
}

:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card,.extension-dialog)
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea){
  width:100%;
  min-height:42px;
  border:1px solid var(--mml-form-border)!important;
  border-radius:9px!important;
  background:var(--mml-form-bg)!important;
  color:var(--mml-form-text)!important;
  caret-color:var(--mml-neon,#8cff1a);
  box-shadow:none!important;
  -webkit-text-fill-color:var(--mml-form-text)!important;
}

:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card,.extension-dialog)
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea):hover{
  background:var(--mml-form-bg-hover)!important;
  border-color:#566156!important;
}

:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card,.extension-dialog)
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea):focus,
:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card,.extension-dialog)
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea):focus-visible{
  outline:2px solid color-mix(in srgb,var(--mml-form-border-focus) 75%,transparent)!important;
  outline-offset:2px;
  border-color:var(--mml-form-border-focus)!important;
}

::placeholder{color:var(--mml-form-placeholder)!important;opacity:1}
select option,select optgroup{background:#101310!important;color:#fff!important}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator{filter:invert(1);opacity:.85}
input[type="file"]{padding:6px!important}
input[type="file"]::file-selector-button{
  min-height:30px;margin-right:10px;border:1px solid #536053;border-radius:7px;
  background:#1b211b;color:#fff;font-weight:800;cursor:pointer
}
input[type="checkbox"],input[type="radio"]{accent-color:var(--mml-neon,#8cff1a)}

/* Labels, help text, headings and validation messages. */
:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card,.extension-dialog)
:where(label,legend,h1,h2,h3,h4,h5,h6,strong,b){color:#fff!important}
:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card,.extension-dialog)
:where(.note,.hint,small,.help-text,.field-help,.auth-card__intro){color:var(--mml-form-muted)!important}
:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card,.extension-dialog) .field label{
  color:#eef3ee!important;font-size:12px;font-weight:850
}

/* Panels and dialogs must never fall back to the legacy white theme. */
.beta-content :where(.panel,.modal-card,.extension-dialog,.dashboard-customizer-card),
.squad-beta2-add :where(.panel,.manual-player-panel,.player-add-method),
dialog.extension-dialog,
.modal-card{
  background:linear-gradient(180deg,#151915 0%,#0d100e 100%)!important;
  color:#fff!important;
  border:1px solid #343d34!important;
}
.modal,.dashboard-customizer{background:rgba(0,0,0,.78)!important;backdrop-filter:blur(5px)}
dialog::backdrop{background:rgba(0,0,0,.78)!important;backdrop-filter:blur(5px)}

/* Add-player experience: force every inherited legacy element into the dark system. */
.add-player-panel{
  background:linear-gradient(180deg,#151915 0%,#0b0e0c 100%)!important;
  color:#fff!important;border-color:#465246!important;
  box-shadow:0 18px 48px rgba(0,0,0,.32)
}
.add-player-panel :where(h3,h4,label,p,span,div){color:inherit}
.add-player-panel .note,.add-player-panel .hint{color:#c5cdc6!important}
.add-player-panel .player-add-method{
  margin-top:14px;padding:16px;border:1px solid #343d34;border-radius:12px;background:#101410!important
}
.add-player-panel .manual-player-toggle{margin-top:14px}
.add-player-panel .manual-player-panel{
  margin-top:14px;padding:16px;border:1px dashed #657165!important;border-radius:12px;background:#101410!important
}
.add-player-panel .manual-player-grid{gap:12px 16px}
.add-player-panel button.primary{background:var(--mml-neon,#8cff1a)!important;color:#071000!important;border-color:transparent!important}
.add-player-panel button.ghost{background:#161b17!important;color:#fff!important;border:1px solid #4a554b!important}

/* Unified buttons. */
:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card)
button.primary,
:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card)
.primary-button{
  background:var(--mml-neon,#8cff1a)!important;color:#071000!important;border:1px solid transparent!important;font-weight:900
}
:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card)
button.ghost,
:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card)
.secondary-button{
  background:#171b18!important;color:#fff!important;border:1px solid #485249!important
}
:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card)
button.danger,
:where(.beta-content,.admin-body,.auth-shell,.landing-page,dialog,.modal,.modal-card)
.remove-player{
  background:#331312!important;color:#ffdad7!important;border:1px solid #913c37!important
}
button:focus-visible,a:focus-visible,summary:focus-visible{
  outline:3px solid var(--mml-neon,#8cff1a)!important;outline-offset:3px
}

/* Tables: readable controls and cells in every management screen. */
.beta-content :where(.table-wrap,.club-table,.squad-table-wrap){background:#0c0f0d!important;border-color:#303830!important}
.beta-content table :where(th,td){color:#f7faf7!important;border-color:#2e352f!important}
.beta-content table th{background:#171b18!important;color:#fff!important}
.beta-content table tbody tr{background:#0e110f!important}
.beta-content table tbody tr:nth-child(even){background:#121612!important}
.beta-content table tbody tr:hover{background:#1a211a!important}
.beta-content table input,.beta-content table select{background:#090c0a!important;color:#fff!important;-webkit-text-fill-color:#fff!important}

/* Semantic colours shared by dashboards, finance, forms and tables. */
:where(.positive,.value-positive,.money-positive,.sale-net-positive,.success-text,.status-positive){color:var(--mml-positive)!important}
:where(.negative,.value-negative,.money-negative,.sale-net-negative,.danger-text,.status-negative){color:var(--mml-negative)!important}
:where(.warning,.warn,.warning-text,.status-warning,.deadline-warning){color:var(--mml-caution)!important}
.badge.ok{background:rgba(140,255,26,.12)!important;color:var(--mml-positive)!important;border:1px solid rgba(140,255,26,.35)}
.badge.bad{background:rgba(255,98,90,.12)!important;color:#ff8d86!important;border:1px solid rgba(255,98,90,.35)}
.badge.warn{background:rgba(255,189,62,.12)!important;color:#ffd06d!important;border:1px solid rgba(255,189,62,.35)}

/* Validation and disabled/read-only states stay legible. */
input:disabled,select:disabled,textarea:disabled,input[readonly]{opacity:.78!important;color:#d5dbd6!important;-webkit-text-fill-color:#d5dbd6!important;background:#171a18!important}
[aria-invalid="true"],.field-error input,.field-error select{border-color:var(--mml-negative)!important}
.error,.form-error,.auth-message.is-error{color:#ff8d86!important}
.success,.form-success,.auth-message.is-success{color:var(--mml-positive)!important}

@media(max-width:760px){
  .add-player-panel,.modal-card,.extension-dialog{padding:15px!important}
  .manual-player-grid{grid-template-columns:1fr!important}
  :where(.beta-content,.admin-body,dialog,.modal-card) :where(input,select,textarea,button){font-size:16px}
}
