/**
 * Anime Pro — Membership styles.
 * Dark is the default (:root). Light overrides under body.apm-light.
 * Centralized design tokens; BEM-ish naming; RTL-friendly (logical props).
 */

/**
 * Anime Pro — Membership styles.
 * Tokens map to theme CSS variables for dark/light consistency.
 */

:root,
body.apm-dark {
    --apm-bg: var(--main-bg-color, #131722);
    --apm-surface: var(--ep-card-bg, #1e2436);
    --apm-surface-2: var(--sec-title-panel-bg, rgba(255, 255, 255, 0.03));
    --apm-surface-3: var(--media-card-surface, #131722);
    --apm-border: var(--sec-title-border, rgba(255, 255, 255, 0.08));
    --apm-border-2: var(--media-card-border, rgba(255, 255, 255, 0.1));
    --apm-text: var(--sec-title-color, #fff);
    --apm-muted: var(--media-card-muted, #a8b0c3);
    --apm-faint: var(--light-color, #8f8d8d);
    --apm-accent: var(--sec-title-accent, #029dbc);
    --apm-accent-2: #06c2e6;
    --apm-accent-dark: var(--sec-title-accent-dark, #017a94);
    --apm-on-accent: #ffffff;
    --apm-on-media: #ffffff;
    --apm-danger: var(--red-color, #d41616);
    --apm-danger-soft: rgba(212, 22, 22, 0.12);
    --apm-success: #1fae5a;
    --apm-success-soft: rgba(31, 174, 90, 0.13);
    --apm-info-soft: rgba(2, 157, 188, 0.13);
    --apm-heart: #e0245e;
    --apm-radius-lg: 12px;
    --apm-radius: 12px;
    --apm-radius-sm: 10px;
    --apm-shadow: var(--media-card-shadow-hover, 0 14px 32px rgba(0, 0, 0, 0.32));
    --apm-shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.22);
    --apm-ring: 0 0 0 3px var(--apm-info-soft);
    --apm-transition: var(--media-card-transition, 0.3s ease);
    --apm-input-bg: var(--input-bg, #242b40);
    --apm-input-border: var(--input-border, #32384b);
    --apm-input-text: var(--input-text, #fff);
    --apm-overlay: rgba(19, 23, 34, 0.72);
}

body.apm-light {
    --apm-bg: #ffffff;
    --apm-surface: #ffffff;
    --apm-surface-2: rgba(0, 0, 0, 0.04);
    --apm-surface-3: #f5f5f5;
    --apm-border: rgba(0, 0, 0, 0.08);
    --apm-border-2: rgba(0, 0, 0, 0.12);
    --apm-text: #1e1e1e;
    --apm-muted: rgba(30, 30, 30, 0.65);
    --apm-faint: rgba(30, 30, 30, 0.45);
    --apm-accent: #029dbc;
    --apm-accent-2: #06c2e6;
    --apm-accent-dark: #017a94;
    --apm-on-accent: #ffffff;
    --apm-on-media: #ffffff;
    --apm-input-bg: #ffffff;
    --apm-input-border: rgba(0, 0, 0, 0.12);
    --apm-input-text: #1e1e1e;
    --apm-overlay: rgba(15, 23, 42, 0.45);
    --apm-shadow: 0 14px 32px rgba(0, 0, 0, 0.1);
    --apm-shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.08);
    --apm-danger-soft: rgba(212, 22, 22, 0.1);
    --apm-success-soft: rgba(31, 174, 90, 0.1);
    --apm-info-soft: rgba(2, 157, 188, 0.1);
    --apm-ring: 0 0 0 3px rgba(2, 157, 188, 0.15);
}

/* ============================================================
 * Base / reset within scope
 * ============================================================ */
.secContainer--account {
    background: transparent !important;
    color: var(--apm-text);
}

.secContainer--favorites {
    color: var(--apm-text);
}

.secContainer--account .sec-line > .containers.container {
    padding-top: var(--sec-block-py, 36px);
    padding-bottom: var(--sec-block-py, 36px);
}

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

.apm a.apm-link,
.apm .apm-auth-switch a,
.apm .apm-fav-card__title a {
    color: var(--apm-accent);
}

.apm a.apm-link:hover,
.apm .apm-auth-switch a:hover,
.apm .apm-fav-card__title a:hover {
    color: var(--apm-accent-2);
}

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

.apm h1,
.apm h2,
.apm h3,
.apm h4 {
    margin: 0;
    line-height: 1.3;
}

.apm a {
    text-decoration: none;
}

/* ============================================================
 * Auth — standalone page per view
 * ============================================================ */
.apm-auth {
    max-width: 460px;
    margin: 0 auto;
    padding: 36px 0 60px;
}

.apm-auth__card {
    background: var(--apm-surface);
    border: 1px solid var(--apm-border);
    border-radius: var(--apm-radius-lg);
    box-shadow: var(--apm-shadow);
    padding: 38px 34px 34px;
}

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

.apm-auth-head__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--apm-info-soft);
    color: var(--apm-accent);
    font-size: 26px;
    margin-bottom: 18px;
}

.apm-auth-head__title {
    color: var(--apm-text);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.apm-auth-head__sub {
    color: var(--apm-muted);
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

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

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

.apm-auth-switch a {
    color: var(--apm-accent);
    font-weight: 700;
    transition: var(--apm-transition);
}

.apm-auth-switch a:hover {
    color: var(--apm-accent-2);
    text-decoration: underline;
}

.apm-auth-forgot {
    text-align: center;
    margin: -6px 0 20px;
}

.apm-auth-forgot .apm-link {
    font-size: 13.5px;
    font-weight: 600;
}

.apm-auth-form .apm-field .apm-check {
    margin-top: 2px;
}

.apm-btn--lg {
    padding: 15px 24px;
    font-size: 15px;
}

/* ============================================================
 * Account layout — aligned with theme sections
 * ============================================================ */
.apm-account {
    width: 100%;
}

.apm-account__content {
    display: flex;
    flex-direction: column;
    gap: var(--sec-inner-gap, 16px);
}

/* Profile bar */
.apm-profile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 22px 24px;
    background: var(--apm-surface);
    border: 1px solid var(--apm-border);
    border-radius: var(--apm-radius);
    box-shadow: var(--apm-shadow-sm);
    margin-bottom: var(--sec-inner-gap, 16px);
}

.apm-profile-bar__user {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 240px;
}

.apm-profile-bar__avatar {
    display: block;
    flex-shrink: 0;
    border-radius: 50%;
    transition: var(--apm-transition);
}

.apm-profile-bar__avatar:hover {
    transform: scale(1.03);
}

.apm-profile-bar__avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--apm-border-2);
    background: var(--apm-surface-3);
    display: block;
}

.apm-profile-bar__eyebrow {
    margin: 0 0 4px;
    color: var(--apm-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.apm-profile-bar__name {
    color: var(--apm-text);
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px;
    line-height: 1.25;
}

.apm-profile-bar__mail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--apm-muted) !important;
    font-size: 13px;
}

.apm-profile-bar__mail i {
    color: var(--apm-accent) !important;
}

.apm-profile-bar__mail-text {
    direction: ltr;
    unicode-bidi: embed;
    word-break: break-all;
    color: inherit !important;
}

.apm-profile-bar__aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.apm-profile-bar__stat {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--apm-surface-2);
    border: 1px solid var(--apm-border);
    color: var(--apm-muted);
    border-radius: 50px;
    padding: 7px 14px;
    font-size: 12.5px;
}

.apm-profile-bar__stat i {
    color: var(--apm-accent);
}

.apm-profile-bar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.apm-profile-bar__action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--apm-border-2);
    color: var(--apm-muted);
    border-radius: var(--apm-radius-sm);
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    transition: var(--apm-transition);
}

.apm-profile-bar__action:hover {
    color: var(--apm-accent);
    border-color: var(--apm-accent);
}

.apm-profile-bar__action--logout:hover {
    background: var(--apm-danger-soft);
    color: var(--apm-danger);
    border-color: var(--apm-danger);
}

/* Account nav tabs */
.apm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--sec-inner-gap, 16px);
    padding: 8px;
    background: var(--apm-surface);
    border: 1px solid var(--apm-border);
    border-radius: var(--apm-radius);
}

.apm-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--apm-radius-sm);
    border: 1px solid var(--apm-border);
    background: var(--apm-surface);
    color: var(--apm-muted);
    font-size: 14px;
    font-weight: 700;
    transition: var(--apm-transition);
}

