@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=Open+Sans:wght@400;600;700&display=swap");

/* =========================
   LOGIN.CSS (hård override)
   ========================= */

/* Variabler */
:root {
  --brand-blue: #393eb3;
  --cta-blue: #3339dd;
  --card-radius: 30px;
  --panel-radius: 10px;
  --muted: #4a4a4a;
  --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.18);
}

header#header {
  display: none !important;
}

/* Basreset */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* Scope: funkar både med och utan body-class */
body.page-template-login-page,
body.page-template-login-page-php,
body.page-template-login-page,
body {
  margin: 0 !important;
}

/* Försök neutralisera tema-wrappers som ofta förstör layout */
body.page-template-login-page #page,
body.page-template-login-page .site,
body.page-template-login-page .site-content,
body.page-template-login-page .content-area,
body.page-template-login-page .entry,
body.page-template-login-page .entry-content,
body.page-template-login-page .wp-site-blocks,
body.page-template-login-page main,
body.page-template-login-page .container,
body.page-template-login-page .row,
body.page-template-login-page .col,
body.page-template-login-page .wrap,
body.page-template-login-page .content,
body.page-template-login-page .page,
body.page-template-login-page .page-content,
body.page-template-login-page .site-main {
  max-width: none !important;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Om body-class inte matchar (vissa teman sätter annan class)
   så ser vi till att login-sidan ändå får rätt layout via .login-page */
body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif !important;
  background-image: url("https://studerahp.se/wp-content/uploads/2025/02/1_.webp") !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  min-height: 100vh !important;
}

/* Outer centering container */
.login-page {
  min-height: 100vh !important;
  display: grid !important;
  place-items: center !important;
  padding: 28px 16px !important;
}

/* Shell */
.login-shell {
  width: min(1100px, 92vw) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  border-radius: var(--card-radius) !important;
}

/* Card */
.login-card {
  width: min(1000px, 82vw) !important;
  min-height: 550px !important;
  display: flex !important;
  flex-direction: row-reverse !important;
  border-radius: var(--panel-radius) !important;
  overflow: hidden !important;
  box-shadow: var(--shadow-soft) !important;
  background: rgb(255 255 255 / 56%) !important;
  -webkit-backdrop-filter: blur(7px) !important;
  backdrop-filter: blur(7px) !important;
}

/* Form panel */
.form-panel {
  flex: 1 1 40% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
}

.form-inner {
  width: min(520px, 80%) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.form-title {
  margin: 0 !important;
  padding-top: 24px !important;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif !important;
  color: #27348b !important;
  text-align: center !important;
  text-shadow: 0 10px 24px rgba(41, 56, 127, 0.12) !important;
  letter-spacing: -0.03em !important;
  font-size: clamp(2rem, 1.5rem + 1.2vw, 2.65rem) !important;
  line-height: 0.95 !important;
  font-weight: 800 !important;
}

.form-subtitle {
  margin: 10px 0 0 !important;
  max-width: 34ch !important;
  text-align: center !important;
  color: rgba(43, 47, 58, 0.72) !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

/* Form */
.login-page form {
  width: 100% !important;
  margin-top: 10px !important;
  margin-bottom: 9%;
  font-family:
    "Open Sans",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif !important;
}

.field {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-bottom: 16px !important;
}

.mk-password-field {
  position: relative !important;
}

.mk-password-input {
  padding-right: 52px !important;
}

.mk-password-toggle {
  position: absolute !important;
  top: 50% !important;
  right: 12px !important;
  transform: translateY(-50%) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  padding: 4px !important;
  border: 0 !important;
  background: transparent !important;
  cursor: pointer !important;
  opacity: 0.72 !important;
  transition: opacity 0.16s ease !important;
  box-shadow: none !important;
}

.mk-password-toggle:hover,
.mk-password-toggle:focus-visible {
  opacity: 1 !important;
}

.mk-password-toggle:focus-visible {
  outline: none !important;
}

.mk-password-toggle__icon {
  width: 20px !important;
  height: 20px !important;
  display: block !important;
}

#login-stepup-field[hidden],
#login-stepup-actions[hidden] {
  display: none !important;
}

.field label {
  font-size: 14px !important;
  color: #2b2f3a !important;
  font-weight: 600 !important;
}

.field input[type="text"],
.field input[type="password"] {
  width: 100% !important;
  height: 44px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(0, 0, 0, 0.14) !important;
  border-radius: 12px !important;
  outline: none !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
  background: rgba(255, 255, 255, 0.9) !important;
}

.field input[type="text"]:focus,
.field input[type="password"]:focus {
  border-color: rgba(57, 62, 179, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(57, 62, 179, 0.12) !important;
}

/* Remember */
.remember {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 6px 0 16px !important;
  font-size: 14px !important;
  color: #2b2f3a !important;
}

.remember input {
  width: 16px !important;
  height: 16px !important;
  accent-color: var(--brand-blue) !important;
}

/* Submit row */
.submit-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  flex-wrap: wrap !important;
}

#login-stepup-actions {
  width: 100% !important;
  margin-top: 12px !important;
  justify-content: stretch !important;
  gap: 10px !important;
}

