/* GSquad Affiliate Portal — aligned with main site (gsquad-theme palette & typography) */
:root {
    --ap-bg-deep: #14100e;
    --ap-bg-mid: #1a1512;
    --ap-surface: rgba(22, 18, 15, 0.96);
    --ap-surface-elevated: linear-gradient(165deg, rgba(38, 28, 22, 0.98) 0%, rgba(18, 14, 11, 0.99) 100%);
    --ap-border: rgba(197, 160, 89, 0.28);
    --ap-border-strong: rgba(197, 160, 89, 0.45);
    --ap-gold: #c5a059;
    --ap-gold-soft: #e6d4a8;
    --ap-gold-dim: #8a7038;
    --ap-ink: #e8dcc4;
    --ap-muted: #a89880;
    --ap-teal-glow: rgba(45, 120, 115, 0.22);
    --ap-danger: #c45c5c;
    --ap-success: #6b9e6b;
    --ap-font-ui: "Montserrat", system-ui, "Segoe UI", sans-serif;
    --ap-font-display: "Cinzel", Georgia, serif;
}

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

body.ap-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--ap-font-ui);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ap-ink);
    background-color: var(--ap-bg-deep);
    background-image:
        radial-gradient(ellipse 90% 50% at 50% -15%, var(--ap-teal-glow), transparent 55%),
        radial-gradient(ellipse 70% 45% at 100% 85%, rgba(90, 70, 35, 0.14), transparent),
        linear-gradient(180deg, #0f0c0a 0%, #1a130f 42%, #0f0c0a 100%);
}

/* ——— Top bar (panel) ——— */
.ap-topbar {
    display: flex;
    align-items: center;
    gap: 1rem 1.25rem;
    flex-wrap: wrap;
    min-height: 3.35rem;
    padding: 0.55rem 1.25rem;
    background: linear-gradient(180deg, #181410 0%, #0e0c0a 100%);
    border-bottom: 1px solid var(--ap-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.ap-topbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.ap-topbar-brand img {
    height: 40px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(197, 160, 89, 0.25));
}

.ap-topbar-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.ap-topbar-eyebrow {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ap-gold-dim);
}

.ap-topbar-title {
    font-family: var(--ap-font-display);
    font-size: clamp(1rem, 2vw, 1.15rem);
    font-weight: 700;
    color: var(--ap-gold-soft);
    letter-spacing: 0.04em;
    margin: 0;
}

.ap-topbar-spacer {
    flex: 1;
    min-width: 0;
}

/* ——— Login split layout ——— */
.ap-login-split {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.65fr);
    min-height: 100vh;
    align-items: stretch;
}

.ap-login-hero {
    position: relative;
    padding: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ap-login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(105deg, rgba(10, 8, 7, 0.88) 0%, rgba(20, 16, 13, 0.78) 50%, rgba(12, 10, 8, 0.55) 100%),
        radial-gradient(ellipse 80% 60% at 85% 25%, rgba(197, 160, 89, 0.1), transparent 50%);
    pointer-events: none;
}

.ap-login-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 36rem;
    width: 100%;
}

.ap-login-logo {
    display: inline-block;
    margin-bottom: 1.35rem;
}

.ap-login-logo img {
    height: clamp(48px, 8vw, 72px);
    width: auto;
    max-width: 220px;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.45));
}

.ap-login-kicker {
    margin: 0 0 0.5rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ap-gold);
}

.ap-login-headline {
    margin: 0 0 0.85rem;
    font-family: var(--ap-font-display);
    font-size: clamp(1.55rem, 3.5vw, 2.15rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--ap-gold-soft);
    text-shadow: 0 0 28px rgba(197, 160, 89, 0.18);
}

.ap-login-lead {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--ap-muted);
}

.ap-platforms-label {
    margin: 0 0 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ap-gold-dim);
}

.ap-platform-grid {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.5rem;
}