.apm-tab,
.apm-tab i,
.apm-tab span {
    color: inherit;
}

.apm-tab:not(.is-active):hover {
    color: var(--apm-accent);
    border-color: var(--apm-accent);
}

.apm-tab:not(.is-active):hover,
.apm-tab:not(.is-active):hover i,
.apm-tab:not(.is-active):hover span {
    color: var(--apm-accent) !important;
}

.apm-tab.is-active {
    background: var(--apm-accent);
    border-color: var(--apm-accent);
    color: var(--apm-on-accent);
}

.apm-tab.is-active:hover {
    background: var(--apm-accent-dark);
    border-color: var(--apm-accent-dark);
}

.apm-tab.is-active,
.apm-tab.is-active i,
.apm-tab.is-active span,
.apm-tab.is-active:hover,
.apm-tab.is-active:focus,
.apm-tab.is-active:active,
.apm-tab.is-active:hover i,
.apm-tab.is-active:hover span {
    color: var(--apm-on-accent) !important;
}

.apm-tab__badge {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 1px 8px;
    font-size: 11px;
    font-style: normal;
}

.apm-tab:not(.is-active) .apm-tab__badge {
    background: var(--apm-surface-2);
    color: var(--apm-text);
}

/* Content boxes — theme comment/panel style */
.apm-box {
    background: var(--apm-surface);
    border: 1px solid var(--apm-border);
    border-radius: var(--apm-radius);
    padding: 22px;
    margin-bottom: var(--sec-inner-gap, 16px);
}

