/* =========================================================
   FOOTBALL MANAGER — DASHBOARD HERO
   Loaded last. Unique fm-hero classes prevent legacy conflicts.
========================================================= */

.fm-hero {
  position: relative;
  min-height: clamp(520px, 34vw, 660px);
  overflow: hidden;
  background-color: #06100c;
  background-image: var(--fm-hero-bg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 54%;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.fm-hero__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3,8,7,.02) 0%, rgba(3,8,7,.05) 46%, rgba(3,8,7,.74) 100%),
    linear-gradient(90deg, rgba(2,7,7,.34) 0%, rgba(2,7,7,.05) 35%, rgba(2,7,7,.04) 65%, rgba(2,7,7,.34) 100%);
}

/* Left block is anchored to the viewport edge, not a centered container. */
.fm-hero__team {
  position: absolute;
  z-index: 2;
  left: clamp(22px, 2.5vw, 44px);
  bottom: 34px;

  display: flex;
  align-items: center;
  gap: 20px;

  max-width: min(860px, calc(100vw - 520px));
  padding: 20px 26px 20px 20px;

  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(135deg, rgba(5,10,13,.90), rgba(5,10,13,.66));
  box-shadow: 0 20px 46px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(12px);
}

.fm-hero__logo {
  width: 100px;
  height: 100px;
  flex: 0 0 100px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.13);
  background: linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.035));
  box-shadow: 0 10px 28px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.08);
}

.fm-hero__logo img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 16px;
}

.fm-hero__team-copy {
  min-width: 0;
}

.fm-hero__eyebrow {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.9px;
  text-transform: uppercase;
}

.fm-hero__eyebrow span {
  color: rgba(255,255,255,.38);
}

.fm-hero__team h1 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-family: Tahoma, Geneva, sans-serif;
  font-size: clamp(58px, 5.4vw, 90px);
  line-height: .88;
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 5px 25px rgba(0,0,0,.90), 0 1px 4px rgba(0,0,0,.95);
}

.fm-hero__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 11px;
  color: rgba(255,255,255,.76);
  font-size: 13px;
  font-weight: 600;
}

.fm-hero__meta i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,.32);
}

/* Right panel is anchored directly to the right viewport edge. */
.fm-hero__control {
  position: absolute;
  z-index: 2;
  right: clamp(22px, 2.5vw, 44px);
  bottom: 34px;

  width: 380px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.11);
  background: linear-gradient(180deg, rgba(7,13,17,.88), rgba(10,17,22,.72));
  box-shadow: 0 20px 46px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(14px);
}

.fm-hero__account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.fm-hero__user {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fm-hero__avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.09);
}

.fm-hero__user > div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fm-hero__user small,
.fm-hero__season-head small,
.fm-hero__teams-copy small {
  color: var(--muted2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.fm-hero__user strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 13px;
}

.fm-hero__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255,61,87,.16);
  background: rgba(255,61,87,.055);
  color: #ffc0c9;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

.fm-hero__logout:hover {
  border-color: rgba(255,61,87,.36);
  background: rgba(255,61,87,.09);
}

.fm-hero__teams-link {
  display: grid;
  grid-template-columns: 40px minmax(0,1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.075);
  background: rgba(255,255,255,.035);
  color: var(--text);
  text-decoration: none;
}

.fm-hero__teams-link:hover {
  border-color: rgba(0,230,118,.28);
  background: rgba(0,230,118,.045);
}

.fm-hero__teams-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(0,230,118,.10);
  border: 1px solid rgba(0,230,118,.14);
}

.fm-hero__teams-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fm-hero__teams-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 12px;
}

.fm-hero__teams-link b {
  color: var(--green);
  font-size: 20px;
  font-weight: 400;
}

.fm-hero__season {
  padding: 13px;
  border-radius: 18px;
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(255,255,255,.07);
}

.fm-hero__season-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.fm-hero__season-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fm-hero__season-head strong {
  color: #fff;
  font-size: 12px;
}

.fm-hero__season-head > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.fm-hero__season-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 7px;
}

.fm-hero__season-btn {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.74);
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
}

.fm-hero__season-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.07);
}