.ap-platform-grid li {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ap-ink);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--ap-border);
    border-radius: 0.4rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ap-platform-grid li.ap-platform-more {
    color: var(--ap-muted);
    font-weight: 600;
    border-style: dashed;
    background: transparent;
}

.ap-login-apply {
    margin: 0;
    padding: 1rem 1.15rem;
    border-radius: 0.65rem;
    border: 1px solid var(--ap-border-strong);
    background: linear-gradient(135deg, rgba(58, 42, 28, 0.5) 0%, rgba(24, 18, 12, 0.65) 100%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 220, 170, 0.06);
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--ap-muted);
}

.ap-login-apply a {
    color: var(--ap-gold-soft);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(197, 160, 89, 0.45);
}

.ap-login-apply a:hover {
    color: #fff;
    border-bottom-color: var(--ap-gold);
}

.ap-login-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
    background: rgba(0, 0, 0, 0.22);
    border-left: 1px solid var(--ap-border);
}

.ap-auth-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 32px;
}

.ap-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--ap-surface-elevated);
    border: 1px solid var(--ap-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 36px rgba(197, 160, 89, 0.04);
}

.ap-auth-accent {
    height: 4px;
    margin: -1.5rem -1.5rem 1.15rem;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, var(--ap-gold-dim), var(--ap-gold) 42%, var(--ap-gold-soft));
}

.ap-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 1.25rem;
}

.ap-brand-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--ap-gold-soft), var(--ap-gold) 45%, var(--ap-gold-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #1a130f;
    box-shadow: 0 4px 16px rgba(197, 160, 89, 0.35);
}

.ap-brand-title {
    font-family: var(--ap-font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ap-gold-soft);
    letter-spacing: 0.03em;
}

.ap-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ap-muted);
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.ap-label-optional {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
    color: var(--ap-muted);
}

.ap-field-hint {
    margin: -4px 0 10px;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--ap-muted);
}

.ap-payout-budget-hint {
    margin: 0 0 12px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--ap-muted);
}

.ap-reject-label {
    font-weight: 700;
    color: var(--ap-gold-dim);
    margin-right: 0.25rem;
}

.ap-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--ap-border);
    background: rgba(0, 0, 0, 0.35);
    color: var(--ap-ink);
    margin-bottom: 0.85rem;
    font-family: inherit;
    font-size: 0.92rem;
}

.ap-input:focus {
    outline: none;
    border-color: var(--ap-gold);
    box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.15);
}

.ap-btn {
    width: 100%;
    padding: 0.72rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: linear-gradient(180deg, #f0e4c8 0%, var(--ap-gold) 42%, #9a7a3d 100%);
    color: #1c1612;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    margin-top: 0.25rem;
}

.ap-btn:hover {
    filter: brightness(1.06);
}

.ap-alert {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
    background: rgba(196, 92, 92, 0.12);
    border: 1px solid rgba(196, 92, 92, 0.35);
    color: #f0c4c4;
}

.ap-alert.ap-ok {
    background: rgba(107, 158, 107, 0.12);
    border-color: rgba(107, 158, 107, 0.35);
    color: #c5e4c5;
}

.ap-alert.ap-alert-legal {
    background: rgba(120, 40, 40, 0.22);
    border: 1px solid rgba(220, 100, 100, 0.55);
    color: #f0d4d4;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ap-alert.ap-alert-legal > strong {
    display: block;
    font-size: 0.92rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffb8b8;
    margin-bottom: 0.65rem;
}

.ap-alert-legal-body {
    font-size: 0.84rem;
    line-height: 1.55;
    color: #e8d0d0;
}

.ap-alert-legal-body p {
    margin: 0 0 0.55rem;
}

.ap-alert-legal-body p:last-child {
    margin-bottom: 0;
}

.ap-alert-legal-body strong {
    color: #fff;
    font-weight: 700;
}

.ap-alert.ap-payout-closed {
    background: rgba(197, 160, 89, 0.1);
    border-color: var(--ap-border-strong);
    color: var(--ap-ink);
}

.ap-alert.ap-payout-closed strong {
    color: var(--ap-gold-soft);
}

.ap-discord-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--ap-gold-soft);
    font-weight: 700;
}

