/* ======================================================
   FOENEM — LUXURY GOLD & BLACK DESIGN SYSTEM
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=Inter:wght@300;400;500&display=swap');

/* -------------------------
   CSS Custom Properties
   ------------------------- */
:root {
    --bg:            #060606;
    --panel-bg:      #0c0c0c;
    --card-bg:       #0f0f0f;

    --gold:          #C9A84C;
    --gold-bright:   #E8C96B;
    --gold-dim:      rgba(201, 168, 76, 0.55);
    --gold-subtle:   rgba(201, 168, 76, 0.12);
    --gold-border:   rgba(201, 168, 76, 0.30);
    --gold-border-h: rgba(201, 168, 76, 0.65);

    /* Legacy alias — still referenced as var(--crt-amber) in some inline blocks */
    --crt-amber:     #C9A84C;
    --crt-bg:        #060606;
    --crt-panel-bg:  #0c0c0c;
    --crt-border:    rgba(201, 168, 76, 0.28);
    --crt-green:     #54c97a;
    --crt-blue:      #5bb8e8;
    --crt-pink:      #d4a0e0;
    --crt-red:       #e05a6a;
    --crt-dim:       rgba(255, 255, 255, 0.50);

    --glow-gold:   0 0 8px rgba(201, 168, 76, .55), 0 0 22px rgba(201, 168, 76, .22);
    --glow-gold-s: 0 0 5px rgba(201, 168, 76, .38), 0 0 14px rgba(201, 168, 76, .14);
    --glow-white:  0 0 6px rgba(255, 255, 255, .18), 0 0 14px rgba(255, 255, 255, .08);
    --glow-green:  0 0 6px rgba(84, 201, 122, .45), 0 0 18px rgba(84, 201, 122, .18);
    --glow-red:    0 0 6px rgba(224, 90, 106, .55), 0 0 18px rgba(224, 90, 106, .22);
    --glow-amber:  0 0 8px rgba(201, 168, 76, .55), 0 0 22px rgba(201, 168, 76, .22);

    --font-display: 'Cormorant Garamond', 'Georgia', serif;
    --font-mono:    'Inter', 'Helvetica Neue', sans-serif;
}

/* -------------------------
   Global Reset
   ------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, .22);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 168, 76, .45);
}

html {
    scroll-behavior: smooth;
}

/* -------------------------
   Base Body
   ------------------------- */
body {
    background: var(--bg);
    color: #d4c8a8;
    font-family: var(--font-mono);
    font-weight: 300;
    letter-spacing: 0.3px;
    line-height: 1.6;
    overflow-x: hidden;
    animation: luxuryFadeIn 0.6s ease forwards;
}

@keyframes luxuryFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Subtle gold vignette */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(ellipse at center,
        transparent 55%,
        rgba(0, 0, 0, 0.70) 100%);
}

/* Ultra-subtle gold texture overlay */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9997;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(201, 168, 76, 0.012) 3px,
            rgba(201, 168, 76, 0.012) 4px
        );
}

/* -------------------------
   Typography
   ------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 1.5px;
    color: var(--gold-bright);
}

/* -------------------------
   Links
   ------------------------- */
a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.18s, text-shadow 0.18s;
}

a:hover {
    color: var(--gold-bright);
    text-shadow: var(--glow-gold-s);
    text-decoration: underline;
}

/* -------------------------
   Topbar / Nav
   ------------------------- */
.retro-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    background: rgba(6, 6, 6, 0.96);
    border-bottom: 1px solid var(--gold-border);
    backdrop-filter: blur(8px);
}

/* Gold shimmer sweep along bottom border */
.retro-topbar::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--gold) 40%,
        var(--gold-bright) 50%,
        var(--gold) 60%,
        transparent 100%);
    animation: goldShimmer 5s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes goldShimmer {
    0%   { transform: translateX(-120%); opacity: 0; }
    15%  { opacity: 0.7; }
    85%  { opacity: 0.7; }
    100% { transform: translateX(120%);  opacity: 0; }
}

.crumbs {
    font-size: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 400;
}

