@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,700;0,800;0,900;1,400&display=swap');

/* Client portal + staff invite pages. Dark theme to match /profile. */

.lp {
    --lp-bg: #2F2F2F;
    --lp-surface: rgba(18, 18, 18, 0.78);
    --lp-surface-2: rgba(255, 255, 255, 0.04);
    --lp-border: rgba(255, 255, 255, 0.10);
    --lp-text: #ffffff;
    --lp-muted: rgba(255, 255, 255, 0.62);
    --lp-faint: rgba(255, 255, 255, 0.40);
    --lp-accent: #C60000;
    --lp-accent-deep: #9E0000;
    --lp-ok: #34d399;
    --lp-warn: #fbbf24;
    --lp-error: #f87171;
    --lp-europa: #1d3fa8;
    --lp-radius: 18px;

    min-height: 100vh;
    background: var(--lp-bg);
    color: var(--lp-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

.lp *, .lp *::before, .lp *::after { box-sizing: border-box; }
.lp a { color: #ff8a8a; }
.lp a:hover { color: #ffb3b3; }

/* ── Top bar ── */
.lp-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 56px;
    padding: 0 16px;
    background: rgba(10, 10, 10, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lp-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lp-topbar-logo { height: 24px; width: auto; display: block; }
.lp-topbar-divider { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.16); }
.lp-topbar-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-topbar-nav { display: flex; align-items: center; gap: 4px; }
.lp-topbar-nav a, .lp-linkbtn {
    color: var(--lp-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}
.lp-topbar-nav a:hover, .lp-linkbtn:hover { color: var(--lp-text); background: var(--lp-surface-2); }
.lp-topbar-nav a.active { color: var(--lp-text); }
.lp-topbar-nav form { margin: 0; }

/* Burger menu, same look as the Project Europa page's top-right menu. */
.lp-menu { position: relative; flex-shrink: 0; }
.lp-menu-btn {
    list-style: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.lp-menu-btn::-webkit-details-marker { display: none; }
.lp-menu-btn:hover, .lp-menu[open] .lp-menu-btn { background: rgba(255, 255, 255, 0.14); }
/* Clicking anywhere outside the dropdown hits this and closes the menu. */
.lp-menu[open] .lp-menu-btn::before { content: ''; position: fixed; inset: 0; z-index: 599; cursor: default; }
.lp-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1e1e22;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    min-width: 200px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    z-index: 600;
}
.lp-menu-dropdown form { margin: 0; }
.lp .lp-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    padding: 13px 16px;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: background 0.12s;
}
.lp .lp-menu-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.lp .lp-menu-item.active { color: #fff; }
.lp-menu-dropdown > * + * { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.lp-menu-item svg { color: #a78bfa; flex-shrink: 0; }

/* ── Page shells ── */
.lp-main { max-width: 820px; margin: 0 auto; padding: 24px 16px 64px; }
.lp-main-wide { max-width: 1100px; }

.lp-auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 16px 64px;
}
.lp-auth-logo { height: 32px; margin-bottom: 28px; }
.lp-auth .lp-card { width: 100%; max-width: 420px; }

.lp-card {
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: var(--lp-radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    padding: 24px;
}
.lp-card + .lp-card { margin-top: 16px; }

.lp h1 { font-size: 24px; font-weight: 800; margin: 0 0 6px; }
.lp h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--lp-muted); margin: 28px 0 12px; }
.lp-lede { color: var(--lp-muted); margin: 0 0 20px; }
.lp-small { font-size: 13px; color: var(--lp-muted); }

/* ── Forms ── */
.lp-field { margin-bottom: 16px; }
.lp-field label, .lp-label { display: block; font-size: 13px; font-weight: 600; color: var(--lp-muted); margin-bottom: 6px; }
.lp-input, .lp select.lp-input, .lp textarea.lp-input {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: var(--lp-text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    outline: none;
}
.lp select.lp-input option { color: #111; }
.lp-input:focus { border-color: var(--lp-accent); box-shadow: 0 0 0 3px rgba(198, 0, 0, 0.25); }
.lp-input[readonly] { color: var(--lp-muted); }
.lp textarea.lp-input { min-height: 96px; resize: vertical; }
.lp-hint { font-size: 12px; color: var(--lp-faint); margin-top: 4px; }
.lp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .lp-row { grid-template-columns: 1fr; } }

.lp-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--lp-muted); }
.lp-check input { width: 16px; height: 16px; accent-color: var(--lp-accent); }

.lp .validation-message { color: var(--lp-error); font-size: 13px; margin-top: 4px; }
.lp .validation-errors { color: var(--lp-error); font-size: 13px; padding-left: 18px; margin: 0 0 12px; }

.lp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font: inherit;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    background: var(--lp-accent-deep);
    border: 1px solid var(--lp-accent);
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
}
.lp-btn:hover { background: var(--lp-accent); color: #fff; }
.lp-btn:disabled { opacity: 0.6; cursor: default; }
.lp-btn-block { width: 100%; }
.lp-btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.22); color: var(--lp-text); }
.lp-btn-ghost:hover { background: var(--lp-surface-2); }
.lp-btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }

.lp-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }

