/* CHANGE: /profil standalone UI — dashboard shell, no admin.css. */
:root {
    --p-bg: #0b0c0e;
    --p-bg-elev: #121417;
    --p-surface: #171a1f;
    --p-surface-2: #1c2026;
    --p-border: #2c323b;
    --p-border-soft: #232830;
    --p-text: #f0eee8;
    --p-muted: #9b968c;
    --p-accent: #e0a82a;
    --p-accent-hover: #f0bc3d;
    --p-accent-dim: rgba(224, 168, 42, 0.14);
    --p-accent-line: rgba(224, 168, 42, 0.35);
    --p-ok-bg: rgba(76, 175, 122, 0.12);
    --p-err-bg: rgba(224, 112, 96, 0.12);
    --p-radius: 12px;
    --p-radius-sm: 8px;
    --p-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    --p-font: "Figtree", "Segoe UI", sans-serif;
    --p-display: "Syne", "Figtree", sans-serif;
    --p-mono: "IBM Plex Mono", Consolas, monospace;
    --p-max-auth: 520px;
    --p-max-doc: 920px;
    --p-max-app: 1120px;
}

html[data-theme="light"] {
    --p-bg: #f3f1eb;
    --p-bg-elev: #faf8f4;
    --p-surface: #ffffff;
    --p-surface-2: #f7f5f0;
    --p-border: #d8d2c6;
    --p-border-soft: #e4dfd4;
    --p-text: #1a1814;
    --p-muted: #6b655c;
    --p-shadow: 0 12px 32px rgba(40, 30, 10, 0.08);
}

html[data-accent="blue"] {
    --p-accent: #3b82f6;
    --p-accent-hover: #60a5fa;
    --p-accent-dim: rgba(59, 130, 246, 0.14);
    --p-accent-line: rgba(59, 130, 246, 0.4);
}

html[data-accent="amber"] {
    --p-accent: #e0a82a;
    --p-accent-hover: #f0bc3d;
    --p-accent-dim: rgba(224, 168, 42, 0.14);
    --p-accent-line: rgba(224, 168, 42, 0.35);
}

/* CHANGE: smooth theme/accent switch only while html.theme-animating is on */
html.theme-animating,
html.theme-animating body,
html.theme-animating body *,
html.theme-animating body *::before,
html.theme-animating body *::after {
    transition:
        background-color 0.45s ease,
        background 0.45s ease,
        color 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.45s ease,
        fill 0.4s ease,
        stroke 0.4s ease,
        opacity 0.4s ease,
        filter 0.4s ease !important;
}

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

.profil-body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: var(--p-font);
    background: var(--p-bg);
    color: var(--p-text);
    position: relative;
    line-height: 1.45;
}

.profil-atmosphere {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(900px 480px at 12% -8%, rgba(224, 168, 42, 0.11), transparent 55%),
        radial-gradient(700px 420px at 92% 8%, rgba(70, 90, 110, 0.18), transparent 50%),
        linear-gradient(180deg, #0e1013 0%, var(--p-bg) 42%, #090a0c 100%);
}

.profil-atmosphere::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 70%);
}

.profil-frame {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.profil-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    max-width: var(--p-max-app);
    margin: 0 auto;
    padding: 1rem 1.35rem;
}

.profil-body-auth .profil-topbar {
    max-width: 720px;
}

.profil-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--p-text);
    text-decoration: none;
}

.profil-brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #1c2026 0%, #121417 100%);
    border: 1px solid rgba(224, 168, 42, 0.45);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 6px 16px rgba(224, 168, 42, 0.12);
    position: relative;
}

.profil-brand-mark::after {
    display: none;
}

.profil-brand-mark svg {
    display: block;
    width: 18px;
    height: 18px;
}

