/* ==========================================================================
   Sepo Bridge — styled login page (single-card layout)
   The whole page is ONE card: logo, title, form, then a compact footer row
   with "Lost your password?" and "Go to site" right under the button.
   Applies to log in, lost password, reset password and register screens.
   Colours, logo, title and footer come from the feature's settings.
   ========================================================================== */

html,
body.login {
  --primary: #00bcd4;
  --primary-dark: #2e6b76;
  --slate: #817c94;
  --surface: rgba(255, 255, 255, 0.9);
  --border: #e0e6e8;
  --text-main: #333333;
  --error: #c0392b;
  --error-bg: #fff5f5;
  --error-border: #fed7d7;
  --ok: #2e7d5b;
  --ok-bg: #f1faf5;
  --ok-border: #c9ead9;
}

body.login *,
body.login *::before,
body.login *::after {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Page
   -------------------------------------------------------------------------- */

body.login {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 45%),
    radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--primary-dark) 14%, transparent), transparent 45%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, #fff), color-mix(in srgb, var(--primary) 30%, #fff));
  background-attachment: fixed;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  min-height: 100vh;
  height: auto;
  margin: 0;
  padding: 24px 16px;
}

/* --------------------------------------------------------------------------
   Card — #login is the card; its children sit on a 2-column grid so the two
   footer links share one row instead of stacking.
   -------------------------------------------------------------------------- */

#login {
  width: 100%;
  max-width: 400px;
  margin: 0;
  padding: 36px 40px 22px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

#login > * {
  grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   Logo and title
   -------------------------------------------------------------------------- */

#login h1,
#login .wp-login-logo {
  margin: 0 0 6px;
  text-align: center;
}

#login h1 a,
#login .wp-login-logo a {
  width: 72px !important;
  height: 72px !important;
  background-size: contain !important;
  background-position: center !important;
  margin: 0 auto !important;
}

#login .sepo-login-title {
  margin: 0 0 22px;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--slate);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Forms (no card styling of their own — the card is #login)
   -------------------------------------------------------------------------- */

#login form {
  background: transparent;
  padding: 0;
  margin: 0;
  border: none;
  box-shadow: none !important;
  overflow: visible;
}

/* --------------------------------------------------------------------------
   Labels and inputs
   -------------------------------------------------------------------------- */

#login form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
  text-align: left;
  display: block;
  margin-bottom: 5px;
}

#login form input[type="text"],
#login form input[type="password"],
#login form input[type="email"] {
  width: 100%;
  min-height: 0;
  padding: 12px 15px;
  margin: 0 0 15px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  background: #ffffff;
  box-shadow: none;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Focus ring — kept so keyboard users can see where they are */
#login form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

#login form .description,
#login form .indicator-hint,
#login #pass-strength-result {
  font-size: 12px;
  color: var(--slate);
  text-align: left;
}

#login #pass-strength-result {
  width: 100%;
  margin: -6px 0 15px;
  border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Password field and show-password toggle
   -------------------------------------------------------------------------- */

#login form .wp-pwd {
  position: relative;
  margin-bottom: 15px;
}

#login form .wp-pwd input[type="password"],
#login form .wp-pwd input[type="text"] {
  margin-bottom: 0;
  padding-right: 45px;
}

#login form .wp-pwd .button.wp-hide-pw {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 32px;
  min-height: 0;
  padding: 0;
  margin: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--slate);
}

#login form .wp-pwd .button.wp-hide-pw:hover,
#login form .wp-pwd .button.wp-hide-pw:focus {
  color: var(--primary-dark);
  background: transparent !important;
  box-shadow: none !important;
}

#login form .wp-pwd .button.wp-hide-pw:focus-visible {
  outline: 2px solid var(--primary-dark) !important;
  outline-offset: 1px;
  border-radius: 6px;
}

#login form .wp-pwd .button.wp-hide-pw .dashicons {
  width: 20px;
  height: 20px;
  font-size: 20px;
  line-height: 1;
  top: 0;
}

/* --------------------------------------------------------------------------
   Remember me
   -------------------------------------------------------------------------- */

#login form .forgetmenot {
  float: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 18px;
  font-size: 13px;
  color: var(--slate);
}

#login form .forgetmenot label {
  margin: 0;
  font-weight: 500;
}

#login form .forgetmenot input[name="rememberme"] {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Primary button — flat
   -------------------------------------------------------------------------- */

#login form .submit,
#login form .reset-pass-submit {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#login .button-primary {
  float: none !important;
  width: 100%;
  padding: 12px;
  height: auto;
  min-height: 0;
  margin: 0;
  background: var(--primary) !important;
  border: none !important;
  border-radius: 8px;
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: none !important;
  text-shadow: none !important;
  transition: background-color 0.2s ease;
}