.ap-hint {
    margin-top: 1.1rem;
    font-size: 0.75rem;
    color: var(--ap-muted);
    line-height: 1.55;
}

/* ——— Panel shell ——— */
.ap-shell {
    display: flex;
    min-height: calc(100vh - 3.35rem);
}

.ap-side {
    width: 280px;
    flex-shrink: 0;
    background:
        linear-gradient(165deg, rgba(32, 26, 20, 0.99) 0%, rgba(14, 11, 9, 1) 100%);
    border-right: 1px solid var(--ap-border-strong);
    padding: 1.15rem 0.9rem 1.5rem;
    box-shadow: inset -1px 0 0 rgba(197, 160, 89, 0.08), 8px 0 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ap-side-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.25rem 0.5rem;
    border-bottom: 1px solid rgba(197, 160, 89, 0.15);
}

.ap-side-brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 12px;
    font-family: var(--ap-font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: #1c1612;
    background: linear-gradient(145deg, #f0e4c8 0%, var(--ap-gold) 45%, #8a7038 100%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.ap-side-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.ap-side-brand-title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ap-gold-soft);
}

.ap-side-brand-sub {
    font-size: 0.68rem;
    color: var(--ap-muted);
    letter-spacing: 0.06em;
}

.ap-side-card {
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(197, 160, 89, 0.14);
}

.ap-side-card--user .ap-side-user {
    margin: 0;
    font-weight: 700;
    color: var(--ap-ink);
    word-break: break-all;
    font-size: 0.86rem;
    line-height: 1.35;
}

.ap-side-section-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ap-gold-dim);
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.ap-side-section-label--spaced {
    margin-top: 0.35rem;
}

.ap-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.ap-nav-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.58rem 0.65rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--ap-ink);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ap-nav-link:hover {
    background: rgba(197, 160, 89, 0.09);
    border-color: rgba(197, 160, 89, 0.2);
    color: var(--ap-gold-soft);
}

.ap-nav-link.is-active {
    background: rgba(197, 160, 89, 0.16);
    border-color: rgba(197, 160, 89, 0.35);
    color: var(--ap-gold-soft);
    box-shadow: inset 0 0 0 1px rgba(197, 160, 89, 0.12);
}

.ap-nav-link--logout:hover {
    background: rgba(196, 92, 92, 0.12);
    border-color: rgba(196, 92, 92, 0.28);
    color: #f0b0b0;
}

.ap-nav-icon {
    flex-shrink: 0;
    width: 1.15rem;
    height: 1.15rem;
    opacity: 0.88;
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.ap-nav-icon--dash {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'/%3E%3C/svg%3E");
}

.ap-nav-icon--media {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z'/%3E%3C/svg%3E");
}

.ap-nav-icon--external {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z'/%3E%3C/svg%3E");
}

.ap-nav-icon--logout {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5-5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5-5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z'/%3E%3C/svg%3E");
}

.ap-nav-text {
    flex: 1;
    min-width: 0;
}

/* ——— Media kit page ——— */
.ap-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.1rem;
}