.apm-box__title {
    color: var(--apm-text);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--apm-border);
}

.apm-box:last-child {
    margin-bottom: 0;
}

.apm-account--dashboard .apm-account__content {
    padding-top: 4px;
}

.apm-box__title i {
    color: var(--apm-accent);
}

.apm-account .media-grid {
    margin-bottom: var(--sec-inner-gap, 16px);
}

.media-card.is-removing,
.ep-card.is-removing {
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

/* ============================================================
 * Quick action cards (dashboard)
 * ============================================================ */
.apm-quick {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.apm-quick__card {
    background: var(--apm-surface);
    border: 1px solid var(--apm-border);
    border-radius: var(--apm-radius);
    padding: 20px;
    text-align: center;
    transition: var(--apm-transition);
    box-shadow: var(--apm-shadow-sm);
    color: inherit;
    display: block;
}

.apm-quick__card:hover {
    transform: translateY(-4px);
    border-color: var(--apm-accent);
    box-shadow: var(--apm-shadow);
}

.apm-quick__icon {
    display: inline-flex;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 21px;
    margin-bottom: 12px;
}

.apm-quick__icon--heart { background: rgba(224, 36, 94, 0.14); color: var(--apm-heart); }
.apm-quick__icon--edit { background: var(--apm-info-soft); color: var(--apm-accent); }
.apm-quick__icon--shield { background: var(--apm-success-soft); color: var(--apm-success); }

.apm-quick__num {
    display: block;
    color: var(--apm-text);
    font-size: 24px;
    font-weight: 800;
}

.apm-quick__num i {
    font-size: 16px;
    color: var(--apm-muted);
}

.apm-quick__label {
    display: block;
    color: var(--apm-muted);
    font-size: 14px;
    font-weight: 700;
    margin-top: 4px;
}

.apm-quick__hint {
    display: block;
    color: var(--apm-faint);
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.45;
}

/* Profile dashboard overview */
.apm-overview__info {
    width: 100%;
    margin-bottom: 0;
}

.apm-overview__info .apm-box__title {
    margin-bottom: 0;
}

.apm-overview__list {
    margin: 0;
    padding: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.apm-overview__row {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 20px 28px;
    flex-wrap: wrap;
    padding: 14px 0;
    border-bottom: 1px solid var(--apm-border);
}

.apm-overview__row:first-child {
    padding-top: 0;
}

.apm-overview__row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.apm-overview__row--stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.apm-overview__label {
    margin: 0;
    color: var(--apm-faint);
    font-size: 12.5px;
    font-weight: 600;
    flex: 0 0 auto;
    min-width: 130px;
}

.apm-overview__value {
    margin: 0;
    color: var(--apm-text);
    font-size: 14.5px;
    font-weight: 600;
    word-break: break-word;
    flex: 0 1 auto;
    text-align: start;
}

.apm-overview__value--ltr {
    direction: ltr;
    unicode-bidi: embed;
    text-align: end;
}

.apm-overview__value--bio {
    line-height: 1.65;
    font-weight: 500;
}

/* Empty state (favorites & lists) */
.secContainer--favorites .archive-page__empty,
.apm-empty-wrap {
    margin-top: 8px;
}

.apm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 52px 28px;
    background: var(--apm-surface);
    border: 1px solid var(--apm-border);
    border-radius: var(--apm-radius);
    box-shadow: var(--apm-shadow-sm);
}

.apm-empty-state__icon {
    display: inline-flex;
    width: 72px;
    height: 72px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--apm-info-soft);
    color: var(--apm-heart, #e0245e);
    font-size: 28px;
    margin-bottom: 4px;
}

.apm-empty-state__title {
    margin: 0;
    color: var(--apm-text);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
}

.apm-empty-state__desc {
    margin: 0;
    max-width: 420px;
    color: var(--apm-muted);
    font-size: 14px;
    line-height: 1.65;
}

.apm-empty-state__btn {
    margin-top: 8px;
    min-width: 160px;
    border-radius: var(--apm-radius-sm);
    font-weight: 700;
}

/* Light mode — explicit component polish */
body.apm-light .apm-tab {
    background: #ffffff;
    color: var(--apm-muted);
}

body.apm-light .apm-tab,
body.apm-light .apm-tab i,
body.apm-light .apm-tab span {
    color: var(--apm-muted);
}

body.apm-light .apm-tab:not(.is-active):hover,
body.apm-light .apm-tab:not(.is-active):hover i,
body.apm-light .apm-tab:not(.is-active):hover span {
    color: var(--apm-accent) !important;
    background: #ffffff;
}

body.apm-light .apm-tab.is-active {
    background: var(--apm-accent);
    border-color: var(--apm-accent);
    color: #ffffff !important;
}

body.apm-light .apm-tab.is-active:hover {
    background: var(--apm-accent-dark);
    border-color: var(--apm-accent-dark);
}

body.apm-light .apm-tab.is-active,
body.apm-light .apm-tab.is-active i,
body.apm-light .apm-tab.is-active span,
body.apm-light .apm-tab.is-active:hover,
body.apm-light .apm-tab.is-active:hover i,
body.apm-light .apm-tab.is-active:hover span {
    color: #ffffff !important;
}

body.apm-light .apm-profile-bar__name,
body.apm-light .apm-box__title,
body.apm-light .apm-overview__value,
body.apm-light .apm-empty-state__title,
body.apm-light .apm-auth-head__title,
body.apm-light .apm-field > label {
    color: var(--apm-text);
}

body.apm-light .apm-profile-bar__mail,
body.apm-light .apm-overview__label,
body.apm-light .apm-empty-state__desc,
body.apm-light .apm-auth-head__sub {
    color: var(--apm-muted);
}

body.apm-light .apm-input {
    background: var(--apm-input-bg);
    border-color: var(--apm-input-border);
}

body.apm-light .apm-btn--ghost {
    background: var(--apm-surface-3);
    color: var(--apm-text);
}

body.apm-light .apm-security__tips {
    background: var(--apm-info-soft);
    border-color: rgba(2, 157, 188, 0.18);
}

body.apm-light .apm-toast {
    background: var(--apm-surface);
    color: var(--apm-text);
    border-color: var(--apm-border);
    box-shadow: var(--apm-shadow);
}
/* ============================================================
 * Cards (sections inside panel)
 * ============================================================ */
.apm-card {
    background: var(--apm-surface-2);
    border: 1px solid var(--apm-border);
    border-radius: var(--apm-radius);
    padding: 22px;
}

.apm-card + .apm-card {
    margin-top: 18px;
}

.apm-card--narrow {
    max-width: 520px;
}

/* ============================================================
 * Security page
 * ============================================================ */
.apm-security {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}

.apm-security__tips {
    background: var(--apm-info-soft);
    border-color: rgba(2, 157, 188, 0.22);
}

.apm-security__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.apm-security__list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--apm-muted);
    font-size: 13.5px;
    line-height: 1.55;
}