.fm-hero__season-btn.active {
  color: #00120a;
  background: linear-gradient(180deg, #18f18e, var(--green));
  border-color: rgba(0,230,118,.72);
  box-shadow: 0 7px 20px rgba(0,230,118,.22), inset 0 -2px 0 rgba(0,0,0,.16);
}

@media (max-width: 1100px) {
  .fm-hero {
    min-height: 760px;
  }

  .fm-hero__team,
  .fm-hero__control {
    position: absolute;
    left: 22px;
    right: 22px;
    width: auto;
    max-width: none;
  }

  .fm-hero__team {
    bottom: 330px;
  }

  .fm-hero__control {
    bottom: 24px;
  }
}

@media (max-width: 620px) {
  .fm-hero {
    min-height: 790px;
    background-position: center 51%;
  }

  .fm-hero__team,
  .fm-hero__control {
    left: 14px;
    right: 14px;
  }

  .fm-hero__team {
    bottom: 350px;
    gap: 12px;
    padding: 14px;
    border-radius: 19px;
  }

  .fm-hero__logo {
    width: 68px;
    height: 68px;
    flex-basis: 68px;
    border-radius: 17px;
  }

  .fm-hero__logo img {
    width: 51px;
    height: 51px;
    border-radius: 11px;
  }

  .fm-hero__eyebrow {
    margin-bottom: 5px;
    font-size: 8px;
    letter-spacing: 1.2px;
  }

  .fm-hero__team h1 {
    font-size: 38px;
    letter-spacing: 1px;
  }

  .fm-hero__meta {
    margin-top: 7px;
    font-size: 11px;
  }

  .fm-hero__control {
    padding: 13px;
    border-radius: 19px;
  }
}


/* =========================================================
   DASHBOARD INLINE BACKGROUND UPLOAD
========================================================= */

.fm-hero__background-action {
  position: absolute;
  z-index: 5;
  top: 22px;
  left: 24px;

  min-height: 38px;
  padding: 8px 12px;

  display: inline-flex;
  align-items: center;
  gap: 7px;

  border: 1px solid rgba(255,255,255,.14);
  border-radius: 11px;

  background: rgba(5,10,13,.68);
  color: rgba(255,255,255,.90);

  font-size: 10px;
  font-weight: 800;

  backdrop-filter: blur(9px);

  transition:
    transform .16s ease,
    background .16s ease,
    border-color .16s ease;
}

.fm-hero__background-action:hover {
  transform: translateY(-1px);
  background: rgba(8,15,18,.88);
  border-color: rgba(0,230,118,.34);
}

.fm-hero__media-toast {
  position: absolute;
  z-index: 6;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);

  max-width: min(520px, calc(100% - 260px));
  padding: 9px 13px;

  border: 1px solid;
  border-radius: 11px;

  font-size: 10px;
  font-weight: 700;

  backdrop-filter: blur(10px);
}

.fm-hero__media-toast--success {
  color: #a4f8cf;
  border-color: rgba(0,230,118,.24);
  background: rgba(3,39,25,.82);
}

.fm-hero__media-toast--error {
  color: #ffb2be;
  border-color: rgba(255,61,87,.28);
  background: rgba(53,10,18,.84);
}

.fm-background-modal {
  display: none;
  position: fixed;
  z-index: 2200;
  inset: 0;

  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(2,6,9,.76);
  backdrop-filter: blur(9px);
}

.fm-background-modal.open {
  display: flex;
}

.fm-background-dialog {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow-y: auto;

  padding: 20px;

  border: 1px solid rgba(255,255,255,.11);
  border-radius: 20px;

  background:
    radial-gradient(
      circle at 100% 0,
      rgba(0,230,118,.08),
      transparent 34%
    ),
    #0d141a;

  box-shadow: 0 24px 70px rgba(0,0,0,.52);
}

.fm-background-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;

  margin-bottom: 15px;
  padding-bottom: 15px;

  border-bottom: 1px solid rgba(255,255,255,.07);
}