#login-stepup-actions .btn {
  flex: 1 1 0 !important;
  min-width: 0 !important;
}

#login-stepup-cancel {
  background: rgba(255, 255, 255, 0.82) !important;
  color: #2d318f !important;
  border-color: rgba(57, 62, 179, 0.24) !important;
  box-shadow: none !important;
}

#login-stepup-cancel:hover {
  background: rgba(238, 241, 255, 0.95) !important;
  box-shadow: none !important;
}

.btn {
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 40px !important;
  padding: 0 20px !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif !important;
  letter-spacing: 0.01em !important;
  cursor: pointer !important;
  background: var(--cta-blue) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(57, 62, 179, 0.24) !important;
  transition:
    transform 0.08s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  border-radius: 30px !important;
}
.btn:active {
  transform: translateY(1px) !important;
}
.btn:hover {
  transform: translateY(-1px) !important;
  background: #3137a6 !important;
  box-shadow: 0 14px 28px rgba(57, 62, 179, 0.28) !important;
}
.btn:focus-visible {
  outline: none !important;
  box-shadow:
    0 0 0 4px rgba(57, 62, 179, 0.14),
    0 10px 24px rgba(57, 62, 179, 0.24) !important;
}

.forgot {
  font-size: 14px !important;
  color: var(--brand-blue) !important;
  text-decoration: none !important;
  font-weight: 700 !important;
}
.forgot:hover {
  text-decoration: underline !important;
}

/* Back link */
.back {
  margin-top: 18px !important;
  margin-bottom: 6px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  justify-content: center !important;
}
.back-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.back-icon {
  width: 30px !important;
  height: 30px !important;
  display: grid !important;
  place-items: center !important;
  color: var(--brand-blue) !important;
}
.back-icon::before {
  background: currentColor;
  content: "";
  display: block;
  height: 100%;
  width: 100%;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H6'/%3E%3Cpath d='M11 7l-5 5 5 5'/%3E%3C/svg%3E")
    center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H6'/%3E%3Cpath d='M11 7l-5 5 5 5'/%3E%3C/svg%3E")
    center/contain no-repeat;
}

.back--icon-only {
  position: absolute !important;
  top: 18px !important;
  left: 18px !important;
  margin: 0 !important;
  width: 42px !important;
  height: 42px !important;
  justify-content: center !important;
  text-decoration: none !important;
  border-radius: 999px !important;
  color: var(--muted) !important;
  font-family:
    "Open Sans",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif !important;
  transition:
    transform 0.15s ease,
    color 0.15s ease !important;
}

.back--icon-only:hover {
  transform: translateX(-2px) !important;
  text-decoration: none !important;
}

.back--icon-only:hover .back-icon {
  color: #1e293b !important;
}

.back--icon-only:focus-visible {
  outline: 3px solid rgba(57, 62, 179, 0.18) !important;
  outline-offset: 4px !important;
}

/* Welcome panel */
.welcome-panel {
  flex: 1 1 60% !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
  padding: 30px !important;
  color: #fff !important;
  background-color: #020101 !important;
  background-image: url("https://studerahp.se/wp-content/uploads/2025/02/login-side.webp") !important;
  background-size: cover !important;
  background-position: center !important;
  border-radius: 10px 0 0 10px !important;
  max-width: 400px !important;
}

.welcome-logo {
  position: absolute !important;
  top: 14px !important;
  left: 10px !important;
  padding: 26px 0 0 12px !important;
}
.welcome-logo img {
  width: 130px !important;
  height: auto !important;
  display: block !important;
}
.welcome-copy {
  padding-left: 0 !important;
}

.welcome-title {
  margin: 0 !important;
  font-size: 39px !important;
  font-weight: 800 !important;
  line-height: 1.05 !important;
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif !important;
  margin-bottom: 20px !important;
}

.welcome-text {
  margin: 10px 0 26px !important;
  font-size: 16px !important;
  color: rgba(255, 255, 255, 0.92) !important;
  max-width: 42ch !important;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
}

