/* ===== MTF Auth – Forbedret CSS med forklaringer ===== */

/* ========================================
   FARVE VARIABLER (Rediger disse til dit brand)
   ======================================== */
:root {
  --mtf-bg: #F4F6F6;                    /* Baggrund for tabs container */
  --mtf-border: rgba(143,162,154,.35);  /* Kant farve for input felter */
  --mtf-text: #0F2A28;                  /* Primær tekst farve */
  --mtf-muted: #6b7d76;                 /* Sekundær/dæmpet tekst */
  --mtf-ink: #475B54;                   /* Mellemtone tekst */
  --mtf-accent: #0F2A28;                /* Knap og aktiv tab farve */
  --mtf-white: #fff;                    /* Hvid baggrund */
  --mtf-shadow-light: 0 2px 4px rgba(0,0,0,.08);    /* Let skygge */
  --mtf-shadow-medium: 0 4px 12px rgba(0,0,0,.12);  /* Medium skygge */
  --mtf-shadow-heavy: 0 8px 24px rgba(0,0,0,.16);   /* Kraftig skygge */
}

/* ========================================
   CONTAINER STYLING
   ======================================== */
.mtf-auth__wrap {
  max-width: 520px;
  width: 100%;
  margin-inline: auto;
  padding-inline: clamp(14px, 4vw, 20px);
}

/* ========================================
   TAB NAVIGATION (Login/Opret konto)
   Forbedret med bedre spacing og hover effekter
   ======================================== */
.mtf-auth__tabs {
  display: flex;
  gap: 8px;  /* TILFØJET: Mellemrum mellem tabs */
  align-items: center;
  background: var(--mtf-bg);
  border: 1px solid rgba(0,0,0,.05);
  border-radius: 16px;  /* Større radius for moderne look */
  padding: 6px;
  width: 100%;
  margin-bottom: 24px;  /* Mere luft under tabs */
  box-shadow: inset 0 1px 3px rgba(0,0,0,.05);  /* Indre skygge for dybde */
}

.mtf-auth__tab {
  flex: 1;
  padding: 12px 16px;  /* Større padding for bedre klikområde */
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;  /* Lidt større tekst */
  color: var(--mtf-ink);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);  /* Smooth animation */
  position: relative;
}

/* Hover effekt på inaktive tabs */
.mtf-auth__tab:not(.is-active):hover {
  background: rgba(255,255,255,0.5);
  transform: translateY(-1px);  /* Let løft effekt */
}

/* Aktiv tab med forbedret styling */
.mtf-auth__tab.is-active {
  background: var(--mtf-white);
  color: var(--mtf-accent);
  box-shadow: 
    0 2px 8px rgba(0,0,0,.08),
    0 4px 16px rgba(0,0,0,.06);  /* Dobbelt skygge for dybde */
  transform: scale(1.02);  /* Let forstørrelse */
}

/* Klik effekt på aktiv tab */
.mtf-auth__tab.is-active:active {
  transform: scale(1.01);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ========================================
   OVERSKRIFTER
   ======================================== */
.mtf-auth__title {
  margin: 20px 0 8px;
  font-weight: 700;
  font-size: 28px;  /* Større overskrift */
  line-height: 1.2;
  color: var(--mtf-text);
}

.mtf-auth__subtitle {
  margin: 0 0 20px;
  color: var(--mtf-muted);
  font-size: 15px;
}

/* ========================================
   GRID LAYOUT (For Fornavn/Efternavn)
   ======================================== */
.mtf-grid {
  display: grid;
  gap: 16px;  /* Mere mellemrum mellem felter */
}

.mtf-grid--2 {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 680px) {
  .mtf-grid--2 {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   INPUT FELTER
   ======================================== */
.mtf-field {
  margin-bottom: 16px;  /* Konsistent spacing mellem felter */
}

.mtf-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--mtf-ink);
  margin: 0 0 8px;
  letter-spacing: 0.02em;  /* Let spacing for læsbarhed */
}

.mtf-field input {
  width: 100%;
  height: 48px;  /* Større højde for bedre touch target */
  padding: 12px 14px;
  background: var(--mtf-white) !important;
  border: 1.5px solid var(--mtf-border) !important;
  border-radius: 12px !important;
  color: var(--mtf-text);
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

/* Fokus tilstand med skygge */
.mtf-field input:focus {
  border-color: var(--mtf-accent) !important;
  box-shadow: 
    0 0 0 3px rgba(15,42,40,.08),
    0 2px 8px rgba(15,42,40,.05);
  transform: translateY(-1px);  /* Let løft ved fokus */
}

/* Hover effekt på input */
.mtf-field input:hover:not(:focus) {
  border-color: rgba(15,42,40,.25);
}

/* ========================================
   PLACEHOLDER STYLING
   ======================================== */
.mtf-field input::placeholder {
  color: #8ca19a;
  opacity: 0.7;
}

.mtf-field input::-ms-input-placeholder {
  color: #8ca19a;
}

.mtf-field input::-webkit-input-placeholder {
  color: #8ca19a;
}

/* ========================================
   PASSWORD TOGGLE IKON
   Bruger FontAwesome ikoner hvis tilgængelige
   ======================================== */
.mtf-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mtf-pass-wrap input {
  padding-right: 48px;
}

.mtf-pass-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--mtf-ink);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mtf-pass-toggle:hover {
  opacity: 1;
}

/* FontAwesome ikoner (hvis tilgængelige) */
.mtf-pass-toggle::before {
  font-family: "Font Awesome 5 Free", "FontAwesome";
  font-weight: 900;
  content: "\f06e";  /* eye ikon */
  font-size: 18px;
}

.mtf-pass-toggle.is-on::before {
  content: "\f070";  /* eye-slash ikon */
}

/* Fallback til SVG hvis FontAwesome ikke er tilgængelig */
.mtf-pass-toggle:not(.has-fa)::before {
  content: "";
  width: 22px;
  height: 22px;
  display: block;
  background-color: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>') no-repeat center / contain;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>') no-repeat center / contain;
}