.crumbs a {
    color: rgba(201, 168, 76, 0.55);
    text-decoration: none;
    transition: color 0.18s, text-shadow 0.18s;
}

.crumbs a:hover {
    color: var(--gold-bright);
    text-shadow: var(--glow-gold-s);
}

.crumbs a.active {
    color: var(--gold);
}

.crumbs .sep {
    opacity: 0.35;
    color: var(--gold);
}

.retro-topbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* -------------------------
   Buttons
   ------------------------- */
.btn-retro {
    border: 1px solid var(--gold-border);
    background: transparent;
    color: var(--gold);
    padding: 5px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-retro::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201,168,76,0) 0%, rgba(201,168,76,0.04) 100%);
    transition: opacity 0.2s;
    opacity: 0;
}

.btn-retro:hover {
    background: rgba(201, 168, 76, 0.10);
    border-color: var(--gold);
    color: var(--gold-bright);
    box-shadow: var(--glow-gold-s);
    text-decoration: none;
}

.btn-retro:hover::before {
    opacity: 1;
}

.btn-retro:active {
    background: rgba(201, 168, 76, 0.18);
}

/* Gold CTA variant (primary) */
.btn-retro--green,
.btn-retro--amber {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-retro--green:hover,
.btn-retro--amber:hover {
    background: rgba(201, 168, 76, .12);
    border-color: var(--gold-bright);
    color: var(--gold-bright);
    box-shadow: var(--glow-gold);
}

/* -------------------------
   Panel / Card
   ------------------------- */
.retro-panel {
    border: 1px solid var(--gold-border);
    background: var(--panel-bg);
    position: relative;
    padding: 24px;
}

/* Outer gold frame line */
.retro-panel::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(201, 168, 76, 0.06);
    pointer-events: none;
}

.retro-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    border-bottom: 1px solid var(--gold-border);
    padding-bottom: 16px;
    margin-bottom: 18px;
}

.retro-panel-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-style: italic;
    letter-spacing: 2px;
    font-weight: 600;
    line-height: 1;
    color: var(--gold-bright);
    text-shadow: var(--glow-gold-s);
}

/* -------------------------
   Brand / Logo
   ------------------------- */
.retro-brand {
    font-family: var(--font-display);
    font-size: 78px;
    font-style: italic;
    font-weight: 600;
    letter-spacing: 6px;
    line-height: 1;
    color: var(--gold);
    text-shadow: var(--glow-gold);
    user-select: none;
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, #a07830 0%, #E8C96B 45%, #C9A84C 70%, #a07830 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Blinking cursor after brand */
.retro-brand::after {
    content: "▎";
    font-size: 0.45em;
    vertical-align: middle;
    margin-left: 2px;
    animation: cursorBlink 1.2s step-end infinite;
    -webkit-text-fill-color: var(--gold-dim);
    color: var(--gold-dim);
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* -------------------------
   Forms / Inputs
   ------------------------- */
.retro-input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: rgba(201, 168, 76, 0.03);
    border: 1px solid rgba(201, 168, 76, 0.22);
    border-bottom-color: rgba(201, 168, 76, 0.40);
    color: #d4c8a8;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 300;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    letter-spacing: 0.5px;
    border-radius: 0;
}

.retro-input::placeholder {
    color: rgba(201, 168, 76, 0.28);
    letter-spacing: 0.5px;
}

.retro-input:focus {
    border-color: var(--gold);
    box-shadow: var(--glow-gold-s), inset 0 0 12px rgba(201, 168, 76, .04);
    background: rgba(201, 168, 76, .025);
}

.retro-label {
    display: block;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(201, 168, 76, 0.50);
    margin-bottom: 5px;
}

.retro-error {
    display: block;
    font-size: 12px;
    color: #e07a8a;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    margin-top: -8px;
}

/* -------------------------
   Role Badges
   ------------------------- */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px 2px 7px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: 1px solid currentColor;
    border-radius: 1px;
    white-space: nowrap;
    position: relative;
    transition: box-shadow 0.2s;
}