.welcome-cta {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  background: var(--cta-blue) !important;
  color: #fff !important;
  font-family:
    "Open Sans",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif !important;
  font-weight: 700 !important;
  border-radius: 30px !important;
  padding: 9px 18px !important;
  box-shadow: 0 12px 26px rgba(51, 57, 221, 0.25) !important;
  border: 1px #fff solid;
}
.welcome-cta:hover {
  filter: brightness(1.03) !important;
}

.login-error {
  width: 100% !important;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(221, 51, 115, 0.1);
  border: 1px solid rgba(221, 51, 115, 0.25);
  color: #6a1b3a;
  font-family:
    "Open Sans",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 10px !important;
}

.login-error[data-type="info"] {
  background: rgba(51, 57, 221, 0.08);
  border-color: rgba(51, 57, 221, 0.24);
  color: #2d318f;
}

/* Mobile */
@media (max-width: 767px) {
  .field input[type="text"],
  .field input[type="password"],
  .field input[type="email"],
  .field input[type="search"],
  .field input[type="tel"],
  .field input[type="url"],
  .field input[type="number"],
  .field textarea,
  .field select {
    font-size: 16px !important;
  }

  .login-page {
    padding: 16px 10px !important;
  }
  .login-shell {
    width: 100% !important;
    padding: 10px !important;
  }

  .login-card {
    width: 100% !important;
    flex-direction: column-reverse !important;
    min-height: auto !important;
    background: rgb(255 255 255 / 88%) !important;
  }

  .welcome-panel {
    border-radius: 10px 10px 0 0 !important;
    padding: 0 !important;
    align-items: center !important;
    text-align: left !important;
    max-width: none !important;
  }

  .welcome-logo {
    position: static !important;
    padding: 0 !important;
    margin-top: 26px;
  }

  .welcome-title {
    font-size: 30px !important;
    padding: 40px 30px 15px 30px !important;
    margin-bottom: 0px !important;
  }

  .form-title {
    padding-top: 18px !important;
    font-size: 34px !important;
  }

  .form-subtitle {
    font-size: 13px !important;
    margin-top: 8px !important;
  }

  .welcome-text {
    font-size: 15px !important;
    padding: 0 30px !important;
    margin-bottom: 18px !important;
  }
  .welcome-cta {
    margin: 0 0 30px 30px !important;
  }

  .form-inner {
    width: min(520px, 80%) !important;
  }

  .back--icon-only {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    margin: 10px 0 0 !important;
    justify-content: center !important;
    gap: 10px !important;
    border-radius: 0 !important;
    transform: none !important;
  }

  .back--icon-only:hover {
    transform: none !important;
    text-decoration: underline !important;
  }

  .back--icon-only .back-icon {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
  }

  .back--icon-only .back-label {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    color: #343434 !important;
  }

  body {
    background-position: left bottom !important;
  }

  .form-panel {
    padding-bottom: 20px;
  }

  #login-stepup-actions {
    flex-direction: column !important;
  }

  #login-stepup-actions .btn {
    width: 100% !important;
  }
}
.social-auth {
  display: grid;
  gap: 12px;
  margin: 18px 0 14px;
}

.btn--social {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 52px !important;
  padding: 0 20px 0 64px !important;
  box-sizing: border-box !important;
  border-radius: 14px !important;
  text-align: center !important;
  text-decoration: none !important;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease !important;
}

.btn--social__icon {
  position: absolute !important;
  left: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  flex: 0 0 auto !important;
  display: grid !important;
  place-items: center !important;
  width: 34px !important;
  height: 34px !important;
  margin-right: 0 !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 1px 2px rgba(15, 23, 42, 0.06) !important;
}

.btn--social__icon svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

.btn--social__label {
  display: block !important;
  width: 100% !important;
  line-height: 1.2 !important;
  color: inherit !important;
}

.btn--social-google {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  color: #1f2937 !important;
  border: 1px solid rgba(148, 163, 184, 0.32) !important;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.08),
    0 2px 6px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
}

.btn--social-google:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
  color: #111827 !important;
  border-color: rgba(59, 130, 246, 0.28) !important;
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.12),
    0 4px 10px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
}

.btn--social:hover {
  transform: translateY(-1px) !important;
}

.btn--social:active {
  transform: translateY(0) !important;
}

.btn--social:focus-visible {
  outline: 3px solid rgba(26, 115, 232, 0.28) !important;
  outline-offset: 2px !important;
}

.social-auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.social-auth__divider::before,
.social-auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.35);
}

@media (max-width: 480px) {
  .btn--social {
    min-height: 50px !important;
    padding: 0 16px 0 58px !important;
  }

  .btn--social__label {
    font-size: 14px !important;
  }

  .btn--social__icon {
    left: 14px !important;
    width: 32px !important;
    height: 32px !important;
  }
}