.profil-brand-text {
    font-family: var(--p-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}

.profil-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.profil-user-chip {
    font-size: 0.85rem;
    font-weight: 650;
    color: var(--p-muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profil-body-row {
    flex: 1 0 auto;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.35rem 2rem;
}

/* Auth pages (login, invite): single narrow column */
.profil-body-auth .profil-body-row {
    max-width: var(--p-max-auth);
}

/* Policy and similar long-form pages */
.profil-body-doc .profil-topbar,
.profil-body-doc .profil-body-row,
.profil-body-doc .profil-footer-inner {
    max-width: var(--p-max-doc);
}

/* Cabinet app shell: sidebar + content */
.profil-body-app .profil-body-row {
    max-width: var(--p-max-app);
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.profil-sidebar {
    position: sticky;
    top: 1rem;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 1rem 0.85rem;
    box-shadow: var(--p-shadow);
}

.profil-sidebar-label {
    margin: 0 0 0.65rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6e6a62;
}

.profil-side-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.profil-side-link {
    display: block;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    color: var(--p-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.profil-side-link:hover {
    color: var(--p-text);
    background: rgba(255, 255, 255, 0.03);
}

.profil-side-link.is-active {
    color: #1a1408;
    background: linear-gradient(180deg, var(--p-accent-hover), var(--p-accent));
    border-color: transparent;
}

.profil-side-link-muted {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6e6a62;
}

.profil-content {
    min-width: 0;
}

.dash-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.discord-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
    padding: 1rem 1.15rem;
    text-decoration: none !important;
    border-radius: var(--p-radius);
    color: var(--p-text) !important;
    border: 1px solid rgba(88, 101, 242, 0.45);
    background:
        radial-gradient(420px 140px at 6% 0%, rgba(88, 101, 242, 0.38), transparent 70%),
        linear-gradient(90deg, rgba(88, 101, 242, 0.2), rgba(88, 101, 242, 0.07));
}

.discord-banner:hover {
    border-color: #5865f2;
}

.discord-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #5865f2;
    color: #fff;
}

.discord-banner-copy {
    flex: 1 1 180px;
    min-width: 0;
}

.discord-banner-copy strong {
    display: block;
    font-family: var(--p-display);
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.discord-banner-copy span {
    color: var(--p-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.discord-banner-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #5865f2;
    color: #fff !important;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dash-kicker {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--p-accent);
}

.dash-header h1 {
    font-family: var(--p-display);
    font-weight: 700;
    font-size: clamp(1.55rem, 3vw, 2rem);
    letter-spacing: -0.02em;
    margin: 0 0 0.4rem;
}

.dash-stats {
    display: flex;
    gap: 0.65rem;
}

.dash-stat {
    min-width: 88px;
    padding: 0.75rem 0.9rem;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-sm);
    text-align: center;
}

.dash-stat-value {
    display: block;
    font-family: var(--p-display);
    font-size: 1.35rem;
    font-weight: 700;
}

.dash-stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--p-muted);
    margin-top: 0.15rem;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dash-card-wide {
    grid-column: 1 / -1;
}

.dash-account-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin: 0 0 0.65rem;
}

.dash-actions {
    margin-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dash-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.dash-steps li {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.85rem;
    background: var(--p-bg);
    border: 1px solid var(--p-border-soft);
    border-radius: var(--p-radius-sm);
    color: var(--p-muted);
    font-size: 0.9rem;
}

.dash-step-n {
    flex: 0 0 auto;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1a1408;
    background: var(--p-accent);
}

.profil-body h1 {
    font-family: var(--p-display);
    font-weight: 700;
    font-size: clamp(1.45rem, 3vw, 1.85rem);
    letter-spacing: -0.02em;
    margin: 0 0 0.45rem;
}

.profil-body h2 {
    font-family: var(--p-display);
    font-weight: 650;
    font-size: 1.08rem;
    margin: 0 0 0.75rem;
}

.profil-body h3 {
    font-family: var(--p-display);
    font-size: 0.95rem;
    margin: 1rem 0 0.4rem;
}

.profil-lead {
    color: var(--p-muted);
    font-size: 0.98rem;
    line-height: 1.55;
    margin: 0;
    max-width: 40rem;
}

.profil-body .card {
    background: linear-gradient(180deg, var(--p-surface) 0%, var(--p-bg-elev) 100%);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    padding: 1.15rem 1.2rem;
    margin-bottom: 0;
    box-shadow: var(--p-shadow);
}

.profil-body-auth .card {
    margin-bottom: 1rem;
}

.profil-body .hint {
    color: var(--p-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.profil-body a {
    color: var(--p-accent);
    text-decoration: none;
}

.profil-body a:hover {
    color: var(--p-accent-hover);
}

.profil-body .error {
    background: var(--p-err-bg);
    color: #f2b4aa;
    border: 1px solid rgba(224, 112, 96, 0.35);
    border-radius: var(--p-radius-sm);
    padding: 0.75rem 0.9rem;
    margin: 0 0 1rem;
}

.profil-body .success {
    background: var(--p-ok-bg);
    color: #b6e6c8;
    border: 1px solid rgba(76, 175, 122, 0.35);
    border-radius: var(--p-radius-sm);
    padding: 0.75rem 0.9rem;
    margin: 0 0 1rem;
}

.profil-body .meta {
    color: var(--p-muted);
    font-size: 0.9rem;
}

.profil-body label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--p-muted);
    margin: 0.55rem 0 0.3rem;
}

.profil-body input[type="text"],
.profil-body input[type="password"],
.profil-body input:not([type]),
.profil-body textarea,
.profil-body select {
    width: 100%;
    background: var(--p-bg);
    border: 1px solid var(--p-border);
    color: var(--p-text);
    border-radius: var(--p-radius-sm);
    padding: 0.65rem 0.75rem;
    font-family: var(--p-font);
    font-size: 0.95rem;
}

.profil-body input:focus,
.profil-body textarea:focus {
    outline: none;
    border-color: var(--p-accent);
    box-shadow: 0 0 0 3px var(--p-accent-dim);
}

.btn-primary,
.profil-body a.btn-primary,
.profil-body button.btn-primary,
.profil-body .login-form > button[type="submit"],
.profil-body form.login-form button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--p-accent-hover) 0%, var(--p-accent) 100%);
    color: #1a1408 !important;
    border: none;
    border-radius: var(--p-radius-sm);
    padding: 0.7rem 1.15rem;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: var(--p-font);
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: 0 8px 20px rgba(224, 168, 42, 0.22);
}

.btn-primary:hover,
.profil-body a.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-secondary,
.profil-body button.btn-secondary,
.profil-body button.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--p-surface-2);
    color: var(--p-text);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-sm);
    padding: 0.55rem 0.95rem;
    font-weight: 600;
    font-family: var(--p-font);
    cursor: pointer;
}

