/* === MIN SIDE (MY PAGE) LAYOUT === */

/* GENERELT DASHBOARD */
.ms-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* GRID LAYOUT */
.ms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

/* === GENERELT KORT === */
.ms-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  min-height: 340px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ms-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.ms-card h2 {
  margin-top: 0;
  font-size: 1.3rem;
  color: #222;
}

.ms-card p {
  margin: 0.3rem 0;
  color: #333;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* FARGET VENSTRESTRIPE */
.ms-card.profile { border-left: 5px solid #007bff; margin-bottom: 10px;}
.ms-card.admin { border-left: 5px solid #28a745; }
.ms-card.challenges { border-left: 5px solid #ff9800; }
.ms-card.training { border-left: 5px solid #673ab7; }

/* === PROFILKORT === */
.ms-card.profile {
  text-align: left;
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: 1.5rem;
}

.ms-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin-bottom: 1rem;
}

.ms-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #007bff;
  flex-shrink: 0;
}

.ms-profile-header .ms-username {
  font-size: 1.3rem;
  font-weight: 600;
  color: #007bff;
  margin: 0;
  word-break: break-word;
}

.ms-profile-info {
  flex: 1;
  width: 100%;
}

/* === ADMIN-KORT === */
.ms-card.admin {
  display: flex;
  flex-direction: column;
}
.ms-admin-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}
.ms-admin-section p {
  flex-grow: 1;
}

/* === KNAPPER — alltid nederst === */
.ms-card .ms-btn {
  margin-top: auto;
  align-self: flex-start;
}

/* === KNAPPER STIL === */
.ms-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}
.ms-btn.primary { background: #007bff; color: #fff; }
.ms-btn.primary:hover { background: #0069d9; }

.ms-btn.danger { background: #dc3545; color: #fff; }
.ms-btn.danger:hover { background: #b92b3a; }

.ms-btn.info { background: #17a2b8; color: #fff; }
.ms-btn.info:hover { background: #138496; }

/* === LOGIN === */
.ms-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ms-form input {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}
.ms-msg {
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* === LOADING === */
.loading {
  text-align: center;
  padding: 2rem;
  color: #555;
}

/* === RESPONSIV === */
@media (max-width: 768px) {
  .ms-card {
    min-height: 300px;
    padding: 1rem;
  }
  .ms-avatar {
    width: 70px;
    height: 70px;
  }
}

/* === LOGIN FELTER === */
.ms-card.login-box {
  max-width: 400px;
  margin: 4rem auto;
  text-align: left;
}
.ms-card.login-box h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
}
.icon-input label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: #333;
  font-size: 0.9rem;
}
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper input {
  width: 100%;
  height: 44px;
  padding: 0 2.5rem 0 2.3rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  line-height: 1.2;
}
.input-wrapper input:focus {
  border-color: #007bff;
  outline: none;
}
.input-icon {
  position: absolute;
  left: 0.7rem;
  width: 1rem;
  height: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.6;
}
.input-icon.user {
  background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='%23777' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
}
.input-icon.lock {
  background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='%23777' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0110 0v4'/%3E%3C/svg%3E");
}

/* === RUN LIST === */
.run-list li {
  margin: 0.3rem 0;
  padding: 0.4rem 0.6rem;
  background: #f9f9f9;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.delete-run {
  background: #dc3545;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-weight: bold;
  line-height: 1;
  transition: background 0.2s ease;
}
.delete-run:hover {
  background: #b92b3a;
}

/* === MODALER (glemt passord + registrering) === */
.forgot-modal,
.register-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
  overflow: auto;
}

/* === Modal boks === */
.forgot-box,
.register-box {
  background: #fff;
  color: #111;
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: modalFadeIn 0.3s ease;
}
.forgot-box h3,
.register-box h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  color: #007bff;
}

/* === Inputs i modal === */
.forgot-box input,
.register-box input:not([type="checkbox"]),
.register-box select {
  width: 100%;
  margin-bottom: 0.8rem;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}
.forgot-box input:focus,
.register-box input:focus,
.register-box select:focus {
  border-color: #007bff;
  outline: none;
}

/* === Knappene i modal === */
.forgot-box .ms-btn,
.register-box .ms-btn {
  width: 100%;
  margin-top: 0.5rem;
}

/* === Meldinger === */
.ms-msg {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* === Anim === */
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Responsiv === */
@media (max-width: 500px) {
  .forgot-box,
  .register-box {
    margin: 0 1rem;
    padding: 1.5rem;
  }
}

/* === Dark Mode fallback === */
body.dark-mode .forgot-box,
body.dark-mode .register-box {
  background: #222;
  color: #eee;
  border: 1px solid #333;
}

/* === GENERISK MODAL (brukes av rediger profil, kamera osv.) === */
.ms-modal,
.camera-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
  overflow: auto;
  padding: 1rem;
}

/* === Innholdsboks for ms-modal === */
.ms-modal-content {
  background: #fff;
  color: #111;
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  text-align: left;
  animation: modalFadeIn 0.3s ease;
}

.ms-modal-content h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  color: #007bff;
}

.ms-modal-content .ms-form input,
.ms-modal-content .ms-form select {
  width: 100%;
  margin-bottom: 0.8rem;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.ms-modal-content .ms-form input:focus,
.ms-modal-content .ms-form select:focus {
  border-color: #007bff;
  outline: none;
}

.ms-modal-content .ms-btn {
  width: 100%;
  margin-top: 0.5rem;
}

/* === Kamera-modal === */
.camera-modal video {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  margin: 1rem 0;
  background: #000;
}

.camera-modal button {
  margin: 0.5rem;
}

/* === Profilfremdrift === */
.profile-completion {
  margin-top: 1rem;
}
.progress-bar {
  background: #e5e5e5;
  border-radius: 10px;
  overflow: hidden;
  height: 10px;
  margin-top: 4px;
}
.progress-bar .fill {
  background: linear-gradient(90deg, #00c853, #64dd17);
  height: 100%;
  width: 0;
  transition: width 0.5s ease;
}

/* === Avatar === */
.avatar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.ms-btn.small {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
}

/* Dark mode støtte */
body.dark-mode .ms-modal-content {
  background: #222;
  color: #eee;
  border: 1px solid #333;
}

/* === OPPDATERT PROFILKORT === */
.ms-card.profile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.8rem 1.5rem;
  text-align: left;
  border-left: 5px solid #007bff;
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 100%);
}

.ms-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ms-profile-text {
  flex: 1;
}

.ms-username {
  font-size: 1.3rem;
  font-weight: 600;
  color: #007bff;
  margin: 0 0 0.2rem 0;
}

.ms-email {
  font-size: 0.9rem;
  color: #444;
  margin: 0.1rem 0;
}

.ms-status {
  font-size: 0.9rem;
  color: #333;
  margin: 0.3rem 0 0;
}

.ms-profile-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.ms-card.profile .ms-btn {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  border-radius: 8px;
}

/* Litt mer visuelt løft på avatar */
.ms-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #007bff;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}
/* === FIKS KNAPPER PÅ PROFILKORT === */
.ms-profile-actions .ms-btn {
  white-space: nowrap;         /* 🔹 Hindrer linjeskift */
  flex: 1 1 48%;               /* 🔹 Begge får lik bredde, med litt mellomrom */
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 42px;                /* 🔹 Samme høyde på begge */
  font-size: 0.9rem;
  line-height: 1;
  text-align: center;
}

.ms-profile-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

@media (max-width: 480px) {
  .ms-profile-actions {
    flex-direction: column;
  }
  .ms-profile-actions .ms-btn {
    width: 100%;
  }
}
/* === KOMPAKTE KORT === */
.ms-card {
  min-height: auto !important;      /* 🔹 Fjern fast minimumshøyde */
  padding: 1.25rem 1.25rem !important;  /* 🔹 Litt mindre padding */
  justify-content: flex-start !important; /* 🔹 Slutt å strekke innholdet */
}

.ms-card.profile {
  padding: 1.5rem 1.25rem;          /* 🔹 Litt ekstra toppmarg for balanse */
}

/* Gi en fin visuell rytme mellom elementene */
.ms-card h2,
.ms-card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.ms-card p {
  margin: 0.25rem 0;
  font-size: 0.93rem;
  line-height: 1.35;
}

/* === Kompakt profilkort-spesifikt === */
.ms-profile-header {
  margin-bottom: 0.75rem;  /* mindre spacing mellom header og info */
}
.ms-profile-actions {
  margin-top: 0.75rem;
}
/* === Felles knappestil for profil og treningskort === */
.ms-profile-actions,
.ms-card.training .ms-btn-group {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
}

.ms-profile-actions .ms-btn,
.ms-card.training .ms-btn-group .ms-btn {
  flex: 1 1 48%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  white-space: nowrap;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1;
  text-align: center;
}

/* === Mobilvennlig layout === */
@media (max-width: 500px) {
  .ms-profile-actions,
  .ms-card.training .ms-btn-group {
    flex-direction: column;
  }
  .ms-profile-actions .ms-btn,
  .ms-card.training .ms-btn-group .ms-btn {
    width: 100%;
  }
}
/* === Felles knappestil for profilkort og treningskort === */
.ms-btn-group {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
}

.ms-btn-group .ms-btn {
  flex: 1 1 48%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  white-space: nowrap;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

/* === Primærknapp (brukes på “Gå til profil” og treningsknapper) === */
.ms-btn.primary {
  background: #007bff;
  color: #fff;
  border: none;
}
.ms-btn.primary:hover {
  background: #0069d9;
}

/* === Rød logg ut-knapp === */
.ms-btn.danger {
  background: #dc3545;
  color: #fff;
  border: none;
}
.ms-btn.danger:hover {
  background: #b92b3a;
}

/* === Juster profilkort for bedre visuell balanse === */
.ms-profile-actions {
  margin-top: 1rem;
}

/* === Mobilvennlig layout === */
@media (max-width: 500px) {
  .ms-btn-group {
    flex-direction: column;
  }
  .ms-btn-group .ms-btn {
    width: 100%;
  }
}
/* === Felles layout for kortknapper (profil + trening) === */
.ms-card.profile,
.ms-card.training {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Juster plassering for knappene */
.ms-profile-actions,
.ms-card.training .ms-btn-group {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: auto;              /* 📌 holder knappene nederst */
  padding-top: 1rem;             /* litt luft over */
  align-self: stretch;
}

.ms-profile-actions .ms-btn,
.ms-card.training .ms-btn-group .ms-btn {
  flex: 1 1 48%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
  text-align: center;
  transition: all 0.2s ease;
}

/* === Primær (blå) knapp === */
.ms-btn.primary {
  background: #007bff;
  color: #fff;
  border: none;
  box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}
.ms-btn.primary:hover {
  background: #0069d9;
  box-shadow: 0 3px 8px rgba(0, 123, 255, 0.3);
}

/* === Rød knapp === */
.ms-btn.danger {
  background: #dc3545;
  color: #fff;
  border: none;
  box-shadow: 0 2px 5px rgba(220, 53, 69, 0.2);
}
.ms-btn.danger:hover {
  background: #b92b3a;
  box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3);
}

/* === Mobiltilpasning === */
@media (max-width: 600px) {
  .ms-profile-actions,
  .ms-card.training .ms-btn-group {
    flex-direction: column;
  }

  .ms-profile-actions .ms-btn,
  .ms-card.training .ms-btn-group .ms-btn {
    width: 100%;
  }
}
/* === REGISTER MODAL – TIGHT, NO OVERFLOW, MATCHED WIDTHS === */
.register-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
  padding: 1rem;
}

.register-box {
  background: #fff;
  color: #111;
  border-radius: 10px;
  width: 95%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  overflow: hidden;                /* 🔒 prevents horizontal bleed */
  animation: modalFadeIn 0.25s ease;
}

.register-box h3 {
  text-align: center;
  margin: 1rem 1rem 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #007bff;
  flex-shrink: 0;
}

/* === 2-col grid (Label | Field) with safe right column === */
.register-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr); /* 🔒 right col cannot overflow */
  gap: 0.6rem 1rem;
  align-items: center;
  padding: 1rem 1.5rem 1.2rem;
  overflow-y: auto;    /* only vertical if needed */
  overflow-x: hidden;  /* 🔒 no horizontal scroll in form */
}

/* make grid children shrink properly */
.register-grid > * { min-width: 0; } /* 🔒 prevents child from forcing overflow */

/* === labels === */
.register-grid label {
  text-align: right;
  font-weight: 500;
  color: #222;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* === inputs & selects: identical sizing === */
.register-grid input,
.register-grid select {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.48rem 0.6rem;          /* 👯 same padding */
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.3;
  min-height: 38px;                 /* 👯 equal min height */
  appearance: none;                 /* more consistent select rendering */
  background-clip: padding-box;
}

/* keep selects from oversizing on some browsers */
.register-grid select { min-width: 0; }

.register-grid input:focus,
.register-grid select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
  outline: none;
}

/* === BRUKERVILKÅR RAD — perfekt linjert === */
/* === BRUKERVILKÅR-RAD (checkbox + tekst, korrekt utseende) === */
label[for="agreeBox"] {
  text-align: right;
  font-weight: 500;
  color: #222;
  font-size: 0.9rem;
  align-self: start;
  padding-top: 0.35rem;
}

/* container for checkbox og tekst */
.checkbox-cell {
  display: flex;
  align-items: center;   /* ✅ sentrer checkbox og tekst vertikalt */
  gap: 0.6rem;
  line-height: 1.4;
  color: #333;
  font-size: 0.9rem;
  background: transparent;
  border: none;
  padding: 0;
  width: 100%;
}

/* selve checkboxen */
.checkbox-cell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #007bff;     /* 🔹 blå avkryssing i moderne nettlesere */
  margin-top: 0.15rem;
  flex-shrink: 0;
}