/* ── Messages ── */
.lp-alert { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.lp-alert-ok { background: rgba(52, 211, 153, 0.10); border-color: rgba(52, 211, 153, 0.35); color: #a7f3d0; }
.lp-alert-error { background: rgba(248, 113, 113, 0.10); border-color: rgba(248, 113, 113, 0.35); color: #fecaca; }
.lp-alert-info { background: rgba(255, 255, 255, 0.05); border-color: var(--lp-border); color: var(--lp-muted); }

/* ── Project Europa bar: compact version of the /entry-forms/project-europa-2026 hero ── */
.lp-europa {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    padding: 34px 20px 30px;
    border-radius: var(--lp-radius);
    border: 1px solid rgba(167, 139, 250, 0.22);
    text-align: center;
    background-color: #0b0b0d;
    background-image: radial-gradient(rgba(167, 139, 250, 0.10) 1px, transparent 1px);
    background-size: 28px 28px;
    font-family: 'Raleway', system-ui, Arial, sans-serif;
    /* Own stacking context so lines (0) < vignette (1) < trains (2) < text (3). */
    isolation: isolate;
}

/* The lines sit behind the title only, like the landing hero, not behind the smaller text. */
.lp-europa-stage {
    position: relative;
    margin: 0 -20px;
    padding: 4px 20px;
}

/* Five metro lines (highlight, colour, shadow), 8px each with 7px gaps = 68px band. */
.lp-europa-stage::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 68px;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(to bottom,
        rgba(147,197,253,0.95) 0px,  #3b82f6 2px,  #1d4ed8 8px,  #0b0b0d 8px,  #0b0b0d 15px,
        rgba(134,239,172,0.95) 15px, #22c55e 17px, #166534 23px, #0b0b0d 23px, #0b0b0d 30px,
        rgba(253,224,71,0.95)  30px, #eab308 32px, #92400e 38px, #0b0b0d 38px, #0b0b0d 45px,
        rgba(252,165,165,0.95) 45px, #ef4444 47px, #7f1d1d 53px, #0b0b0d 53px, #0b0b0d 60px,
        rgba(216,180,254,0.95) 60px, #a855f7 62px, #581c87 68px
    );
}

/* Vignette above the lines, below trains and text. */
.lp-europa::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse 80% 70% at 50% 50%,
        rgba(11,11,13,0.55) 0%,
        rgba(11,11,13,0.82) 60%,
        rgba(11,11,13,0.97) 100%);
}

.lp-europa-rail {
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 68px;
    z-index: 2;
    pointer-events: none;
}

.lp-europa-train {
    position: absolute;
    width: 26px;
    height: 7px;
    border-radius: 4px;
    transform: translateY(-50%);
}
.lp-europa-train--blue   { top: 4px;  background: rgba(147,197,253,0.95); box-shadow: 0 0 10px 3px rgba(59,130,246,0.75);  animation: lp-train-ltr 9s  linear infinite -2s; }
.lp-europa-train--green  { top: 19px; background: rgba(134,239,172,0.95); box-shadow: 0 0 10px 3px rgba(34,197,94,0.75);   animation: lp-train-rtl 12s linear infinite -5s; }
.lp-europa-train--gold   { top: 34px; background: rgba(253,224,71,0.95);  box-shadow: 0 0 10px 3px rgba(234,179,8,0.75);   animation: lp-train-ltr 8s  linear infinite -1s; }
.lp-europa-train--red    { top: 49px; background: rgba(252,165,165,0.95); box-shadow: 0 0 10px 3px rgba(239,68,68,0.75);   animation: lp-train-rtl 14s linear infinite -7s; }
.lp-europa-train--purple { top: 64px; background: rgba(216,180,254,0.95); box-shadow: 0 0 10px 3px rgba(168,85,247,0.75);  animation: lp-train-ltr 11s linear infinite -4s; }

@keyframes lp-train-ltr { from { left: -30px; } to { left: calc(100% + 30px); } }
@keyframes lp-train-rtl { from { left: calc(100% + 30px); } to { left: -30px; } }

@media (prefers-reduced-motion: reduce) {
    .lp-europa-train { animation: none; left: 30%; }
    .lp-europa-train--green, .lp-europa-train--red { left: 70%; }
}

.lp-europa-content,
.lp-europa-stage .lp-europa-title { position: relative; z-index: 3; }


.lp-europa-title {
    font-size: clamp(38px, 9vw, 60px);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0;
}

.lp-europa-sub {
    font-size: 14px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 14px;
}