.apm-security__list li i {
    color: var(--apm-success);
    margin-top: 3px;
    flex-shrink: 0;
}

.apm-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.apm-card__title {
    color: var(--apm-text);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 9px;
}

.apm-card__title i {
    color: var(--apm-accent);
    font-size: 15px;
}

/* ============================================================
 * Forms
 * ============================================================ */
.apm-form-head {
    text-align: center;
    margin-bottom: 24px;
}

.apm-form-title {
    color: var(--apm-text);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.apm-form-sub {
    color: var(--apm-muted);
    font-size: 14px;
    margin: 0;
}

.apm-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.apm-field:last-child {
    margin-bottom: 0;
}

.apm-field > label {
    display: block;
    color: var(--apm-text);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.apm-input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--apm-input-bg);
    border: 1px solid var(--apm-input-border);
    border-radius: var(--apm-radius-sm);
    padding: 0 14px;
}

.apm-input:focus-within {
    border-color: var(--apm-accent);
    box-shadow: var(--apm-ring);
}

.apm-input > i {
    color: var(--apm-faint);
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.apm-input input,
.apm-input textarea,
.apm .apm-input input[type="text"],
.apm .apm-input input[type="email"],
.apm .apm-input input[type="password"],
.apm .apm-input input[type="search"],
.apm .apm-input textarea {
    flex: 1;
    width: 100%;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    color: var(--apm-text) !important;
    font-size: 14.5px;
    font-family: inherit;
    padding: 13px 0 !important;
    margin: 0;
    min-height: 0;
    height: auto;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
}

.apm-input input:focus,
.apm-input input:active,
.apm-input input:hover,
.apm-input textarea:focus,
.apm-input textarea:active,
.apm-input textarea:hover,
.apm .apm-input input[type="text"]:focus,
.apm .apm-input input[type="email"]:focus,
.apm .apm-input input[type="password"]:focus,
.apm .apm-input input[type="search"]:focus,
.apm .apm-input textarea:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    background-color: transparent !important;
    color: var(--apm-text) !important;
}