#login .button-primary:hover,
#login .button-primary:focus,
#login .button-primary:active {
  background: var(--primary-dark) !important;
  box-shadow: none !important;
  outline: none !important;
}

#login .button-primary:focus-visible {
  outline: 2px solid var(--primary-dark) !important;
  outline-offset: 2px;
}

#login .button-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* "Generate password" on the reset screen */
#login form .reset-pass-submit .button:not(.button-primary) {
  width: 100%;
  padding: 10px;
  height: auto;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--slate);
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Footer links — one compact row under the button:
   [ Lost your password? ]                    [ ← Go to site ]
   Prefixed with #login so they beat core's ".login #nav" margins/padding.
   -------------------------------------------------------------------------- */

#login #nav,
#login #backtoblog,
#login .privacy-policy-page-link {
  margin: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.3;
  background: transparent;
  border: none;
}

#login #nav,
#login #backtoblog {
  margin-top: 18px;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
  align-self: start;
}

#login #nav {
  grid-column: 1;
  text-align: left;
}

#login #backtoblog {
  grid-column: 2;
  text-align: right;
}

/* Only one of the two present: it takes the whole row */
#login #nav:only-of-type,
#login #backtoblog:only-of-type {
  grid-column: 1 / -1;
  text-align: center;
}

#login #nav a,
#login #backtoblog a,
#login .privacy-policy-page-link a {
  color: var(--slate) !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s ease;
}

#login #nav a:hover,
#login #nav a:focus,
#login #backtoblog a:hover,
#login #backtoblog a:focus,
#login .privacy-policy-page-link a:hover,
#login .privacy-policy-page-link a:focus {
  color: var(--primary-dark) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
}

#login .privacy-policy-page-link {
  text-align: center;
  margin-top: 10px;
}

#login .privacy-policy-page-link a {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Messages / errors / success
   -------------------------------------------------------------------------- */

#login .message,
#login .success,
#login .notice,
#login #login_error {
  margin: 0 0 16px;
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  border-radius: 8px;
  border: 1px solid var(--border);
  border-left-width: 1px;
  background: #fff;
  color: var(--text-main);
  box-shadow: none;
  overflow-wrap: anywhere;
}

#login .message,
#login .success {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: var(--ok-border);
}

#login .error,
#login #login_error {
  color: var(--error);
  background: var(--error-bg);
  border-color: var(--error-border);
}

/* --------------------------------------------------------------------------
   Outside the card
   -------------------------------------------------------------------------- */

.login .language-switcher {
  margin-top: 16px;
  padding: 0;
}

.login .language-switcher form {
  box-shadow: none;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.sepo-login-footer {
  margin: 18px 0 0;
  font-size: 11px;
  color: var(--slate);
  text-align: center;
}

.sepo-login-footer a {
  color: inherit;
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 420px) {
  #login {
    padding: 28px 22px 18px;
  }

  #login #nav,
  #login #backtoblog {
    grid-column: 1 / -1;
    text-align: center;
  }

  #login #backtoblog {
    margin-top: 0;
    padding-top: 8px;
    border-top: 0;
  }
}

/* ==========================================================================
   Looks. "card" is everything above; the others build on it.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Gradient: a light card on a full gradient of the two colours, with
   underlined fields and a button in the same gradient.
   -------------------------------------------------------------------------- */

body.login.sepo-login--gradient {
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  background-attachment: fixed;
}

body.sepo-login--gradient #login {
  max-width: 420px;
  padding: 34px 40px 24px;
  background: #f4f4f5;
  border: 0;
  border-radius: 14px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body.sepo-login--gradient #login .sepo-login-title {
  margin-bottom: 20px;
  font-size: 1.65rem;
  font-weight: 700;
  color: #111;
}

body.sepo-login--gradient #login form input[type="text"],
body.sepo-login--gradient #login form input[type="password"],
body.sepo-login--gradient #login form input[type="email"] {
  padding: 10px 6px;
  margin-bottom: 18px;
  border: 0;
  border-bottom: 2px solid #a9a9ae;
  border-radius: 0;
  background: transparent;
  font-size: 16px;
}

body.sepo-login--gradient #login form .wp-pwd { margin-bottom: 18px; }
body.sepo-login--gradient #login form .wp-pwd input { margin-bottom: 0; }

body.sepo-login--gradient #login form input:focus {
  border-bottom-color: var(--primary-dark);
  box-shadow: none;
}

