/* ==========================================================================
   AstrophotoMarket.com - auth pages (WP-E1, redesign 2026-10)
   --------------------------------------------------------------------------
   Login, register, reset password. Loaded by layout/_auth.html.twig after apm.css.
   Split screen: form column (left) + Pelican Nebula aside (right) from 992px;
   below 992px the aside becomes a compact photo band above the form.

   Rules: px only (Metronic sets html{font-size:13px}). JS on these pages relies on
   ids, names and data-* attributes, so everything here is restyling through classes.

   Contents
     1. Page shell + layout
     2. Aside (photo, logo, headline, points, numbers, credit)
     3. Form column: heading, social buttons, separator
     4. Fields, password meter, captcha, checkboxes
     5. Buttons, links, alerts, notes
     6. Language switcher
     7. SweetAlert dialogs
     8. Mobile band (< 992px)
   ========================================================================== */


/* 1. Page shell + layout ------------------------------------------------ */

body.apm-auth {
    --bs-body-bg: #070A12;
    --bs-body-bg-rgb: 7, 10, 18;
    background-color: var(--apm-bg) !important;
    color: var(--apm-text-secondary);
}

.apm-auth-layout {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--apm-bg);
}

.apm-auth__main {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    padding: 28px 20px 24px;
    overflow: clip;
}

/* Faint blue glow behind the form so the column is not a flat slab. */
.apm-auth__main::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -180px;
    left: -160px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(64, 110, 255, .13) 0%, rgba(64, 110, 255, 0) 70%);
    pointer-events: none;
}

.apm-auth__center {
    display: flex;
    flex: 1 0 auto;
    align-items: center;
    justify-content: center;
}

.apm-auth__card {
    width: 100%;
    max-width: 440px;
}

@media (min-width: 992px) {
    .apm-auth-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    }

    .apm-auth__main {
        order: 1;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 48px 40px 28px;
    }

    .apm-auth__aside {
        order: 2;
    }
}


/* 2. Aside -------------------------------------------------------------- */

/* The aside follows the form in the DOM (heading order); on mobile it is shown above it. */
@media (max-width: 991.98px) {
    .apm-auth__aside {
        order: -1;
    }
}

.apm-auth__aside {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    overflow: clip;
    background: var(--apm-bg-deep);
}

.apm-auth-aside__img {
    object-position: 64% 50%;
}

/* Shade only where text sits: top-left for the logo, bottom for headline + numbers,
   a soft seam on the left edge. The middle of the photo stays clean. */
.apm-auth-aside__shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(4, 6, 12, .55) 0%, rgba(4, 6, 12, 0) 20%),
        linear-gradient(0deg, rgba(4, 6, 12, .96) 0%, rgba(4, 6, 12, .82) 26%, rgba(4, 6, 12, .35) 50%, rgba(4, 6, 12, 0) 66%),
        linear-gradient(90deg, rgba(7, 10, 18, .55) 0%, rgba(7, 10, 18, 0) 18%);
}

.apm-auth-aside__logo {
    position: relative;
    display: inline-flex;
    align-self: flex-start;
    border-radius: 10px;
}

.apm-auth-aside__logo img {
    display: block;
    width: auto;
    height: 44px;
}

.apm-auth-aside__content {
    position: relative;
    max-width: 600px;
}

.apm-auth-aside__title {
    margin: 0;
    font-family: var(--apm-font-display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: var(--apm-text);
    text-wrap: balance;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .45);
}

.apm-auth-aside__title .apm-hl {
    display: inline-block;
}

