/* =========================================================================
   iSeodang Auth UX — WordPress integration layer
   Everything here exists to make auth.css sit correctly inside Astra,
   Tutor LMS and Ultimate Member. Nothing here is part of the design system.
   ========================================================================= */

/* ----------------------------------------------------------------
   1. Full-canvas auth pages (register / login / reset)
   Astra chrome is hidden so the split screen owns the viewport.
   Remove the `ia-auth-fullscreen` body class (filter `ia_auth_fullscreen`)
   to keep the site header and footer instead.
   ---------------------------------------------------------------- */
body.ia-auth-fullscreen #masthead,
body.ia-auth-fullscreen .site-header,
body.ia-auth-fullscreen .ast-above-header-wrap,
body.ia-auth-fullscreen .ast-below-header-wrap,
body.ia-auth-fullscreen .site-footer,
body.ia-auth-fullscreen #ast-scroll-top,
body.ia-auth-fullscreen .ast-breadcrumbs-wrapper,
body.ia-auth-fullscreen .entry-header {
  display: none !important;
}

body.ia-auth-fullscreen #content,
body.ia-auth-fullscreen #content > .ast-container,
body.ia-auth-fullscreen #primary,
body.ia-auth-fullscreen #main,
body.ia-auth-fullscreen .ast-article-single,
body.ia-auth-fullscreen .entry-content,
body.ia-auth-fullscreen .entry-content.clear {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.ia-auth-fullscreen #page { padding: 0 !important; }
body.ia-auth-fullscreen { background: #f4f8fc; }

@media (prefers-color-scheme: dark) {
  body.ia-auth-fullscreen:not([data-ia-theme="light"]) { background: #0b1220; }
}

/* Astra clearfix pseudo-elements can add stray space above the shell. */
body.ia-auth-fullscreen .entry-content.clear::before,
body.ia-auth-fullscreen .entry-content.clear::after { content: none !important; }

/* The embedded shell is a `.ia-scope` in its own right. */
.ia-embed { display: block; width: 100%; }
.ia-embed .ia-shell { min-height: 100vh; min-height: 100svh; }

/* When the theme header stays visible, don't force a full viewport height. */
body:not(.ia-auth-fullscreen) .ia-embed .ia-shell { min-height: 0; }
body:not(.ia-auth-fullscreen) .ia-embed .ia-main { padding-top: 56px; padding-bottom: 72px; }

/* Astra/Tutor typography must not leak into the card. */
.ia-scope h1, .ia-scope h2, .ia-scope h3,
.ia-scope p, .ia-scope label, .ia-scope input,
.ia-scope button, .ia-scope a, .ia-scope li {
  font-family: var(--ia-font);
}
.ia-scope .ia-aside h1 { color: #fff; }
.ia-scope ul { list-style: none; }

/* Multi-line server error summary */
.ia-alert__line { display: block; }
.ia-alert__line + .ia-alert__line { margin-top: 2px; }

/* ----------------------------------------------------------------
   2. Social login button injected by Nextend
   Nextend appends its container to the end of the form via JS, so the
   form is a flex column and the container is pulled back to the top.
   ---------------------------------------------------------------- */
.ia-form { display: flex; flex-direction: column; }
.ia-form > [id^="nsl-custom-login-form"],
.ia-form > .nsl-container { order: -20; }
/* Kept separate: a browser without :has() would otherwise drop the rule above. */
.ia-form > div:has(> .nsl-container) { order: -20; }
.ia-form > .ia-order-social-divider { order: -10; }

.ia-form .nsl-container { display: block !important; margin: 0 0 2px !important; }
.ia-form .nsl-container-buttons { padding: 0 !important; display: grid !important; gap: 10px; }
.ia-form .nsl-container .nsl-button {
  border-radius: var(--ia-r-md) !important;
  border: 1.5px solid var(--ia-line-strong) !important;
  height: 50px !important;
  box-shadow: none !important;
  transition: background .22s, border-color .22s;
}
.ia-form .nsl-container .nsl-button:hover { border-color: var(--ia-ink-400) !important; }
.ia-form .nsl-container .nsl-button-label-container {
  font-family: var(--ia-font) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--ia-text) !important;
}

/* ----------------------------------------------------------------
   3. Tutor LMS leftovers inside our form
   ---------------------------------------------------------------- */
.ia-scope .tutor-form-group,
.ia-scope .tutor-form-row,
.ia-scope .tutor-input-field { margin: 0 !important; padding: 0 !important; }

.ia-legalconsent .tutor-form-group,
.ia-legalconsent .tutor-input-wrapper { margin: 0 0 10px !important; }
.ia-legalconsent label,
.ia-legalconsent .tutor-label {
  font-size: 13.6px !important;
  line-height: 1.55 !important;
  color: var(--ia-text-mid) !important;
  font-family: var(--ia-font) !important;
}
.ia-legalconsent a { color: var(--ia-brand-600) !important; font-weight: 600; }
.ia-legalconsent input[type="checkbox"] { accent-color: var(--ia-brand-600); width: 18px; height: 18px; }

/* ----------------------------------------------------------------
   4. Ultimate Member re-skin (login + password reset)
   The form markup is untouched — only its appearance changes.
   ---------------------------------------------------------------- */
.ia-embedbody .um,
.ia-embedbody .um-form {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: var(--ia-font) !important;
}
.ia-embedbody .um-row,
.ia-embedbody .um-col-1 { margin: 0 !important; padding: 0 !important; }
.ia-embedbody .um-field { margin: 0 0 18px !important; padding: 0 !important; }

.ia-embedbody .um-field-label { margin: 0 0 7px !important; padding: 0 !important; border: 0 !important; }
.ia-embedbody .um-field-label label {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--ia-text-mid) !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ia-embedbody .um-form-field,
.ia-embedbody input[type="text"],
.ia-embedbody input[type="email"],
.ia-embedbody input[type="password"] {
  width: 100% !important;
  height: 50px !important;
  padding: 0 14px !important;
  font-family: var(--ia-font) !important;
  font-size: 16px !important;
  color: var(--ia-text) !important;
  background: var(--ia-surface) !important;
  border: 1.5px solid var(--ia-line-strong) !important;
  border-radius: var(--ia-r-md) !important;
  box-shadow: none !important;
  transition: border-color .22s, box-shadow .22s;
}
.ia-embedbody .ia-inputwrap--trail input[type="password"],
.ia-embedbody .ia-inputwrap--trail input[type="text"] { padding-right: 46px !important; }

.ia-embedbody .um-form-field:focus,
.ia-embedbody input[type="text"]:focus,
.ia-embedbody input[type="email"]:focus,
.ia-embedbody input[type="password"]:focus {
  outline: none !important;
  border-color: var(--ia-brand-600) !important;
  box-shadow: var(--ia-ring) !important;
}
.ia-embedbody .um-form-field.not-valid { border-color: var(--ia-err) !important; }

/* Checkbox — UM keeps the real input, so :checked drives the visual box. */
.ia-embedbody .um-field-checkbox {
  display: flex !important;
  align-items: center !important;
  gap: 11px !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  font-size: 13.6px !important;
  color: var(--ia-text-mid) !important;
  cursor: pointer;
}
.ia-embedbody .um-field-checkbox-state {
  flex: none;
  width: 20px !important; height: 20px !important;
  border: 1.5px solid var(--ia-line-strong) !important;
  border-radius: 6px !important;
  background: var(--ia-surface) !important;
  display: grid !important;
  place-items: center;
  transition: all .22s;
}
.ia-embedbody .um-field-checkbox-state i { display: none !important; }
.ia-embedbody .um-field-checkbox-state::after {
  content: ""; width: 9px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0); margin-top: -2px;
  transition: transform .22s;
}
.ia-embedbody .um-field-checkbox input:checked + .um-field-checkbox-state {
  background: var(--ia-brand-600) !important;
  border-color: var(--ia-brand-600) !important;
}
.ia-embedbody .um-field-checkbox input:checked + .um-field-checkbox-state::after { transform: rotate(-45deg) scale(1); }
.ia-embedbody .um-field-checkbox-option { color: var(--ia-text-mid) !important; }

/* Buttons */
.ia-embedbody .um-button,
.ia-embedbody input[type="submit"].um-button,
.ia-embedbody #um-submit-btn {
  width: 100% !important;
  height: 52px !important;
  display: inline-flex !important;
  align-items: center; justify-content: center;
  font-family: var(--ia-font) !important;
  font-size: 15.5px !important;
  font-weight: 700 !important;
  border-radius: var(--ia-r-md) !important;
  border: 1.5px solid transparent !important;
  background: linear-gradient(180deg, var(--ia-brand-500), var(--ia-brand-600)) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px -8px rgba(4, 107, 210, .55) !important;
  text-shadow: none !important;
  transition: background .22s, box-shadow .22s;
}
.ia-embedbody .um-button:hover,
.ia-embedbody #um-submit-btn:hover {
  background: linear-gradient(180deg, var(--ia-brand-600), var(--ia-brand-700)) !important;
}