.role-badge::before {
    content: "◆";
    font-size: 6px;
    opacity: 0.9;
}

/* Admin badge — gold */
.role-badge--admin {
    color: var(--gold-bright);
    background: rgba(232, 201, 107, 0.08);
    box-shadow: 0 0 6px rgba(232, 201, 107, .30), inset 0 0 10px rgba(232, 201, 107, .06);
    animation: adminGlow 3.5s ease-in-out infinite;
}

@keyframes adminGlow {
    0%, 100% { box-shadow: 0 0 6px rgba(232, 201, 107, .28), inset 0 0 10px rgba(232, 201, 107, .06); }
    50%       { box-shadow: 0 0 12px rgba(232, 201, 107, .55), inset 0 0 18px rgba(232, 201, 107, .10); }
}

/* User badge — muted gold */
.role-badge--user {
    color: rgba(201, 168, 76, 0.65);
    background: rgba(201, 168, 76, 0.06);
    box-shadow: 0 0 4px rgba(201, 168, 76, .12), inset 0 0 6px rgba(201, 168, 76, .03);
}

/* Custom tag badge */
.role-badge--custom {
    background: rgba(255, 255, 255, 0.03);
}

/* -------------------------
   Table (Userlist)
   ------------------------- */
.retro-table {
    width: 100%;
    border-collapse: collapse;
}

.retro-table thead th {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gold-border);
    color: rgba(201, 168, 76, 0.55);
    font-weight: normal;
}

.retro-table tbody td {
    padding: 12px;
    font-size: 13px;
    border-bottom: 1px solid rgba(201, 168, 76, .06);
    vertical-align: middle;
    color: #c8bba0;
}

.retro-table tbody tr {
    position: relative;
    transition: background 0.18s;
    cursor: pointer;
}

.retro-table tbody tr:hover {
    background: rgba(201, 168, 76, .04);
}

/* Left gold accent bar on row hover */
.retro-table tbody tr::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: transparent;
    transition: background 0.18s, box-shadow 0.18s;
}

.retro-table tbody tr:hover::before {
    background: var(--gold);
    box-shadow: 0 0 8px rgba(201, 168, 76, .5);
}

/* -------------------------
   Modal
   ------------------------- */
.modal-content {
    background: var(--panel-bg);
    border: 1px solid var(--gold-border);
    border-radius: 0;
    color: #d4c8a8;
    font-family: var(--font-mono);
}

.modal-header {
    border-bottom: 1px solid var(--gold-border);
    padding: 14px 18px;
}

.modal-footer {
    border-top: 1px solid var(--gold-border);
    padding: 12px 18px;
}

.modal-title {
    font-family: var(--font-mono);
    font-weight: 400;
    letter-spacing: 1.5px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--gold);
}

.close {
    color: rgba(201, 168, 76, 0.6);
    opacity: 1;
    text-shadow: none;
    transition: color 0.18s;
}

.close:hover {
    color: var(--gold-bright);
    text-shadow: var(--glow-gold-s);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--gold-border);
    border-radius: 0;
    color: var(--gold);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.btn-secondary:hover {
    background: rgba(201, 168, 76, 0.10);
    border-color: var(--gold);
    color: var(--gold-bright);
}

/* -------------------------
   Online users bar
   ------------------------- */
.online-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: rgba(6, 6, 6, 0.96);
    border-top: 1px solid var(--gold-border);
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 8px;
    font-size: 11px;
    z-index: 900;
    letter-spacing: 0.8px;
    backdrop-filter: blur(8px);
}