body.sepo-login--gradient #login .button-primary {
  padding: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark)) !important;
}

body.sepo-login--gradient #login .button-primary:hover,
body.sepo-login--gradient #login .button-primary:focus {
  background: var(--primary-dark) !important;
}

body.sepo-login--gradient #login #nav,
body.sepo-login--gradient #login #backtoblog {
  border-top: 0;
}

body.sepo-login--gradient .sepo-login-footer,
body.sepo-login--gradient .language-switcher {
  color: #fff;
}

/* --------------------------------------------------------------------------
   Split looks: one framed page in two halves. The panel comes from the
   plugin (aside.sepo-login-aside); the form keeps everything above.
   -------------------------------------------------------------------------- */

html:has(body.sepo-login--split) {
  min-height: 100%;
  background: color-mix(in srgb, var(--primary) 6%, #ececec);
}

html:has(body.sepo-login--quote),
html:has(body.sepo-login--quotecover) {
  background: color-mix(in srgb, var(--primary-dark) 82%, #000);
}

body.login.sepo-login--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto auto;
  align-items: center;
  justify-items: center;
  width: calc(100% - 48px);
  max-width: 1180px;
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
}

body.sepo-login--split > *:not(.sepo-login-aside) {
  grid-column: 2;
}

body.sepo-login--split .sepo-login-aside {
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: stretch;
  justify-self: stretch;
  position: relative;
  overflow: hidden;
}

/* The form on the left and the panel on the right */
body.sepo-login--brand > *:not(.sepo-login-aside),
body.sepo-login--quote > *:not(.sepo-login-aside),
body.sepo-login--quotecover > *:not(.sepo-login-aside) {
  grid-column: 1;
}

body.sepo-login--brand .sepo-login-aside,
body.sepo-login--quote .sepo-login-aside,
body.sepo-login--quotecover .sepo-login-aside {
  grid-column: 2;
  margin: 14px;
  border-radius: 18px;
}

body.sepo-login--split #login {
  max-width: 420px;
  padding: 32px 36px 16px;
  background: transparent;
  border: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body.sepo-login--split .sepo-login-footer {
  margin: 0 0 22px;
}

body.sepo-login--split .language-switcher {
  margin: 0 0 12px;
}

body.sepo-login--split #login .sepo-login-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Photo */
.sepo-login-aside-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The body cannot clip its children (its overflow belongs to the window), so the photo rounds its own corners. */
body.sepo-login--photo .sepo-login-aside {
  border-radius: 24px 0 0 24px;
}

.sepo-login-aside--photo .sepo-login-aside-img {
  position: absolute;
  inset: 0;
}

.sepo-login-aside-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, var(--primary), var(--primary-dark));
}

