/* Auth-Modal auf der Startseite – ProjectPlayCore Design-System */

body.ppc-auth-modal-open {
    overflow: hidden;
}

body.ppc-auth-app-setup-required:not(.ppc-workspace-authenticated) {
    overflow: hidden;
}

.ppc-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.ppc-auth-modal.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.ppc-auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.ppc-auth-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    max-height: min(90vh, 720px);
    display: flex;
    flex-direction: column;
    background: var(--ppc-app-surface, #141e28);
    border: 1px solid var(--ppc-app-panel-border, #243447);
    border-radius: var(--ppc-app-radius, 10px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.ppc-auth-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: var(--ppc-app-panel, #1a2838);
    color: var(--ppc-app-text, #e8eef4);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.ppc-auth-close:hover {
    background: #243447;
    color: var(--ppc-app-accent, #f97316);
}

.ppc-auth-modal--mandatory-app-setup .ppc-auth-close {
    display: none !important;
}

.ppc-auth-modal--mandatory-app-setup .ppc-auth-modal-backdrop {
    pointer-events: none;
    cursor: default;
}

.ppc-auth-mandatory-hint {
    margin: 0 12px 8px;
    flex-shrink: 0;
    font-size: 0.92rem;
}

.ppc-auth-modal--mandatory-app-setup .ppc-auth-panels {
    border-top: 1px solid var(--ppc-app-panel-border, #243447);
}

.ppc-auth-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--ppc-app-panel-border, #243447);
    padding: 48px 16px 0;
    flex-shrink: 0;
}

.ppc-auth-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    color: var(--ppc-app-muted, #9aa8b8);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.ppc-auth-tab:hover {
    color: var(--ppc-app-text, #e8eef4);
}

.ppc-auth-tab.is-active {
    color: var(--ppc-app-accent, #f97316);
    border-bottom-color: var(--ppc-app-accent, #f97316);
}

.ppc-auth-panels {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ppc-auth-panels iframe {
    width: 100%;
    height: min(72vh, 640px);
    min-height: 380px;
    border: 0;
    display: block;
    background: var(--ppc-app-bg, #0c1218);
    flex: 1;
}

/* Iframe-Inhalt (?modal=1) */
body.ppc-auth-modal-frame {
    margin: 0;
    min-height: 100%;
    background: var(--ppc-app-bg, #0c1218);
}

.ppc-auth-modal-frame-inner {
    padding: 12px;
    box-sizing: border-box;
    min-height: 100%;
}

.ppc-auth-modal-frame-inner .ppc-page-card {
    margin: 0;
}

@media (max-width: 480px) {
    .ppc-auth-dialog {
        max-height: 95vh;
    }
    .ppc-auth-panels iframe {
        min-height: 340px;
        height: 65vh;
    }
}

/* Startseite: Auth-Modal-Schicht über dem Seiteninhalt */
.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-modal-backdrop {
    background: rgba(5, 12, 22, 0.55);
    backdrop-filter: blur(10px) saturate(1.05);
    -webkit-backdrop-filter: blur(10px) saturate(1.05);
}

/* ─── Gast-Hub: äußere Tabs wie Holo (Echo/Messenger), weniger „Admin-Karte“ ─── */
.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-tabs {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2.75rem 1.35rem 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
}

.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-tab {
    font-size: 0.82rem;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(148, 180, 210, 0.72);
    border-bottom-width: 2px;
}

.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-tab.is-active {
    color: rgba(186, 230, 253, 0.98);
    border-bottom-color: rgba(56, 189, 248, 0.65);
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-tab:hover {
    color: rgba(226, 238, 248, 0.92);
}

.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-close {
    border: 1px solid rgba(148, 180, 210, 0.12);
    color: rgba(226, 238, 248, 0.85);
    background: rgba(4, 10, 18, 0.45);
    backdrop-filter: blur(8px);
}

.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-dialog {
    max-width: min(560px, calc(100vw - 2rem));
    transition: max-width 0.2s ease;
    border-radius: 14px;
    background: rgba(6, 12, 22, 0.45);
    backdrop-filter: blur(14px) saturate(1.08);
    -webkit-backdrop-filter: blur(14px) saturate(1.08);
    border: 1px solid rgba(148, 180, 210, 0.16);
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.05),
        0 12px 40px rgba(0, 6, 16, 0.45);
}

.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-dialog.ppc-auth-dialog--wide {
    max-width: min(1280px, calc(100vw - 20px));
    max-height: min(96vh, 980px);
    overflow: visible;
}

.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-close:hover {
    background: rgba(56, 189, 248, 0.14);
    color: rgba(255, 255, 255, 0.95);
}

.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-panels iframe {
    background: transparent;
}

.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-dialog--wide .ppc-auth-panels iframe {
    min-height: 640px;
    height: min(92vh, 920px);
}

/* Registrierung: längeres Formular — höheres Modal, Scroll im Iframe */
.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-dialog.ppc-auth-dialog--register {
    max-width: min(520px, calc(100vw - 2rem));
    max-height: min(96vh, 940px);
}

.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-dialog.ppc-auth-dialog--login.ppc-auth-dialog--login-pending {
    max-width: min(440px, calc(100vw - 2rem));
}

.ppc-auth-modal.ppc-auth-modal--orbit-core .ppc-auth-dialog--register .ppc-auth-panels iframe {
    height: min(88vh, 880px);
    min-height: 700px;
}

body.ppc-auth-modal-frame--embed.ppc-auth-modal-frame--register {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

body.ppc-auth-modal-frame--embed.ppc-auth-modal-frame--register .ppc-auth-modal-frame-inner {
    overflow: visible;
    padding-bottom: 1.5rem;
}

body.ppc-auth-modal-frame--embed.ppc-auth-modal-frame--register .wp-form-group {
    margin-bottom: 0.85rem;
}

/* ─── Iframe-Inhalt (?modal=1): eine Ebene, kein zweites Karten-Innenfeld (Holo wie Orbit) ─── */
body.ppc-auth-modal-frame--embed.ppc-admin-body,
body.ppc-auth-modal-frame--embed.ppc-app-admin-body {
    background: transparent !important;
}

body.ppc-auth-modal-frame--embed {
    min-height: 100%;
    overflow: visible;
}

body.ppc-auth-modal-frame--embed .ppc-auth-modal-frame-inner {
    padding: 0.65rem 1rem 0.85rem;
    box-sizing: border-box;
    overflow: visible;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-page--compact {
    min-height: 0;
    overflow: visible;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-grid {
    overflow: visible;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem 1.25rem;
    margin-top: 0.75rem;
    align-items: start;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-setup-hint {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    line-height: 1.45;
    text-align: center;
    color: rgba(186, 210, 230, 0.82) !important;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-page--compact .ppc-app-link-section-title {
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    margin-bottom: 0.15rem;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-page--compact .ppc-app-link-step-hint {
    display: none;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-page--compact .ppc-qr-tap-link__hint {
    display: none;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-page--compact .ppc-app-link-qr-img {
    width: 200px;
    height: 200px;
    max-width: min(200px, calc(100% - 0.25rem));
}

body.ppc-auth-modal-frame--embed .ppc-app-link-pair-meta {
    margin-top: 0.4rem;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-pair-expires {
    margin: 0;
    font-size: 0.74rem;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-form--regen {
    margin-top: 0.35rem;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-copy-bar--pair-code {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

body.ppc-auth-modal-frame--embed .ppc-android-only-notice--app-link-modal {
    margin: 0.5rem 0 0.65rem;
    padding: 0.55rem 0.7rem;
}

body.ppc-auth-modal-frame--embed .ppc-android-only-notice--app-link-modal .ppc-android-only-notice__line {
    font-size: 0.78rem;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-page--shell-ready .ppc-app-link-setup-hint,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--shell-ready .ppc-app-link-pair-meta,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--shell-ready .ppc-app-link-copy-bar,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--completing .ppc-app-link-setup-hint,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--completing .ppc-app-link-pair-meta,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--completing .ppc-app-link-copy-bar,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--shell-ready:not(.ppc-app-link-page--await-login-approval) .ppc-app-link-status,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--completing .ppc-app-link-status,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--shell-ready .ppc-android-only-notice--app-link-modal,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--completing .ppc-android-only-notice--app-link-modal {
    display: none !important;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-page--await-login-approval #ppc-link-status-finalize-wait {
    display: block !important;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-page--await-login-approval .ppc-app-link-grid,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--await-login-approval .ppc-app-link-setup-hint,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--await-login-approval .ppc-app-link-pair-meta,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--await-login-approval .ppc-app-link-copy-bar,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--await-login-approval .ppc-android-only-notice--app-link-modal,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--pairing-ui-hidden .ppc-app-link-grid,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--pairing-ui-hidden .ppc-app-link-setup-hint,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--pairing-ui-hidden .ppc-app-link-pair-meta,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--pairing-ui-hidden .ppc-app-link-copy-bar,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--pairing-ui-hidden .ppc-android-only-notice--app-link-modal,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--shell-ready:not(.ppc-app-link-page--await-login-approval) .ppc-app-link-grid {
    display: none !important;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-page--shell-ready,
body.ppc-auth-modal-frame--embed .ppc-app-link-page--completing {
    min-height: 0;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-pair-meta {
    margin-top: 0.65rem;
    text-align: center;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-copy-bar--pair-code {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(148, 180, 210, 0.14);
    flex-direction: column;
    align-items: stretch;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-copy-bar--pair-code .ppc-app-link-pair-code-block {
    width: 100%;
    max-width: none;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-form--regen {
    margin-top: 0.65rem;
    width: 100%;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-regen-btn {
    width: 100%;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-pair-expires {
    margin: 0.35rem 0 0;
    font-size: 0.76rem;
    line-height: 1.35;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-page--complete .ppc-app-link-grid {
    display: none;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-pair-code-block {
    margin-top: 0.15rem;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-pair-code-input {
    background: rgba(4, 12, 22, 0.55) !important;
    border: 1px solid rgba(56, 189, 248, 0.22) !important;
    border-radius: 10px !important;
    color: rgba(241, 245, 249, 0.96) !important;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-pair-code-label {
    color: rgba(148, 200, 230, 0.88) !important;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-pair-code-hint {
    color: rgba(186, 210, 230, 0.72) !important;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-pair-code-fallback-note {
    color: rgba(186, 210, 230, 0.78) !important;
    font-size: 0.76rem !important;
    line-height: 1.4 !important;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-pair-code-summary {
    font-size: 0.78rem !important;
    color: rgba(165, 220, 245, 0.9) !important;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-copy-bar {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    overflow: visible;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-copy-bar .wp-button-secondary {
    min-width: min(100%, 12.5rem);
    flex: 0 0 auto;
}

body.ppc-auth-modal-frame--embed .ppc-page-card,
body.ppc-auth-modal-frame--embed .ppc-user-card,
body.ppc-auth-modal-frame--embed .ppc-user-card--login {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}

body.ppc-auth-modal-frame--embed .wp-welcome-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.ppc-auth-modal-frame--embed .wp-welcome-box h1 {
    font-size: clamp(1.22rem, 2.6vw, 1.48rem);
    font-weight: 750;
    line-height: 1.2;
    color: rgba(248, 250, 252, 0.98) !important;
    margin: 0 0 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    letter-spacing: -0.02em;
}

body.ppc-auth-modal-frame--embed .wp-form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(148, 200, 230, 0.88) !important;
}

body.ppc-auth-modal-frame--embed .wp-muted {
    font-size: 0.78rem !important;
    line-height: 1.5 !important;
    color: rgba(186, 210, 230, 0.72) !important;
}

body.ppc-auth-modal-frame--embed .wp-form-input {
    background: rgba(4, 12, 22, 0.55) !important;
    border: 1px solid rgba(56, 189, 248, 0.22) !important;
    border-radius: 10px !important;
    color: rgba(241, 245, 249, 0.96) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.ppc-auth-modal-frame--embed .wp-form-input:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.45) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 3px rgba(56, 189, 248, 0.12);
}

body.ppc-auth-modal-frame--embed .wp-button-primary,
body.ppc-auth-modal-frame--embed .wp-form-submit {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.72rem 1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase;
    font-size: 0.82rem !important;
    border-radius: 10px !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    color: #0b1016 !important;
    background: linear-gradient(160deg, #bae6fd 0%, #38bdf8 48%, #0ea5e9 100%) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 6px 22px rgba(0, 0, 0, 0.38);
}

body.ppc-auth-modal-frame--embed .wp-button-primary:hover,
body.ppc-auth-modal-frame--embed .wp-form-submit:hover {
    filter: brightness(1.05);
}

body.ppc-auth-modal-frame--embed .wp-message-error,
body.ppc-auth-modal-frame--embed .wp-message-info {
    border-radius: 10px !important;
    border: 1px solid rgba(56, 189, 248, 0.2) !important;
    background: rgba(4, 12, 20, 0.65) !important;
}

body.ppc-auth-modal-frame--embed .wp-welcome-box p.wp-muted a {
    color: rgba(125, 211, 252, 0.95) !important;
    font-weight: 600;
    text-decoration: none;
}

body.ppc-auth-modal-frame--embed .wp-welcome-box p.wp-muted a:hover {
    text-decoration: underline;
}

body.ppc-auth-modal-frame--embed .wp-welcome-box > p:first-of-type {
    color: rgba(210, 222, 236, 0.9);
    line-height: 1.62;
    font-size: 0.95rem;
    margin: 0 0 1rem;
}

body.ppc-auth-modal-frame--embed .wp-button-secondary {
    background: rgba(8, 12, 20, 0.65) !important;
    color: rgba(186, 230, 253, 0.95) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
}

body.ppc-auth-modal-frame--embed .wp-form-checkbox {
    accent-color: #38bdf8;
}

body.ppc-auth-modal-frame--embed .wp-form-group label:has(.wp-form-checkbox) {
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.88rem;
    color: rgba(210, 222, 236, 0.88) !important;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-pairing-hint {
    color: rgba(186, 210, 230, 0.82) !important;
    font-size: 0.82rem !important;
    line-height: 1.55 !important;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-qr-wrap {
    margin: 0;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-copy-bar {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
}

body.ppc-auth-modal-frame--embed .ppc-app-link-copy-bar .wp-button-secondary {
    min-width: min(100%, 12.5rem);
}