.mtf-pass-toggle.is-on:not(.has-fa)::before {
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>') no-repeat center / contain;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>') no-repeat center / contain;
}

/* ========================================
   CHECKBOX OG VILKÅR
   ======================================== */
.mtf-terms {
  margin: 20px 0 24px;  /* 24px afstand til knappen nedenfor */
}

.mtf-check {
  display: flex;
  gap: 12px;
  align-items: center;  /* Centreret checkbox med tekst */
}

.mtf-check input[type="checkbox"] {
  margin-top: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.mtf-check span {
  line-height: 1.5;
  font-size: 14px;
  color: var(--mtf-ink);
}

.mtf-check a {
  font-weight: 600;
  text-decoration: underline;
  color: var(--mtf-accent);
  transition: opacity 0.2s ease;
}

.mtf-check a:hover {
  opacity: 0.8;
}

/* ========================================
   PRIMÆR KNAP (Log ind / Opret konto)
   ======================================== */
.mtf-auth__actions {
  display: flex;
  justify-content: center;
  margin-top: 0;  /* Styres af .mtf-terms */
  margin-bottom: 24px;  /* 24px afstand til link nedenfor - samme som mellem checkbox og knap */
}

.mtf-auth__btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  border-radius: 14px;
  border: none;
  background: var(--mtf-accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--mtf-shadow-heavy);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Hover effekt med løft og skygge */
.mtf-auth__btn:hover {
  background: #143634;
  transform: translateY(-2px);
  box-shadow: 
    0 12px 28px rgba(0,0,0,.18),
    0 6px 12px rgba(0,0,0,.12);
}

/* Klik effekt */
.mtf-auth__btn:active {
  transform: translateY(0);
  box-shadow: var(--mtf-shadow-light);
  transition-duration: 0.1s;
}

/* Ripple effekt ved klik (valgfrit) */
.mtf-auth__btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.mtf-auth__btn:active::after {
  width: 300px;
  height: 300px;
}

/* ========================================
   HJÆLPE LINKS (Glemt adgangskode osv.)
   ======================================== */
.mtf-auth__helpbottom {
  margin-top: 0;  /* Reduceret da knappen nu har margin-bottom */
  text-align: center;
  font-size: 14px;
  color: var(--mtf-muted);
}

.mtf-auth__helpbottom a {
  color: var(--mtf-accent);
  text-decoration: underline;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.mtf-auth__helpbottom a:hover {
  opacity: 0.7;
}

/* ========================================
   AUTOFILL STYLING (Chrome/Edge)
   ======================================== */
.mtf-auth__form input:-webkit-autofill {
  -webkit-text-fill-color: var(--mtf-text);
  box-shadow: 0 0 0 1000px var(--mtf-white) inset;
  transition: background-color 9999s ease-out 0s;
}

/* ========================================
   MOBIL OPTIMERING
   ======================================== */
@media (max-width: 480px) {
  .mtf-auth__tabs {
    margin-bottom: 20px;
    gap: 6px;
  }
  
  .mtf-auth__tab {
    padding: 11px 14px;
    font-size: 14px;
  }
  
  .mtf-auth__title {
    font-size: 24px;
  }
  
  .mtf-field input {
    height: 50px;  /* Større touch target på mobil */
    font-size: 16px;  /* Undgå zoom på iOS */
  }
  
  .mtf-auth__btn {
    padding: 18px 24px;
    font-size: 17px;
  }
  
  .mtf-auth__helpbottom {
    margin-top: 20px;  /* Reduceret til 20px for bedre mobil spacing */
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Brug denne class hvis du vil have ekstra padding */
.mtf-auth__wrap--spacious {
  padding-top: 40px;
  padding-bottom: 40px;
}

/* Tilføj loading state til knappen */
.mtf-auth__btn.is-loading {
  color: transparent;
  pointer-events: none;
}

.mtf-auth__btn.is-loading::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* ========================================
   AVADA OVERRIDES
   Sikrer vores styling ikke bliver overskrevet
   ======================================== */
.mtf-auth__wrap,
.mtf-auth__wrap * {
  box-sizing: border-box;
}

/* Fjern Avada separator hvis den forstyrrer */
.mtf-wrap .fusion-separator-border {
  display: none !important;
}

/* Override Avada's button styles */
.mtf-auth__btn,
.mtf-auth__btn:hover,
.mtf-auth__btn:focus {
  text-decoration: none !important;
  outline: none !important;
}