.apm-auth-aside__points {
    display: grid;
    gap: 14px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.apm-auth-aside__points li {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #E3E8F3;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.45;
}

.apm-auth-aside__points .apm-icon-tile {
    background: rgba(255, 127, 0, .16);
    border-color: rgba(255, 166, 64, .3);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.apm-auth-aside__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 36px;
    margin: 32px 0 0;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.apm-auth-aside__stat {
    display: flex;
    flex-direction: column-reverse;
    gap: 2px;
    padding-left: 12px;
    border-left: 2px solid var(--apm-accent);
}

.apm-auth-aside__stat--free {
    border-left-color: var(--apm-free);
}

.apm-auth-aside__stat dd {
    margin: 0;
    font-family: var(--apm-font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--apm-text);
    font-variant-numeric: tabular-nums;
}

.apm-auth-aside__stat dt {
    margin: 0;
    color: var(--apm-text-muted);
    font-size: 13px;
    font-weight: 500;
}

.apm-auth-aside__error {
    margin-top: 28px;
    max-width: 520px;
}

.apm-auth-aside__credit {
    position: relative;
    align-self: flex-end;
}

@media (min-width: 992px) {
    .apm-auth__aside {
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100dvh;
        min-height: 640px;
        padding: 36px 44px 28px;
        box-shadow: inset 1px 0 0 rgba(255, 255, 255, .06);
    }

    .apm-auth-aside__logo img {
        height: 64px;
    }

    .apm-auth-aside__content {
        margin-top: auto;
    }

    .apm-auth-aside__title {
        font-size: 40px;
    }

    .apm-auth-aside__credit {
        margin-top: 24px;
    }
}

@media (min-width: 1200px) {
    .apm-auth__aside {
        padding: 40px 56px 32px;
    }

    .apm-auth-aside__title {
        font-size: 50px;
    }
}

/* Short desktop windows (e.g. 1024x768): tighten the aside so nothing collides. */
@media (min-width: 992px) and (max-height: 820px) {
    .apm-auth-aside__title {
        font-size: 38px;
    }

    .apm-auth-aside__points {
        gap: 10px;
        margin-top: 20px;
    }

    .apm-auth-aside__points li {
        font-size: 15px;
    }

    .apm-auth-aside__stats {
        margin-top: 22px;
        padding-top: 18px;
    }

    .apm-auth-aside__stat dd {
        font-size: 24px;
    }
}


/* 3. Form column: heading, social buttons, separator -------------------- */

.apm-auth-head {
    margin-bottom: 28px;
    text-align: left;
}

.apm-auth-head__icon {
    margin-bottom: 18px;
}

.apm-auth-head__title {
    margin: 0 0 8px;
    font-family: var(--apm-font-display);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.022em;
    color: var(--apm-text);
    text-wrap: balance;
}

.apm-auth-head__lead {
    margin: 0;
    color: var(--apm-text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

@media (min-width: 992px) {
    .apm-auth-head {
        margin-bottom: 32px;
    }

    .apm-auth-head__title {
        font-size: 36px;
    }
}

.apm-auth .btn.apm-auth-social {
    height: 48px;
    gap: 10px;
    padding: 0 18px;
    border: 1px solid var(--apm-border-light);
    border-radius: 12px;
    background: var(--apm-surface);
    color: var(--apm-text);
    font-family: var(--apm-font-sans);
    font-size: 15px;
    font-weight: 600;
    box-shadow: none;
    transition: background-color .2s var(--apm-ease), border-color .2s var(--apm-ease), transform .2s var(--apm-ease);
}

.apm-auth .btn.apm-auth-social:hover,
.apm-auth .btn.apm-auth-social:focus {
    border-color: #3A4870;
    background: var(--apm-surface-hover);
    color: var(--apm-text);
}

.apm-auth .btn.apm-auth-social:active {
    transform: translateY(1px);
}

.apm-auth .btn.apm-auth-social svg {
    width: 20px;
    height: 20px;
    margin-right: 0 !important;
}

/* Facebook mark in brand blue on the dark button (the "f" is negative space). */
.apm-auth .btn.fb-login-btn svg path {
    fill: #1877F2;
}

.apm-auth .separator.apm-auth-sep {
    margin: 24px 0;
}

.apm-auth .separator.apm-auth-sep::before,
.apm-auth .separator.apm-auth-sep::after {
    border-bottom-color: var(--apm-border) !important;
}

.apm-auth-sep__label {
    flex-shrink: 0;
    padding: 0 14px;
    color: var(--apm-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}


/* 4. Fields ------------------------------------------------------------- */

.apm-auth-field {
    margin-bottom: 18px;
}

.apm-auth-field--tight {
    margin-bottom: 12px;
}

.apm-auth-label,
.apm-auth-captcha .form-label,
.apm-auth-captcha label.required {
    display: block;
    margin-bottom: 8px;
    color: var(--apm-text-secondary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

/* Form theme wraps widgets in a .mb-3 div: the field wrapper owns the spacing. */
.apm-auth-field .mb-3:not([data-kt-password-meter-control]) {
    margin-bottom: 0 !important;
}

.apm-auth .form-control,
.apm-auth .form-control.bg-transparent {
    height: 50px;
    padding: 0 16px;
    border: 1px solid var(--apm-border-light);
    border-radius: 12px;
    background-color: var(--apm-surface) !important;
    color: var(--apm-text);
    font-family: var(--apm-font-sans);
    font-size: 15px;
    font-weight: 500;
    box-shadow: none;
    transition: border-color .2s var(--apm-ease), box-shadow .2s var(--apm-ease), background-color .2s var(--apm-ease);
}

.apm-auth .form-control::placeholder {
    color: #67728E;
    font-weight: 400;
}

.apm-auth .form-control:hover {
    border-color: #3A4870;
}

.apm-auth .form-control:focus,
.apm-auth .form-control.bg-transparent:focus {
    border-color: rgba(255, 166, 64, .75);
    background-color: var(--apm-surface-hover) !important;
    box-shadow: 0 0 0 4px rgba(255, 127, 0, .14);
    color: var(--apm-text);
    outline: none;
}

.apm-auth .form-control:-webkit-autofill,
.apm-auth .form-control:-webkit-autofill:hover,
.apm-auth .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--apm-text);
    box-shadow: 0 0 0 1000px var(--apm-surface) inset;
    caret-color: var(--apm-text);
}

/* Validation states (FormValidation plugin + server-side errors). */
.apm-auth .fv-plugins-bootstrap5-row-invalid .form-control,
.apm-auth .form-control.is-invalid {
    border-color: rgba(248, 113, 113, .75);
}

.apm-auth .fv-plugins-bootstrap5-row-invalid .form-control:focus,
.apm-auth .form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(248, 113, 113, .14);
}

.apm-auth .invalid-feedback,
.apm-auth .fv-plugins-message-container.invalid-feedback {
    margin-top: 7px;
    color: #FCA5A5;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
}

/* Password field: room for the eye toggle. */
.apm-auth [data-kt-password-meter="true"] .form-control,
.apm-auth input[type="password"].form-control {
    padding-right: 52px;
}

.apm-auth .btn.apm-auth-eye {
    width: 40px;
    height: 40px;
    margin-right: 0 !important;
    transform: translate(-6px, -50%) !important;
    border-radius: 10px;
}

.apm-auth .btn.apm-auth-eye i {
    color: var(--apm-text-muted);
    font-size: 18px !important;
    transition: color .2s var(--apm-ease);
}

.apm-auth .btn.apm-auth-eye:hover i {
    color: var(--apm-text);
}

/* Password strength meter. */
.apm-auth [data-kt-password-meter-control="highlight"] {
    margin-top: 2px;
}

.apm-auth [data-kt-password-meter-control="highlight"] > div {
    height: 4px !important;
    background-color: rgba(255, 255, 255, .08) !important;
    transition: background-color .25s var(--apm-ease);
}

.apm-auth [data-kt-password-meter-control="highlight"] > div.active {
    background-color: var(--apm-free) !important;
}

.apm-auth-hint {
    color: var(--apm-text-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* Math captcha. */
.apm-auth-captcha__label {
    display: block;
    width: 100%;
    margin: 0;
}

.apm-auth .form-control.calculation {
    max-width: 180px;
    margin-top: 0;
    margin-bottom: 8px;
    font-family: var(--apm-font-mono);
    font-variant-numeric: tabular-nums;
}

/* Honeypot: kept in the DOM, pushed off-screen, never focusable by humans. */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Checkboxes (remember me, terms). */
.apm-auth .form-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding-left: 0;
    min-height: 0;
}

.apm-auth .form-check .mb-3 {
    margin-bottom: 0 !important;
}

.apm-auth .form-check-input {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 0;
    float: none;
    border: 1px solid #3A4870;
    border-radius: 6px;
    background-color: var(--apm-surface);
    cursor: pointer;
}

.apm-auth .form-check-input:checked {
    border-color: var(--apm-accent);
    background-color: var(--apm-accent);
}

.apm-auth .form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(255, 127, 0, .16);
    border-color: var(--apm-accent-light);
}

.apm-auth .form-check-label {
    margin: 0;
    padding-top: 1px;
    color: var(--apm-text-secondary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    cursor: pointer;
}

.apm-auth .form-check-label a {
    color: var(--apm-accent-light);
    font-weight: 600;
}

.apm-auth-terms {
    margin-top: 4px;
    margin-bottom: 22px;
}

/* Terms row: the form theme wraps the checkbox in a <div> and the validator appends
   its message there. Flatten that div so the message drops below the whole row. */
.apm-auth-terms .form-check {
    flex-wrap: wrap;
}

.apm-auth-terms .form-check > div {
    display: contents;
}

.apm-auth-terms .form-check .form-check-label {
    flex: 1 1 0;
    min-width: 0;
}

.apm-auth-terms .form-check .invalid-feedback {
    order: 3;
    flex-basis: 100%;
    margin-top: 2px;
}

.apm-auth-row {
    margin: 2px 0 24px;
    font-size: 14px;
}


/* 5. Buttons, links, alerts, notes ------------------------------------- */

.apm-auth-submit {
    margin: 6px 0 22px;
}

body.apm-auth .btn.btn-primary {
    height: 50px;
    padding: 0 22px;
    border: 0;
    border-radius: 12px;
    background: var(--apm-gradient-accent);
    color: var(--apm-accent-ink) !important;
    font-family: var(--apm-font-sans);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.005em;
    box-shadow: 0 8px 24px rgba(255, 127, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: transform .2s var(--apm-ease), box-shadow .2s var(--apm-ease);
}

body.apm-auth a.btn.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.apm-auth .btn.btn-primary:hover:not(:disabled),
body.apm-auth .btn.btn-primary:focus-visible {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #FFA93D 0%, #FF8710 100%);
    color: var(--apm-accent-ink) !important;
    box-shadow: 0 12px 32px rgba(255, 127, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .32);
}

body.apm-auth .btn.btn-primary:active {
    transform: translateY(0);
}

body.apm-auth .btn.btn-primary:disabled {
    opacity: .75;
}

body.apm-auth .btn.btn-primary .indicator-label,
body.apm-auth .btn.btn-primary .indicator-progress {
    color: var(--apm-accent-ink);
}

.apm-auth .link-primary,
.apm-auth-link {
    color: var(--apm-accent-light) !important;
    font-weight: 600;
    text-decoration: none;
    transition: color .2s var(--apm-ease);
}

.apm-auth .link-primary:hover,
.apm-auth-link:hover {
    color: #FFC46B !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.apm-auth-switch {
    color: var(--apm-text-muted);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.apm-auth .alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-align: left;
}

.apm-auth .alert-danger {
    border: 1px solid rgba(248, 113, 113, .42);
    background: rgba(248, 113, 113, .1);
    color: #FECACA;
}

.apm-auth .alert-success {
    border: 1px solid rgba(34, 197, 94, .38);
    background: var(--apm-free-tint);
    color: #BBF7D0;
}

.apm-auth-note {
    margin-bottom: 24px;
    padding: 18px 20px;
    border: 1px solid var(--apm-border);
    border-radius: var(--apm-radius);
    background: var(--apm-gradient-surface, var(--apm-surface));
}

.apm-auth-note p {
    margin: 0;
    color: var(--apm-text-secondary);
    font-size: 15px;
    line-height: 1.65;
}

.apm-auth-note p + p {
    margin-top: 12px;
}

.apm-auth-note strong {
    color: var(--apm-text);
}


/* 6. Language switcher (partial layout/partials/_changeFlag.html.twig) --- */

.apm-auth__lang {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    width: 100%;
    max-width: 440px;
    margin: 28px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--apm-border);
}

.apm-auth__lang .menu-item {
    padding: 0 !important;
}

.apm-auth__lang .menu-link,
.apm-auth__lang .menu-link.active {
    display: inline-flex !important;
    align-items: center;
    min-height: 36px;
    padding: 6px 12px !important;
    border-radius: 999px;
    background: transparent !important;
    color: var(--apm-text-muted) !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s var(--apm-ease), color .2s var(--apm-ease);
}

.apm-auth__lang .menu-link:hover {
    background: rgba(255, 255, 255, .05) !important;
    color: var(--apm-text) !important;
}

.apm-auth__lang .symbol {
    margin-right: 8px !important;
}

.apm-auth__lang .symbol img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}


/* 7. SweetAlert dialogs (appended to <body>) ---------------------------- */

body.apm-auth .swal2-popup {
    border: 1px solid var(--apm-border-light);
    border-radius: 18px;
    background: var(--apm-surface);
    color: var(--apm-text-secondary);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
}

body.apm-auth .swal2-html-container {
    color: var(--apm-text);
    font-size: 15px;
    line-height: 1.55;
}

body.apm-auth .swal2-container.swal2-backdrop-show {
    background: rgba(4, 6, 12, .7);
}

body.apm-auth .swal2-popup .btn.btn-primary {
    min-width: 140px;
    height: 46px;
}


/* 8. Mobile band (< 992px) ----------------------------------------------- */

@media (max-width: 991.98px) {
    /* Form starts right under the band; no glow seam where the band fades out. */
    .apm-auth__center {
        align-items: flex-start;
    }

    .apm-auth__main::before {
        display: none;
    }

    .apm-auth__aside {
        min-height: 196px;
        padding: 16px 20px 22px;
        justify-content: space-between;
    }

    .apm-auth-aside__img {
        object-position: 62% 42%;
    }

    .apm-auth-aside__shade {
        background:
            linear-gradient(180deg, rgba(4, 6, 12, .55) 0%, rgba(4, 6, 12, .12) 38%, rgba(7, 10, 18, .7) 78%, var(--apm-bg) 100%);
    }

    .apm-auth-aside__points,
    .apm-auth-aside__stats,
    .apm-auth-aside__error,
    .apm-auth-aside__credit-by {
        display: none;
    }

    .apm-auth-aside__content {
        margin-top: 28px;
    }

    .apm-auth-aside__credit {
        position: absolute;
        top: 20px;
        right: 16px;
        max-width: 52%;
        padding: 5px 10px 5px 8px;
        font-size: 11px;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .apm-auth__aside {
        min-height: 240px;
        padding: 20px 32px 28px;
    }

    .apm-auth-aside__title {
        font-size: 34px;
    }

    .apm-auth__main {
        padding: 36px 32px 28px;
    }
}