.online-bar-label {
    color: rgba(201, 168, 76, 0.40);
    letter-spacing: 1.8px;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.online-bar-users {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    color: rgba(201, 168, 76, 0.70);
}

/* Gold cursor blink */
.online-bar::after {
    content: "▎";
    color: rgba(201, 168, 76, 0.5);
    animation: cursorBlink 1.2s step-end infinite;
    margin-left: 2px;
}

/* -------------------------
   Subscription status
   ------------------------- */
.sub-active {
    color: #7edea8;
    text-shadow: 0 0 8px rgba(126, 222, 168, .55), 0 0 20px rgba(126, 222, 168, .22);
    animation: subPulseGreen 2.6s ease-in-out infinite;
}

.sub-inactive {
    color: #e07a8a;
    text-shadow: 0 0 8px rgba(224, 90, 103, .55), 0 0 20px rgba(224, 90, 103, .22);
    animation: subPulseRed 2.6s ease-in-out infinite;
}

@keyframes subPulseGreen {
    0%, 100% { text-shadow: 0 0 6px rgba(126,222,168,.40), 0 0 16px rgba(126,222,168,.18); }
    50%       { text-shadow: 0 0 12px rgba(126,222,168,.70), 0 0 26px rgba(126,222,168,.35); }
}

@keyframes subPulseRed {
    0%, 100% { text-shadow: 0 0 6px rgba(224,90,103,.40), 0 0 16px rgba(224,90,103,.18); }
    50%       { text-shadow: 0 0 12px rgba(224,90,103,.70), 0 0 26px rgba(224,90,103,.35); }
}

/* -------------------------
   Muted / Meta text
   ------------------------- */
.muted {
    color: rgba(201, 168, 76, 0.50);
}

.meta {
    font-size: 13px;
    line-height: 1.6;
    margin-top: 6px;
    color: #b0a48a;
}

/* -------------------------
   Card (Dashboard)
   ------------------------- */
.retro-card {
    border: 1px solid rgba(201, 168, 76, 0.20);
    background: var(--card-bg);
    padding: 18px;
    position: relative;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

/* Subtle corner accent */
.retro-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--gold);
    opacity: 0.5;
    transition: opacity 0.2s, width 0.25s;
}

.retro-card:hover {
    background: rgba(201, 168, 76, .025);
    border-color: rgba(201, 168, 76, .40);
    box-shadow: 0 0 22px rgba(201, 168, 76, .06), inset 0 0 28px rgba(201, 168, 76, .02);
}

.retro-card:hover::before {
    opacity: 1;
    width: 40px;
}

.retro-card h4 {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: rgba(201, 168, 76, 0.50);
    margin-bottom: 12px;
}

/* -------------------------
   Invite badge
   ------------------------- */
.invite-badge {
    display: inline-block;
    border: 1px solid rgba(201, 168, 76, .22);
    padding: 1px 8px;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(201, 168, 76, .55);
    vertical-align: middle;
    margin-left: 6px;
}

.invite-badge--used {
    border-color: rgba(224, 90, 103, .35);
    color: #e07a8a;
}

.invite-badge--free {
    border-color: rgba(126, 222, 168, .30);
    color: #7edea8;
}

/* -------------------------
   Layout helpers
   ------------------------- */
.page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 16px 52px;
    position: relative;
    z-index: 1;
}

.page-wrap--top {
    align-items: flex-start;
    padding-top: 74px;
}

/* -------------------------
   Starfield canvas
   ------------------------- */
#starfield {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* -------------------------
   Divider
   ------------------------- */
.retro-divider {
    border: none;
    border-top: 1px solid var(--gold-border);
    margin: 16px 0;
}

/* -------------------------
   Responsive
   ------------------------- */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .retro-brand {
        font-size: 56px;
    }
}

/* -------------------------
   Compat shims (.btn-min etc.)
   ------------------------- */
.btn-min {
    border: 1px solid var(--gold-border);
    background: transparent;
    color: var(--gold);
    padding: 5px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.btn-min:hover {
    background: rgba(201, 168, 76, 0.10);
    border-color: var(--gold);
    color: var(--gold-bright);
    box-shadow: var(--glow-gold-s);
}

/* Profile compat */
.avatar {
    width: 64px;
    height: 64px;
    border: 1px solid rgba(201, 168, 76, .40);
    background: rgba(201, 168, 76, 0.04);
    object-fit: cover;
    display: block;
    box-shadow: 0 0 14px rgba(201, 168, 76, .10);
}

.avatar-box {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 64px;
}

.pin-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 10px;
    padding: 3px;
}