.fm-background-dialog__head small {
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.fm-background-dialog__head h2 {
  margin: 4px 0 0;
  color: #fff;
  font-size: 20px;
}

.fm-background-dialog__head p {
  margin: 5px 0 0;
  color: var(--muted2);
  font-size: 10px;
}

.fm-background-dialog__close {
  width: 36px;
  height: 36px;

  flex: 0 0 36px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(255,255,255,.09);
  border-radius: 11px;

  background: rgba(255,255,255,.04);
  color: var(--muted2);
}

.fm-background-current {
  min-height: 190px;

  display: flex;
  align-items: flex-end;

  margin-bottom: 15px;
  padding: 14px;

  border: 1px solid rgba(255,255,255,.09);
  border-radius: 15px;

  background-image:
    linear-gradient(
      180deg,
      rgba(0,0,0,.02),
      rgba(0,0,0,.58)
    ),
    var(--fm-current-bg);

  background-size: cover;
  background-position: center;
}

.fm-background-current span {
  padding: 5px 8px;

  border-radius: 999px;

  background: rgba(5,10,13,.70);
  color: rgba(255,255,255,.80);

  font-size: 9px;
  font-weight: 700;
}

.fm-background-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fm-background-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.fm-background-field > span {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.fm-background-field input {
  width: 100%;
  min-height: 44px;

  padding: 9px 11px;

  border: 1px solid rgba(255,255,255,.09);
  border-radius: 11px;

  background: #111a21;
  color: var(--text);
}

.fm-background-field small {
  color: var(--muted2);
  font-size: 9px;
}

.fm-background-preview {
  overflow: hidden;

  border: 1px solid rgba(0,230,118,.18);
  border-radius: 14px;

  background: #111a21;
}

.fm-background-preview img {
  width: 100%;
  max-height: 280px;

  display: block;
  object-fit: cover;
}

.fm-background-dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.fm-background-secondary-btn,
.fm-background-primary-btn {
  min-height: 40px;
  padding: 9px 14px;

  border-radius: 11px;

  font-size: 11px;
  font-weight: 800;
}

.fm-background-secondary-btn {
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.04);
  color: var(--muted2);
}

.fm-background-primary-btn {
  border: 0;
  background: var(--green);
  color: #00130a;
}

@media(max-width:700px) {
  .fm-hero__background-action {
    top: 14px;
    left: 14px;
  }

  .fm-hero__background-action > span:last-child {
    display: none;
  }

  .fm-hero__media-toast {
    top: 14px;
    left: 64px;
    right: 14px;
    max-width: none;
    transform: none;
  }

  .fm-background-current {
    min-height: 140px;
  }
}


/* =========================================================
   DASHBOARD FILE PICKER
========================================================= */

.fm-file-picker {
  width: 100%;
}

.fm-file-picker__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.fm-file-picker__control {
  width: 100%;
  min-height: 58px;
  padding: 8px;

  display: flex;
  align-items: center;
  gap: 11px;

  border: 1px dashed rgba(0,230,118,.28);
  border-radius: 14px;

  background:
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01)),
    #101820;

  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.fm-file-picker__control:hover {
  border-color: rgba(0,230,118,.48);
  background: #12202a;
  transform: translateY(-1px);
}

.fm-file-picker__button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 11px;
  background: linear-gradient(135deg, rgba(0,230,118,.20), rgba(0,230,118,.10));
  color: #d8ffee;

  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.fm-file-picker__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 700;
}

.fm-file-picker__name.has-file {
  color: #ffffff;
}

.fm-file-picker.has-file .fm-file-picker__control {
  border-style: solid;
  border-color: rgba(0,230,118,.45);
}

@media(max-width: 560px) {
  .fm-file-picker__control {
    align-items: flex-start;
    flex-direction: column;
  }

  .fm-file-picker__button {
    width: 100%;
  }
}


/* =========================================================
   AUTH / PROFILE — Dashboard shortcut
========================================================= */

.fm-hero__account-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.fm-hero__profile {
  min-height: 34px;
  padding: 7px 10px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;

  background: rgba(255,255,255,.035);
  color: rgba(255,255,255,.72);

  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.fm-hero__profile:hover {
  color: #fff;
  border-color: rgba(0,230,118,.26);
}