/* Keep same look when browser autofills saved credentials */
.apm .apm-input input:-webkit-autofill,
.apm .apm-input input:-webkit-autofill:hover,
.apm .apm-input input:-webkit-autofill:focus,
.apm .apm-input input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--apm-text) !important;
    caret-color: var(--apm-text);
    box-shadow: 0 0 0 1000px var(--apm-input-bg) inset !important;
    border: none !important;
    transition: background-color 99999s ease-out 0s;
}

.apm-input--area {
    padding: 12px 14px;
    align-items: flex-start;
}

.apm-input textarea {
    resize: vertical;
    min-height: 92px;
    padding: 0;
}

.apm-input--disabled {
    opacity: 0.6;
}

.apm-input input::placeholder,
.apm-input textarea::placeholder {
    color: var(--apm-faint);
}

.apm-toggle-pass {
    background: transparent;
    border: 0;
    color: var(--apm-faint);
    cursor: pointer;
    padding: 4px;
    transition: var(--apm-transition);
}

.apm-toggle-pass:hover {
    color: var(--apm-accent);
}

.apm-field--inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.apm-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--apm-muted);
    font-size: 13.5px;
    cursor: pointer;
}

.apm-check input {
    accent-color: var(--apm-accent);
    width: 16px;
    height: 16px;
    margin: 0;
}