.lp .lp-europa-cta {
    display: inline-block;
    margin-top: 20px;
    padding: 11px 32px;
    border-radius: 12px;
    background: #a78bfa;
    color: #0b0b0d;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: background 0.15s, transform 0.12s;
}
.lp .lp-europa-cta:hover:not(:disabled) { background: #c4b5fd; color: #0b0b0d; transform: translateY(-2px); }
.lp .lp-europa-cta { border: 0; cursor: pointer; font-family: inherit; }
.lp .lp-europa-cta:disabled { opacity: 0.6; cursor: default; }

/* Join Project Europa confirm step */
.lp-europa-join { max-width: 360px; margin: 18px auto 0; text-align: left; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.lp-europa-join-label { display: block; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.85); margin-bottom: 6px; }
.lp-europa-join-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(167, 139, 250, 0.35);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 15px;
    font-family: inherit;
}
.lp-europa-join-input:focus { outline: none; border-color: #a78bfa; }
.lp-europa-join-hint { font-size: 13px; color: rgba(255, 255, 255, 0.55); margin: 8px 0 0; }
.lp-europa-join-error { font-size: 13px; color: var(--lp-error); margin: 8px 0 0; }
.lp-europa-join-actions { display: flex; align-items: center; justify-content: center; gap: 12px; }
.lp-europa-join-cancel {
    margin-top: 20px;
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 11px 12px;
}
.lp-europa-join-cancel:hover:not(:disabled) { color: #fff; }

/* ── Race entries ── */
.lp-entries { display: flex; flex-direction: column; gap: 10px; }
.lp-entry {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 14px;
}
.lp-entry-logo {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.lp-entry-logo img { width: 100%; height: 100%; object-fit: contain; }
.lp-entry-logo span { font-weight: 800; color: var(--lp-faint); font-size: 18px; }
.lp-entry-body { flex: 1; min-width: 0; }
.lp-entry-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-entry-meta { font-size: 13px; color: var(--lp-muted); }
.lp-entry-side { flex: 0 0 auto; }
.lp-empty { color: var(--lp-faint); font-size: 14px; padding: 12px 2px; }

/* ── Staff table ── */
.lp-table-wrap { overflow-x: auto; }
.lp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lp-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--lp-faint); padding: 8px 10px; border-bottom: 1px solid var(--lp-border); }
.lp-table td { padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); vertical-align: top; }
.lp-table td .lp-small { display: block; }
.lp-table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lp-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--lp-surface-2); color: var(--lp-muted); border: 1px solid var(--lp-border); }
.lp-badge-ok { color: var(--lp-ok); border-color: rgba(52, 211, 153, 0.35); }
.lp-badge-warn { color: var(--lp-warn); border-color: rgba(251, 191, 36, 0.35); }
.lp-badge-error { color: var(--lp-error); border-color: rgba(248, 113, 113, 0.35); }

.lp-search { display: flex; gap: 8px; margin-bottom: 16px; }
.lp-search .lp-input { flex: 1; }
.lp-copy { display: flex; gap: 8px; margin-top: 8px; }
.lp-copy .lp-input { flex: 1; font-size: 13px; }

/* -- Staff "log in as" banner -- */
.lp-impersonation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #78350f;
    border-bottom: 1px solid #f59e0b;
    color: #fef3c7;
    font-size: 14px;
}
.lp-impersonation form { margin: 0; flex: 0 0 auto; }
.lp-impersonation .lp-btn { background: #fef3c7; color: #78350f; border-color: #fef3c7; }

.lp-profile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.lp-profile-row .lp-lede { margin: 0; }

.lp-alert-warn { background: rgba(251, 191, 36, 0.10); border-color: rgba(251, 191, 36, 0.40); color: #fde68a; }

/* -- Small pill link (public results profile) -- */
.lp .lp-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #fde68a;
    background: rgba(251, 191, 36, 0.10);
    border: 1px solid rgba(251, 191, 36, 0.30);
    text-decoration: none;
    white-space: nowrap;
}
.lp .lp-pill:hover { color: #fef3c7; background: rgba(251, 191, 36, 0.18); }

/* -- Avatar (settings) -- */
.lp-avatar-row { display: flex; align-items: center; gap: 18px; }
.lp-avatar {
    width: 88px;
    height: 88px;
    flex: 0 0 88px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--lp-border);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lp-avatar span { font-size: 32px; font-weight: 800; color: var(--lp-faint); }
.lp-avatar-actions { flex: 1; min-width: 0; }
.lp-avatar-actions .lp-hint { margin-top: 8px; }
.lp-file { position: relative; overflow: hidden; }
.lp-file input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.lp-file.is-busy { opacity: 0.6; pointer-events: none; }
@media (max-width: 480px) { .lp-avatar-row { flex-direction: column; align-items: flex-start; } }