.btn-ghost {
    background: transparent;
    color: var(--p-muted);
    border: 1px solid var(--p-border);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: var(--p-font);
    cursor: pointer;
}

.btn-ghost:hover {
    color: var(--p-text);
    border-color: var(--p-accent-line);
}

.btn-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.profil-body .badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--p-surface-2);
    border: 1px solid var(--p-border);
    color: var(--p-muted);
}

.profil-body .badge.active {
    background: var(--p-ok-bg);
    border-color: rgba(76, 175, 122, 0.4);
    color: #8fd9ad;
}

.profil-body .badge.revoked {
    background: var(--p-err-bg);
    border-color: rgba(224, 112, 96, 0.4);
    color: #f0a89c;
}

.profil-body code,
.profil-body .key {
    font-family: var(--p-mono);
    font-size: 0.86rem;
    background: var(--p-bg);
    border: 1px solid var(--p-border-soft);
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

.profil-keys {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.profil-keys .license {
    background: var(--p-bg);
    border: 1px solid var(--p-border-soft);
    border-radius: var(--p-radius-sm);
    padding: 0.95rem 1rem;
}

.key-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.key-row .key {
    word-break: break-all;
}

.btn-copy {
    background: var(--p-surface-2);
    color: var(--p-text);
    border: 1px solid var(--p-border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--p-font);
}

.btn-copy:hover {
    border-color: var(--p-accent-line);
    color: var(--p-accent);
}

.pcs-title {
    font-size: 14px;
    margin: 12px 0 8px;
    color: var(--p-muted);
}

.pc-list,
.unbind-history {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pc-item,
.unbind-history-item {
    background: var(--p-bg);
    border: 1px solid var(--p-border-soft);
    border-radius: var(--p-radius-sm);
    padding: 10px 12px;
}

.pc-item {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
}

.pc-meta {
    font-size: 13px;
    color: #c5c0b6;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.unbind-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.unbind-form input[type="text"] {
    min-width: 140px;
    max-width: 220px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.unbind-history-item.status-rejected { border-color: rgba(224, 112, 96, 0.45); }
.unbind-history-item.status-approved { border-color: rgba(76, 175, 122, 0.45); }
.unbind-history-item.status-pending { border-color: rgba(224, 168, 42, 0.4); }

.unbind-history-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.admin-reply {
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--p-surface-2);
    border-radius: 6px;
    color: #ddd8ce;
    font-size: 13px;
}

.login-split {
    display: flex;
    flex-wrap: wrap;
    gap: 1.35rem 1.85rem;
    align-items: stretch;
    padding: 1.4rem 1.45rem !important;
}

.login-form-narrow {
    flex: 0 1 260px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
}

.login-alt {
    flex: 1 1 200px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    justify-content: center;
    border-left: 1px solid var(--p-border);
    padding-left: 1.5rem;
}

.login-alt-label {
    font-size: 11px;
    color: var(--p-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.btn-alt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none !important;
    border-radius: var(--p-radius-sm);
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 650;
    border: 1px solid transparent;
}

.btn-invite {
    background: var(--p-accent-dim);
    color: #f3d789 !important;
    border-color: var(--p-accent-line);
}

.btn-codefling {
    background: rgba(60, 110, 90, 0.22);
    color: #b8e0cb !important;
    border-color: rgba(80, 140, 110, 0.45);
}

.btn-discord {
    background: rgba(88, 101, 242, 0.22);
    color: #c5cafc !important;
    border-color: rgba(88, 101, 242, 0.5);
}

.lang-switch { position: relative; z-index: 20; }

.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    color: var(--p-text);
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--p-font);
}

.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    list-style: none;
    margin: 0;
    padding: 6px;
    min-width: 118px;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: 12px;
    box-shadow: var(--p-shadow);
}

.lang-menu li { margin: 0; }

.lang-option {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 8px 10px;
    color: var(--p-text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
}

.lang-option:hover,
.lang-option.active { background: var(--p-accent-dim); }

.lang-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.lang-code { font-weight: 600; }

.profil-footer {
    margin-top: auto;
    border-top: 1px solid var(--p-border-soft);
    background: rgba(8, 9, 11, 0.75);
}

.profil-footer-inner {
    max-width: var(--p-max-app);
    margin: 0 auto;
    padding: 1.1rem 1.35rem 1.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.profil-body-auth .profil-footer-inner {
    max-width: 720px;
}

.profil-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.profil-footer-nav a {
    color: var(--p-muted) !important;
    font-size: 0.88rem;
    font-weight: 600;
}

.profil-footer-nav a:hover { color: var(--p-accent) !important; }

.profil-footer-copy {
    margin: 0;
    color: #6e6a62;
    font-size: 0.8rem;
}

.policy-doc { line-height: 1.65; }
.policy-doc .policy-section { margin-bottom: 1.35rem; }
.policy-doc .policy-section p { color: var(--p-muted); margin: 0.4rem 0 0; }
.policy-doc .policy-updated { font-size: 0.85rem; color: #6e6a62; margin: 0 0 1.25rem; }
.policy-back { margin-top: 1.5rem; }

.inline { display: inline; }
.password-field { position: relative; }

@media (max-width: 900px) {
    .profil-body-app .profil-body-row {
        grid-template-columns: 1fr;
    }

    .profil-sidebar {
        position: static;
    }

    .profil-side-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .dash-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }

    .login-alt {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--p-border);
        padding-top: 1rem;
    }

    .login-form-narrow {
        max-width: none;
        flex: 1 1 100%;
    }
}