.apm-hint {
    display: block;
    color: var(--apm-faint);
    font-size: 12px;
    margin-top: 7px;
}

.apm-link {
    color: var(--apm-accent);
    transition: var(--apm-transition);
}

.apm-link:hover {
    color: var(--apm-accent-2);
    text-decoration: underline;
}

.apm-form-foot {
    text-align: center;
    color: var(--apm-muted);
    font-size: 13.5px;
    margin: 20px 0 0;
}

.apm-form-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 22px;
}

/* Honeypot */
.apm-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* ============================================================
 * Buttons
 * ============================================================ */
.apm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: var(--apm-radius-sm);
    padding: 13px 24px;
    font-size: 14.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--apm-transition);
    line-height: 1;
}

.apm-btn--block { width: 100%; }
.apm-btn--sm { padding: 10px 16px; font-size: 13.5px; }

.apm-btn--primary {
    background: var(--apm-accent);
    color: var(--apm-on-accent);
}

.apm-btn--primary:hover {
    background: var(--apm-accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(2, 157, 188, 0.32);
}

.apm-btn--ghost {
    background: var(--apm-surface-3);
    color: var(--apm-text);
    border-color: var(--apm-border-2);
}

.apm-btn--ghost:hover {
    border-color: var(--apm-accent);
    color: var(--apm-accent);
}

.apm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.apm-btn {
    position: relative;
}

.apm-btn .apm-btn__spinner {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    animation: none !important;
    pointer-events: none !important;
}

.apm-btn.is-loading .apm-btn__spinner {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    position: absolute;
    inset: 0;
    margin: auto;
    align-items: center;
    justify-content: center;
    animation: fa-spin 2s infinite linear !important;
}

.apm-btn.is-loading .apm-btn__text,
.apm-btn.is-loading > i:not(.apm-btn__spinner) {
    visibility: hidden;
}

.apm-btn.is-loading { pointer-events: none; }

/* ============================================================
 * Alerts
 * ============================================================ */
.apm-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--apm-radius-sm);
    padding: 12px 14px;
    font-size: 13.5px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.apm-alert--error { background: var(--apm-danger-soft); color: var(--apm-danger); border-color: rgba(224, 54, 74, 0.3); }
.apm-alert--success { background: var(--apm-success-soft); color: var(--apm-success); border-color: rgba(31, 174, 90, 0.3); }
.apm-alert--info { background: var(--apm-info-soft); color: var(--apm-accent); border-color: rgba(2, 157, 188, 0.3); }

/* ============================================================
 * Avatar editor
 * ============================================================ */