/* Brand panel: deep main colour, a picture, a headline and a line under it */
.sepo-login-aside--brand {
  display: flex;
  align-items: flex-end;
  background: color-mix(in srgb, var(--primary-dark) 82%, #000);
  color: #fff;
}

.sepo-login-aside-inner {
  width: 100%;
  margin: 0;
  padding: 48px;
}

.sepo-login-aside--brand .sepo-login-aside-pic {
  margin: 0 0 36px;
}

.sepo-login-aside-pic .sepo-login-aside-img {
  height: auto;
  max-height: 46vh;
  border-radius: 16px;
}

.sepo-login-aside-head {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.sepo-login-aside-text {
  margin: 0;
  max-width: 34em;
  font-size: 1.02rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

/* Quote: a soft panel with large quotation marks and an optional picture */
.sepo-login-aside--quote {
  display: flex;
  align-items: stretch;
  background: color-mix(in srgb, var(--primary) 10%, #fbf8f1);
  color: var(--text-main);
}

.sepo-login-aside--quote .sepo-login-aside-inner {
  display: flex;
  flex-direction: column;
  padding: 56px 52px 0;
}

.sepo-login-quote {
  position: relative;
  margin: 0;
  padding: 34px 0 0;
}

.sepo-login-quote::before {
  content: "\201C";
  position: absolute;
  top: -18px;
  left: -4px;
  font: 700 72px/1 Georgia, serif;
  color: var(--primary-dark);
}

.sepo-login-quote p {
  margin: 0;
  font-size: clamp(1.25rem, 1.8vw, 1.55rem);
  font-weight: 600;
  line-height: 1.5;
  color: #1d2522;
}

.sepo-login-quote-by {
  margin: 22px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #4a5551;
}

.sepo-login-quote-by::before {
  content: "— ";
}

/* The picture fills the space under the quote, cropped to cover it. */
.sepo-login-aside--quote .sepo-login-aside-pic {
  position: relative;
  flex: 1 1 auto;
  min-height: 180px;
  margin-top: 36px;
}

.sepo-login-aside--quote .sepo-login-aside-pic .sepo-login-aside-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 14px 14px 0 0;
  object-fit: cover;
  object-position: center 30%;
}

/* Quote on picture: the picture covers the whole panel, the quote sits on a shade at the bottom */
.sepo-login-aside--quotecover {
  display: flex;
  align-items: flex-end;
  background: color-mix(in srgb, var(--primary-dark) 82%, #000);
  color: #fff;
}

.sepo-login-aside--quotecover > .sepo-login-aside-img,
.sepo-login-aside--quotecover > .sepo-login-aside-fill {
  position: absolute;
  inset: 0;
}

.sepo-login-aside--quotecover > .sepo-login-aside-img {
  object-position: center 30%;
}

.sepo-login-aside-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.55) 40%, rgba(0, 0, 0, 0.12) 75%, rgba(0, 0, 0, 0) 100%);
}

.sepo-login-aside--quotecover .sepo-login-aside-inner {
  position: relative;
  z-index: 1;
  padding: 48px 52px 52px;
}

.sepo-login-aside--quotecover .sepo-login-quote::before {
  color: #fff;
}

.sepo-login-aside--quotecover .sepo-login-quote p {
  color: #fff;
}

.sepo-login-aside--quotecover .sepo-login-quote-by {
  color: rgba(255, 255, 255, 0.9);
}

/* Phones and narrow windows: the form alone, the panel steps aside */
@media (max-width: 860px) {
  html:has(body.sepo-login--split),
  html:has(body.sepo-login--quote),
  html:has(body.sepo-login--quotecover) {
    background: #fff;
  }

  body.login.sepo-login--split {
    display: flex;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 24px 16px;
    border-radius: 0;
  }

  body.sepo-login--split .sepo-login-aside {
    display: none;
  }

  body.sepo-login--split #login {
    padding: 28px 8px 16px;
  }

  body.sepo-login--gradient #login {
    padding: 40px 26px 28px;
  }
}

/* --------------------------------------------------------------------------
   Short windows (laptops, browsers with many bars): everything closer
   together, so the whole form fits without scrolling in every look.
   -------------------------------------------------------------------------- */

@media (max-height: 900px) {
  body.login { padding-top: 16px; padding-bottom: 16px; }
  #login { padding-top: 26px; padding-bottom: 18px; }
  #login h1 a,
  #login .wp-login-logo a { width: 56px !important; height: 56px !important; }
  #login .sepo-login-title,
  body.sepo-login--gradient #login .sepo-login-title,
  body.sepo-login--split #login .sepo-login-title { margin-bottom: 14px; font-size: 1.4rem; }
  #login form input[type="text"],
  #login form input[type="password"],
  #login form input[type="email"] { padding-top: 9px; padding-bottom: 9px; margin-bottom: 12px; }
  #login form .wp-pwd,
  body.sepo-login--gradient #login form .wp-pwd { margin-bottom: 12px; }
  body.sepo-login--gradient #login form input[type="text"],
  body.sepo-login--gradient #login form input[type="password"],
  body.sepo-login--gradient #login form input[type="email"] { margin-bottom: 12px; }
  #login form label { margin-bottom: 3px; }
  #login form .forgetmenot { margin: 0 0 12px; }
  #login .button-primary,
  body.sepo-login--gradient #login .button-primary { padding: 10px; }
  #login #nav,
  #login #backtoblog { margin-top: 12px; padding-top: 10px; }
  .sepo-login-footer { margin-top: 10px; }
  body.login.sepo-login--split { margin: 16px auto; min-height: calc(100vh - 32px); }
  body.sepo-login--split #login { padding-top: 20px; }
  .sepo-login-aside-inner { padding: 36px; }
  .sepo-login-aside--quote .sepo-login-aside-inner { padding: 40px 40px 0; }
  .sepo-login-aside--quotecover .sepo-login-aside-inner { padding: 36px 40px 40px; }
  #login .sepo-si-btn { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
  #login .sepo-si-rule { margin: 10px 0 10px; }
}

@media (max-height: 720px) {
  #login h1,
  #login .wp-login-logo { margin-bottom: 2px; }
  #login h1 a,
  #login .wp-login-logo a { width: 44px !important; height: 44px !important; }
  #login .sepo-login-title,
  body.sepo-login--gradient #login .sepo-login-title,
  body.sepo-login--split #login .sepo-login-title { margin-bottom: 10px; font-size: 1.25rem; }
}