.ap-media-card {
    background: var(--ap-surface-elevated);
    border: 1px solid var(--ap-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.ap-media-preview {
    aspect-ratio: 16 / 10;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ap-media-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ap-media-preview-link {
    display: block;
    width: 100%;
    height: 100%;
}

.ap-media-video {
    width: 100%;
    max-height: 200px;
    background: #000;
}

.ap-media-file-icon {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--ap-muted);
    padding: 0.5rem 0.75rem;
    border: 1px dashed var(--ap-border);
    border-radius: 8px;
}

.ap-media-meta {
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ap-media-name {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ap-gold-soft);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-media-size {
    font-size: 0.72rem;
    color: var(--ap-muted);
}

.ap-media-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.ap-media-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.38rem 0.65rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid var(--ap-border-strong);
    color: var(--ap-gold-soft);
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ap-media-btn:hover {
    background: rgba(197, 160, 89, 0.12);
    border-color: var(--ap-gold);
    color: #fff;
}

.ap-media-btn--primary {
    background: rgba(197, 160, 89, 0.18);
    border-color: rgba(197, 160, 89, 0.45);
}

.ap-main {
    flex: 1;
    padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2.25rem);
    overflow-x: auto;
}

.ap-main h1 {
    margin: 0 0 0.35rem;
    font-family: var(--ap-font-display);
    font-size: clamp(1.35rem, 2.5vw, 1.65rem);
    font-weight: 700;
    color: var(--ap-gold-soft);
    letter-spacing: 0.04em;
}

.ap-sub {
    color: var(--ap-muted);
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.ap-sub strong,
.ap-sub .ap-sub-code {
    color: var(--ap-gold);
}

.ap-alert-block {
    margin-bottom: 1rem;
}

.ap-card h2.ap-card-heading-follow {
    margin-top: 1.25rem;
}

.ap-card-section {
    margin-top: 1.25rem;
}

.ap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 960px) {
    .ap-login-split {
        grid-template-columns: 1fr;
    }

    .ap-login-aside {
        border-left: none;
        border-top: 1px solid var(--ap-border);
    }

    .ap-login-hero {
        min-height: auto;
        padding-bottom: 1.5rem;
    }

    .ap-grid {
        grid-template-columns: 1fr;
    }

    .ap-shell {
        flex-direction: column;
    }

    .ap-side {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid var(--ap-gold);
    }
}

.ap-card {
    background: var(--ap-surface-elevated);
    border: 1px solid var(--ap-border);
    border-radius: 14px;
    padding: 1.15rem 1.25rem;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.ap-card h2 {
    margin: 0 0 1rem;
    font-family: var(--ap-font-display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ap-gold-soft);
}

.ap-stat {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.86rem;
}

.ap-stat span {
    color: var(--ap-muted);
}

.ap-stat strong {
    color: var(--ap-gold);
    text-align: right;
}

.ap-stat--stacked strong {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

.ap-stat--stacked {
    flex-wrap: wrap;
    align-items: flex-start;
}

.ap-stat-note {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ap-muted);
    line-height: 1.25;
}

.ap-stat-hint {
    flex: 0 0 100%;
    font-size: 0.72rem;
    color: var(--ap-muted);
    line-height: 1.35;
    margin-top: 0.1rem;
}

.ap-ref-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
}

.ap-ref-link {
    flex: 1;
    min-width: 0;
    word-break: break-all;
    font-size: 0.8rem;
    padding: 0.65rem 0.75rem;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    border: 1px solid var(--ap-border);
    color: var(--ap-gold-soft);
}

.ap-btn.ap-btn--copy {
    width: auto;
    flex-shrink: 0;
    margin-top: 0;
    align-self: stretch;
    padding: 0.55rem 1rem;
    white-space: nowrap;
}

.ap-table-wrap {
    overflow-x: auto;
    margin-top: 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--ap-border);
}

.ap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.ap-table th,
.ap-table td {
    padding: 0.55rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ap-table th {
    color: var(--ap-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    background: rgba(0, 0, 0, 0.25);
}

.ap-table tbody tr:hover td {
    background: rgba(197, 160, 89, 0.04);
}

.ap-table-note {
    max-width: 220px;
    word-break: break-word;
    font-size: 0.76rem;
    color: var(--ap-muted);
}

.ap-form .ap-input,
.ap-form select,
.ap-form textarea {
    margin-bottom: 0.65rem;
}

.ap-form select,
.ap-form textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--ap-border);
    background: rgba(0, 0, 0, 0.35);
    color: var(--ap-ink);
    font-family: inherit;
}

.ap-footer-notice {
    margin-top: 1.75rem;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    border: 1px solid var(--ap-border-strong);
    background: linear-gradient(135deg, rgba(58, 42, 28, 0.35) 0%, rgba(24, 18, 12, 0.5) 100%);
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--ap-muted);
    max-width: 960px;
    box-shadow: inset 0 1px 0 rgba(255, 220, 170, 0.05);
}