.apm-avatar-edit {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.apm-avatar-edit__preview {
    position: relative;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: block;
    overflow: hidden;
}

.apm-avatar-edit__file {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 4;
    border: 0;
    background: transparent;
    font-size: 0;
    appearance: none;
    -webkit-appearance: none;
}

.apm-avatar-edit__preview.is-uploading .apm-avatar-edit__file {
    pointer-events: none;
}

/* Never show native file-picker UI inside membership forms */
.apm input[type="file"]:not(.apm-avatar-edit__file) {
    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;
    opacity: 0 !important;
}

.apm-avatar-edit__preview img {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--apm-border-2);
    background: var(--apm-surface-3);
    display: block;
}

.apm-avatar-edit__hover {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--apm-overlay);
    color: var(--apm-on-media);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    opacity: 0;
    transition: var(--apm-transition);
}

.apm-avatar-edit__preview:hover .apm-avatar-edit__hover {
    opacity: 1;
}

.apm-avatar-edit__spinner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--apm-overlay);
    color: var(--apm-on-media);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.apm-avatar-edit__spinner i {
    animation: none;
}

.apm-avatar-edit__preview.is-uploading .apm-avatar-edit__spinner {
    display: flex;
}

.apm-avatar-edit__preview.is-uploading .apm-avatar-edit__spinner i {
    animation: fa-spin 2s infinite linear;
}

.apm-avatar-edit__preview.is-uploading .apm-avatar-edit__hover {
    opacity: 0;
}

.apm-avatar-edit__controls {
    flex: 1;
    min-width: 220px;
}

.apm-avatar-edit__name {
    color: var(--apm-text);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.apm-avatar-edit__controls .apm-hint {
    margin-top: 0;
}

/* ============================================================
 * Favorites grid + cards
 * ============================================================ */
.apm-fav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 16px;
}

.apm-fav-card {
    position: relative;
    background: var(--apm-surface);
    border: 1px solid var(--apm-border);
    border-radius: var(--apm-radius);
    overflow: hidden;
    transition: var(--apm-transition);
}

.apm-fav-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--apm-shadow);
    border-color: var(--apm-border-2);
}

.apm-fav-card.is-removing {
    opacity: 0;
    transform: scale(0.9);
}

.apm-fav-card__poster {
    position: relative;
    aspect-ratio: 2 / 3;
    background: var(--apm-surface-3);
    overflow: hidden;
}

.apm-fav-card__link {
    display: block;
    width: 100%;
    height: 100%;
}

.apm-fav-card__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--apm-transition);
}

.apm-fav-card:hover .apm-fav-card__poster img {
    transform: scale(1.06);
}

.apm-fav-card__noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--apm-faint);
    font-size: 34px;
}

.apm-fav-card__body {
    padding: 12px;
}

.apm-fav-card__title {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.45;
}