/* The card already offers "Create one free" at the bottom, so UM's own
   secondary Register button is redundant and the primary goes full width. */
.ia-embedbody .um-col-alt { margin: 20px 0 0 !important; padding: 0 !important; }
.ia-embedbody .um-col-alt .um-left.um-half,
.ia-embedbody .um-col-alt .um-right.um-half { width: 100% !important; float: none !important; margin: 0 !important; }
.ia-auth--login .ia-embedbody .um-col-alt .um-right.um-half { display: none !important; }

.ia-embedbody .um-col-alt-b { margin: 14px 0 0 !important; text-align: center !important; }
.ia-embedbody .um-link-alt,
.ia-embedbody .um-col-alt-b a {
  color: var(--ia-brand-600) !important;
  font-size: 13.8px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}
.ia-embedbody .um-link-alt:hover { text-decoration: underline !important; }

/* Notices */
.ia-embedbody .um-notice {
  border-radius: var(--ia-r-md) !important;
  padding: 13px 15px !important;
  margin: 0 0 18px !important;
  font-size: 13.6px !important;
  font-family: var(--ia-font) !important;
  border: 1px solid transparent !important;
}
.ia-embedbody .um-notice.err {
  background: var(--ia-err-bg) !important;
  color: #a4231a !important;
  border-color: rgba(217, 45, 32, .22) !important;
}
.ia-embedbody .um-notice.success {
  background: var(--ia-ok-bg) !important;
  color: #0c6b41 !important;
  border-color: rgba(18, 148, 90, .22) !important;
}