.ap-footer-notice strong {
    display: block;
    color: var(--ap-gold-soft);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.45rem;
    font-weight: 800;
}

.ap-footer-notice a {
    color: var(--ap-gold);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ap-footer-notice a:hover {
    color: var(--ap-gold-soft);
}

.ap-login-aside .ap-footer-notice,
.ap-auth-wrap .ap-footer-notice {
    margin-top: 1.25rem;
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.ap-login-aside .ap-footer-notice {
    max-width: none;
}

/* ——— Language dropdown (same pattern as presentation lang-menu) ——— */
.ap-login-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    width: 100%;
    margin-bottom: 0.35rem;
}

.ap-topbar .ap-lang-menu {
    flex-shrink: 0;
    align-self: center;
}

.ap-lang-menu {
    position: relative;
    flex-shrink: 0;
    z-index: 400;
}

.ap-lang-menu__trigger {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.6rem 0.4rem 0.45rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--ap-gold-soft);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(197, 160, 89, 0.32);
    border-radius: 10px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    max-width: min(240px, 28vw);
}

.ap-lang-menu__trigger:hover,
.ap-lang-menu.is-open .ap-lang-menu__trigger {
    background: rgba(197, 160, 89, 0.12);
    border-color: var(--ap-gold);
    color: #fff;
}

.ap-lang-menu__trigger-flag {
    display: flex;
    align-items: center;
    line-height: 0;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.ap-lang-menu__trigger-flag .lang-flag {
    display: block;
    width: 26px;
    height: auto;
}

.ap-lang-menu__trigger-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.ap-lang-menu__caret {
    flex-shrink: 0;
    opacity: 0.85;
    margin-left: 0.1rem;
    transition: transform 0.2s ease;
}

.ap-lang-menu.is-open .ap-lang-menu__caret {
    transform: rotate(180deg);
}

.ap-lang-menu__panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: min(100vw - 24px, 260px);
    max-height: min(70vh, 420px);
    overflow-y: auto;
    padding: 0.35rem;
    border-radius: 10px;
    background: linear-gradient(180deg, #1e1814 0%, #14100e 100%);
    border: 1px solid rgba(197, 160, 89, 0.45);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.75),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.ap-lang-menu__item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.55rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--ap-ink);
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.ap-lang-menu__item:hover {
    background: rgba(197, 160, 89, 0.18);
    color: #fff;
}

.ap-lang-menu__item.is-active {
    background: rgba(197, 160, 89, 0.28);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(197, 160, 89, 0.4);
}

.ap-lang-menu__item-flag {
    flex-shrink: 0;
    line-height: 0;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.ap-lang-menu__item-flag .lang-flag {
    display: block;
    width: 28px;
    height: auto;
}

.ap-lang-menu__item-text {
    flex: 1;
    min-width: 0;
}

.ap-lang-menu--login .ap-lang-menu__trigger {
    max-width: min(180px, 42vw);
    padding: 0.32rem 0.45rem 0.32rem 0.38rem;
    font-size: 0.74rem;
    gap: 0.38rem;
}

.ap-lang-menu--login .ap-lang-menu__trigger-flag .lang-flag {
    width: 22px;
}

.ap-lang-menu--login .ap-lang-menu__trigger-label {
    max-width: 7.5rem;
}

.ap-lang-menu--login .ap-lang-menu__panel {
    right: 0;
    left: auto;
    min-width: min(92vw, 260px);
}

.ap-lang-menu--login .ap-lang-menu__caret {
    width: 12px;
    height: 12px;
}