.apm-fav-card__title a {
    color: var(--apm-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.apm-fav-card__title a:hover {
    color: var(--apm-accent);
}

/* ============================================================
 * Empty states
 * ============================================================ */
.apm-empty {
    text-align: center;
    padding: 54px 20px;
    color: var(--apm-muted);
}

.apm-empty--sm {
    padding: 30px 20px;
}

.apm-empty > i {
    font-size: 52px;
    color: var(--apm-accent);
    opacity: 0.55;
    margin-bottom: 16px;
}

.apm-empty--sm > i { font-size: 38px; margin-bottom: 12px; }

.apm-empty h3 {
    color: var(--apm-text);
    margin: 0 0 8px;
    font-size: 18px;
}

.apm-empty p {
    margin: 0 0 18px;
    font-size: 14px;
}

/* ============================================================
 * Favorite toggle button (cards across the site)
 * ============================================================ */
.apm-fav-btn {
    --apm-fav-size: 38px;
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    z-index: 5;
    width: var(--apm-fav-size);
    height: var(--apm-fav-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--apm-overlay);
    color: var(--apm-on-media);
    cursor: pointer;
    font-size: 15px;
    backdrop-filter: blur(5px);
    transition: var(--apm-transition);
    box-shadow: var(--apm-shadow-sm);
}

.apm-fav-btn:hover {
    transform: scale(1.12);
    color: var(--apm-heart);
}

.apm-fav-btn.is-active { color: var(--apm-heart); }
.apm-fav-btn.is-active:hover { color: var(--apm-on-media); background: var(--apm-heart); }
.apm-fav-btn.is-loading { pointer-events: none; opacity: 0.7; }
.apm-fav-btn.is-pop { animation: apm-pop 0.4s ease; }

@keyframes apm-pop {
    0% { transform: scale(1); }
    45% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.ep-card { position: relative; }

.media-card__poster .apm-fav-btn,
.ep-card .apm-fav-btn {
    top: 10px;
    inset-inline-start: 10px;
    z-index: 6;
}

.apm-fav-card__remove {
    inset-inline-start: auto;
    inset-inline-end: 10px;
}

/* Inline pill variant (single page hero actions) */
.apm-fav-btn--inline {
    position: static;
    width: auto;
    height: auto;
    border-radius: 50px;
    padding: 12px 22px;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
    background: var(--apm-surface-2);
    color: var(--apm-text);
    border: 1px solid var(--apm-border-2);
    backdrop-filter: none;
    box-shadow: none;
}

.apm-fav-btn--inline:hover {
    transform: translateY(-1px);
    color: var(--apm-heart);
    border-color: var(--apm-heart);
}

.apm-fav-btn--inline.is-active {
    background: var(--apm-heart);
    border-color: var(--apm-heart);
    color: var(--apm-on-media);
}

.apm-fav-btn--inline.is-active:hover {
    background: transparent;
    color: var(--apm-heart);
}

/* ============================================================
 * Header account widget
 * ============================================================ */
.apm-userbar__avatar img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--apm-border-2);
}

/* ============================================================
 * Toast notifications
 * ============================================================ */
.apm-toast {
    position: fixed;
    bottom: 26px;
    inset-inline-end: 26px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--apm-surface);
    color: var(--apm-text);
    border: 1px solid var(--apm-border);
    border-radius: var(--apm-radius);
    padding: 14px 18px;
    box-shadow: var(--apm-shadow);
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    opacity: 0;
    transform: translateY(24px);
    transition: var(--apm-transition);
    max-width: 360px;
    pointer-events: none;
}

.apm-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.apm-toast__icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.apm-toast--success .apm-toast__icon { background: var(--apm-success-soft); color: var(--apm-success); }
.apm-toast--error .apm-toast__icon { background: var(--apm-danger-soft); color: var(--apm-danger); }

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 720px) {
    .apm-quick { grid-template-columns: 1fr; }
    .apm-grid-2 { grid-template-columns: 1fr; }

    .apm-profile-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .apm-profile-bar__user {
        align-items: center;
        text-align: center;
        flex-direction: column;
    }

    .apm-profile-bar__aside {
        align-items: center;
        width: 100%;
    }

    .apm-profile-bar__actions {
        justify-content: center;
        width: 100%;
    }

    .apm-profile-bar__action {
        flex: 1;
        justify-content: center;
    }

    .apm-overview__row {
        gap: 8px;
    }

    .apm-overview__label {
        min-width: 100%;
    }

    .apm-tab span { display: none; }
    .apm-tab { min-width: 0; padding: 13px; }
    .apm-tab__badge { display: none; }

    .apm-box { padding: 18px 16px; }
    .apm-form-actions { justify-content: stretch; }
    .apm-form-actions .apm-btn { width: 100%; }

    .apm-avatar-edit { justify-content: center; text-align: center; }

    .apm-security {
        grid-template-columns: 1fr;
    }

    .apm-auth {
        padding: 24px 0 40px;
    }

    .apm-auth__card {
        padding: 28px 20px 26px;
    }

    .apm-toast {
        inset-inline: 16px;
        bottom: 16px;
        max-width: none;
    }
}