/* Honeypot stays hidden */
.ia-embedbody .um_request_name { display: none !important; }

/* Nextend block on the login page sits under the form */
.ia-embedbody .nsl-container { margin-top: 18px !important; }
.ia-embedbody .nsl-container-buttons { padding: 0 !important; }
.ia-embedbody .nsl-container .nsl-button {
  border-radius: var(--ia-r-md) !important;
  border: 1.5px solid var(--ia-line-strong) !important;
  height: 50px !important;
  box-shadow: none !important;
}

/* Ultimate Member ships its own dark-ish defaults for some elements; make sure
   text stays readable when the visitor is in dark mode. */
@media (prefers-color-scheme: dark) {
  .ia-scope:not([data-ia-theme="light"]) .ia-embedbody .um-form-field,
  .ia-scope:not([data-ia-theme="light"]) .ia-embedbody input[type="text"],
  .ia-scope:not([data-ia-theme="light"]) .ia-embedbody input[type="email"],
  .ia-scope:not([data-ia-theme="light"]) .ia-embedbody input[type="password"] {
    background: var(--ia-surface) !important;
    color: var(--ia-text) !important;
  }
}

/* ----------------------------------------------------------------
   5. "Choose your registration" page
   Applies when the page content is replaced with the supplied HTML block.
   ---------------------------------------------------------------- */
body.ia-auth--choose .entry-header { display: none; }
body.ia-auth--choose .ia-page { padding-top: 44px; }