/* teksten ved siden av checkbox */
.checkbox-cell span {
  display: inline-block;
  flex: 1;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  color: #333;
}

/* lenken inni teksten */
.checkbox-cell a {
  color: #007bff;
  text-decoration: underline;
  font-weight: 500;
}
/* message text spans full width */
.ms-msg {
  grid-column: 1 / 3;
  text-align: center;
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

/* buttons row spans full width, aligned right */
.button-row {
  grid-column: 1 / 3;
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 0.8rem;
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

.button-row .ms-btn {
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.ms-btn.primary { background: #007bff; color: #fff; border: none; }
.ms-btn.primary:hover { background: #0069d9; }
.ms-btn:not(.primary) { background: #f3f3f3; border: 1px solid #ccc; }
.ms-btn:not(.primary):hover { background: #e9e9e9; }

/* responsive: stack to 1 col on mobile */
@media (max-width: 600px) {
  .register-grid { grid-template-columns: 1fr; }
  .register-grid label { text-align: left; }
  .button-row { flex-direction: column; align-items: stretch; }
}

/* anim */
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* dark mode */
body.dark-mode .register-box { background: #222; color: #eee; border: 1px solid #333; }
body.dark-mode .register-grid input,
body.dark-mode .register-grid select { background: #333; color: #eee; border-color: #444; }


/* === FIX: ekte, synlig og klikkbar checkbox === */
.register-box input[type="checkbox"] {
  appearance: checkbox;           /* ✅ bruk vanlig avkryssningsboks */
  -webkit-appearance: checkbox;
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin-top: 0.2rem;
  margin-right: 0.4rem;
  accent-color: #007bff;          /* blå hake i moderne nettlesere */
  flex-shrink: 0;
}

/* === ENDELIG MOBILFIX FOR REGISTER-SKJEMA (overstyrer global CSS) === */
@media (max-width: 600px) {
  /* Sørg for at register-grid faktisk blir 1 kolonne og strekker elementene */
  .register-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: start !important;
    text-align: left !important;
  }

  /* Label rett over inputfelt, liten og tett */
  .register-grid label {
    grid-column: 1 / -1 !important;
    text-align: left !important;
    display: block !important;
    font-size: 0.75rem !important;
    color: #555 !important;
    margin-bottom: 0.15rem !important;
  }

  /* Inputfelt / select rett under label */
  .register-grid input,
  .register-grid select {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    margin-bottom: 0.6rem !important;
    text-align: left !important;
  }

  /* Checkbox-rad: normal tekst, ingen rare linjeskift */
  .checkbox-cell {
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    text-align: left !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    letter-spacing: normal !important;
  }

  .checkbox-cell span {
    white-space: normal !important;
    letter-spacing: normal !important;
  }

  /* Knappene nederst – full bredde og riktig marger */
  .button-row {
    grid-column: 1 / -1 !important;
    flex-direction: column !important;
    align-items: stretch !important;
    margin-top: 1rem !important;
    padding-top: 0.8rem !important;
  }
}
/* === FIX: Brukervilkår-tekst brytes riktig === */
.checkbox-cell {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  text-align: left !important;
  line-height: 1.4 !important;

  /* 🔧 Tving normal tekstflyt */
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  letter-spacing: normal !important;
  writing-mode: horizontal-tb !important; /* 👈 viktigst – hindrer vertikal tekst */
}

.checkbox-cell span {
  display: inline !important;
  white-space: normal !important;
  word-break: normal !important;
  letter-spacing: normal !important;
  writing-mode: horizontal-tb !important;
  text-align: left !important;
}


/* === Login actions under "Logg inn" — to sekundærknapper side-om-side === */
.login-box .login-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.login-box .login-actions .ms-btn {
  flex: 1 1 48%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 8px;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Sekundær stil – lys grå */
.login-box .login-actions .ms-btn.secondary {
  background: #f3f3f3;
  color: #333;
  border: 1px solid #ccc;
  box-shadow: none;
  transition: background 0.2s ease;
}

.login-box .login-actions .ms-btn.secondary:hover {
  background: #e9e9e9;
}

/* Mobil: stack */
@media (max-width: 500px) {
  .login-box .login-actions {
    flex-direction: column;
  }
  .login-box .login-actions .ms-btn {
    width: 100%;
  }
}

/* === FIX: Brukervilkår-linja brytes normalt og checkbox blir passe stor === */

/* 1) Riktig layout og line-breaks */
.register-grid .checkbox-cell {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;          /* tillat brytning når plassen er liten */
  text-align: left !important;
  line-height: 1.35 !important;
  white-space: normal !important;       /* UNNGÅ rare “én-bokstav-per-linje” */
  word-break: normal !important;
  overflow-wrap: break-word !important; /* bryt ord kun når nødvendig */
  letter-spacing: normal !important;
  writing-mode: horizontal-tb !important;
}

.register-grid .checkbox-cell span {
  flex: 1 1 auto !important;            /* la teksten bruke tilgjengelig bredde */
  min-width: 0 !important;              /* viktig i flex for å unngå “klem” */
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  letter-spacing: normal !important;
  writing-mode: horizontal-tb !important;
}

/* 2) Krymp checkbox på mobil (iOS/Gmail/Outlook prefetch kan blåse den opp) */
@media (max-width: 600px) {
  .register-grid .checkbox-cell input[type="checkbox"] {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    width: 18px !important;
    height: 18px !important;
    transform: scale(0.9);               /* liten visuell justering */
    transform-origin: left center;
    margin: 0.1rem 0 0 0 !important;
    accent-color: #007bff;
  }
}

/* 3) Ikke la global typografi snike inn vertikal skrift ell. */
.register-grid .checkbox-cell *,
.register-grid .checkbox-cell a {
  writing-mode: horizontal-tb !important;
  letter-spacing: normal !important;
}


/* === FIX: Profilkort-knapper (Logg ut / Gå til profil / Send verifisering) === */
.ms-card.profile .ms-btn {
  color: #fff !important;
  font-weight: 500;
  border: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Blå primærknapp */
.ms-card.profile .ms-btn.primary {
  background: #007bff !important;
}
.ms-card.profile .ms-btn.primary:hover {
  background: #0069d9 !important;
}

/* Rød logg-ut-knapp */
.ms-card.profile .ms-btn.danger {
  background: #dc3545 !important;
}
.ms-card.profile .ms-btn.danger:hover {
  background: #b92b3a !important;
}

/* Info-knapp for “Send bekreftelseslenke” */
.ms-card.profile .ms-btn.info {
  background: #17a2b8 !important;
}
.ms-card.profile .ms-btn.info:hover {
  background: #138496 !important;
}

/* Juster knapphøyder og align for perf visuell balanse */
.ms-card.profile .ms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 8px;
  text-align: center;
  line-height: 1;
}

.ms-profile-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .ms-profile-actions {
    flex-direction: column;
  }
  .ms-profile-actions .ms-btn {
    width: 100%;
  }
}

/* === E-postverifiseringseksjon i profilkort === */
.verify-warning {
  margin-top: 0.6rem;
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  color: #444;
  text-align: left;
}

.verify-warning p {
  margin: 0 0 0.6rem 0;
}

.verify-warning .ms-btn.info {
  width: 100%;
  height: 40px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  border-radius: 6px;
}

/* === CHIPS (gjenbruk fra profil-siden) === */
.chips {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.chip {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #eef2ff;
  color: #4338ca;
}
.chip.ok {
  background: #e8fff0;
  color: #16a34a;
}
.chip.warn {
  background: #fff7ed;
  color: #ea580c;
}
.chip.info {
  background: #e0f2fe;
  color: #0369a1;
}
.chip.link {
  background: #e0f2fe;
  color: #0369a1;
  text-decoration: none;
}
.chip.link:hover {
  text-decoration: underline;
}

.admin-card {
  background: #fffdfb;
  border: 1px solid #ffe4b2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.admin-card .admin-header h2 {
  margin-bottom: 0.4rem;
}

.admin-card .admin-header p {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1rem;
}

.admin-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-actions .ms-btn {
  flex: 1;
  text-align: center;
}
.team-listing {
  list-style: none;
  padding: 0;
  margin: .5rem 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.team-listing li {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: #f9fafb;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: .5rem .8rem;
}
.team-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}
.team-info h4 {
  margin: 0;
  font-size: 1rem;
}
.team-info p {
  margin: 0;
  font-size: .85rem;
  color: #555;
}

/* Modal */
.ms-modal-overlay {
  position: fixed;
  top:0;left:0;right:0;bottom:0;
  background:rgba(0,0,0,.5);
  display:flex;align-items:center;justify-content:center;
  z-index:1000;
}
.ms-modal-box {
  background:#fff;
  padding:1.5rem 2rem;
  border-radius:12px;
  max-width:420px;
  width:90%;
  box-shadow:0 4px 12px rgba(0,0,0,.15);
}
.ms-modal-box h3 { margin-top:0; }
.ms-modal-box input, .ms-modal-box select, .ms-modal-box textarea {
  width:100%;
  margin:.4rem 0 .8rem;
  padding:.5rem;
  border:1px solid #ccc;
  border-radius:6px;
  font-size:1rem;
}
/* TEAM */

/* === USER TEAMS LIST (MIN SIDE) === */
.user-teams {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.user-team-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: #f9fafb;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.user-team-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.user-team-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}

.user-team-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
}

.user-team-info h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111;
}

.user-team-info .team-area {
  color: #555;
  font-size: 0.9rem;
}

.user-team-info .team-meta {
  color: #777;
  font-size: 0.8rem;
}

.user-teams .muted {
  font-style: italic;
  color: #666;
  font-size: 0.9rem;
  text-align: center;
  padding: 0.5rem;
}

/* === FIX: Gjør profilknapper (Gå til profil / Logg ut) tykkere og mer balansert === */
.ms-card.profile .ms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0.55rem 1.2rem;     /* 🔹 gir luft rundt teksten */
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  height: auto;                /* 🔹 fjern fast høyde */
  min-height: 44px;            /* 🔹 sikrer god touchflate */
  box-sizing: border-box;
}

/* Valgfritt: gi litt skygge og hover-feedback */
.ms-card.profile .ms-btn.primary,
.ms-card.profile .ms-btn.danger,
.ms-card.profile .ms-btn.info {
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
}

.ms-card.profile .ms-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}



