:root {
    --bg-main: #05070b;
    --bg-elevated: #0b0d11;
    --accent: #ff7a00;
    --accent-soft: #ff9800;
    --text-main: #f7f7f7;
    --text-muted: #a9b0c0;
    --border-soft: rgba(255, 255, 255, 0.06);
    --radius-lg: 18px;
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.7);
}

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
    color: var(--text-main);
}

/* Layout */
.ucp-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

/* Sidebar */
.ucp-sidebar {
    background: #030712;
    border-right: 1px solid var(--border-soft);
    padding: 24px 20px;
}

.ucp-logo {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
    gap: 10px;
}

.ucp-logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
}

.ucp-logo-text {
    font-weight: 600;
    letter-spacing: 0.04em;
}

.ucp-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ucp-nav-list li {
    margin-bottom: 10px;
}

.ucp-nav-list a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
}

.ucp-nav-list a:hover {
    background: rgba(255, 122, 0, 0.12);
    color: var(--accent-soft);
}

/* Main */
.ucp-main {
    display: flex;
    flex-direction: column;
    padding: 20px 28px 24px;
}

.ucp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.ucp-title {
    font-size: 22px;
    margin: 0;
}

.ucp-user {
    font-size: 14px;
    margin-right: 12px;
    color: var(--text-muted);
}

.ucp-logout {
    font-size: 14px;
    color: var(--accent-soft);
    text-decoration: none;
}

.ucp-content {
    flex: 1;
}

/* Cards / grid */
.ucp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.ucp-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-soft);
}

.ucp-card-compact {
    margin-bottom: 18px;
}

.ucp-card-highlight {
    border-color: rgba(255, 122, 0, 0.6);
}

/* =======================
   UCP Dashboard Spacing
   ======================= */

.ucp-card + .ucp-card {
    margin-top: 18px;
}

/* Buttons */
.ucp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.ucp-btn-primary {
    background: var(--accent);
    color: #000;
}

.ucp-btn-outline {
    border-color: var(--accent);
    color: var(--accent-soft);
    background: transparent;
}

/* Footer */
.ucp-footer {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Login specific */
.ucp-login-body {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
}

.ucp-login-wrapper {
    max-width: 420px;
    width: 100%;
    padding: 0 16px;
}

.ucp-login-card {
    background: #030712;
    border-radius: 18px;
    padding: 24px 22px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.ucp-login-card h1 {
    margin: 0 0 4px;
    font-size: 20px;
}

.ucp-login-card h2 {
    margin: 0 0 18px;
    font-size: 16px;
    color: var(--text-muted);
}

.ucp-login-form label {
    display: block;
    font-size: 13px;
    margin-bottom: 10px;
}

.ucp-login-form input {
    margin-top: 4px;
    width: 100%;
    padding: 8px 9px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: #020617;
    color: var(--text-main);
}

.ucp-login-footer {
    margin-top: 14px;
    font-size: 13px;
    text-align: right;
}

.ucp-login-footer a {
    color: var(--accent-soft);
    text-decoration: none;
}

/* Alerts */
.ucp-alert {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 10px;
}

.ucp-alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

/* Tables */
.ucp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ucp-table th,
.ucp-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
}

.ucp-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.ucp-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 35px;
}

.ucp-logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 8px;
}

.ucp-logo-text {
    font-size: 1.2rem;
    font-weight: 600;
}

/* =========================================================
   Register Form – Checkbox Alignment
   ========================================================= */

.show-password-toggle,
.tos-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 18px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.3;
}

.show-password-toggle input[type="checkbox"],
.tos-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Improve spacing before reCAPTCHA */
.g-recaptcha {
    margin: 12px 0 18px;
}

/* Password strength bar tweaks */
.password-strength {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.ps-label {
    font-size: 12px;
    color: var(--text-muted);
}

.ps-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.ps-bar.weak  { background: #ef4444; }
.ps-bar.fair  { background: #f97316; }
.ps-bar.good  { background: #eab308; }
.ps-bar.strong{ background: #22c55e; }

.ps-text {
    font-size: 12px;
    color: var(--text-muted);
}

.ucp-login-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
}

.ucp-btn-right {
    padding: 8px 16px;
    font-size: 14px;
    border-color: var(--accent);
    color: var(--accent-soft);
}
.ucp-btn-right:hover {
    border-color: var(--accent-soft);
    color: var(--accent-soft);
    color: var(--accent-soft);
    box-shadow: 0 0 10px rgba(255, 122, 0, 0.5);
}

/* =========================================================
   Character Creation Layout
   ========================================================= */

.char-create-card {
    margin-top: 4px;
}

.char-create-intro {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

/* Overall layout: left steps, right content */
.char-create-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
}

/* Step list */
.char-step-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.char-step-button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: #020617;
    color: var(--text-muted);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        color 0.15s ease;
}

.char-step-button .char-step-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.char-step-text-main {
    font-weight: 600;
    color: var(--text-main);
    font-size: 13px;
}

.char-step-text-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.char-step-button.is-active {
    background: rgba(255, 122, 0, 0.12);
    border-color: var(--accent-soft);
    box-shadow: 0 0 0 1px rgba(255, 122, 0, 0.25);
    color: var(--text-main);
}

/* Right side panels */
.char-step-panel-wrap {
    background: #020617;
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    padding: 16px 18px 18px;
}

.char-step-panel {
    display: none;
}

.char-step-panel.is-active {
    display: block;
}

.char-panel-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.char-panel-helper {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   TEXT INPUTS / TEXTAREA
   ============================================ */
.char-text-input {
    width: 100%;
    padding: 10px 12px;
    background: #0b0d11;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    font-size: 14px;
}

.char-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    background: #0b0d11;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.4;
}

/* ============================================
   PILL SELECTIONS (Age, Gender, Race, etc.)
   ============================================ */
.char-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.char-pill {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 999px;
    background: #1a1d24;
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.char-pill:hover {
    border-color: var(--accent-soft);
    color: var(--accent-soft);
}

.char-pill.is-selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 600;
}

/* ============================================
   HEIGHT SCROLLER
   ============================================ */
.char-height-scroll {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 6px;
    display: grid;
    gap: 6px;
}

.char-height-scroll::-webkit-scrollbar {
    width: 6px;
}

.char-height-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.char-height-option {
    display: block;
    text-align: left;
    padding: 6px 10px;
    border-radius: 8px;
    background: #1a1d24;
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    font-size: 13px;
    cursor: pointer;
}

.char-height-option:hover {
    border-color: var(--accent-soft);
}

.char-height-option.is-selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 600;
}

/* ============================================
   FOOTER
   ============================================ */
.char-create-footer {
    margin-top: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-link-muted {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
}

.char-link-muted:hover {
    color: var(--accent-soft);
}

.char-footer-actions button.char-submit {
    padding: 10px 20px;
    font-size: 15px;
    border-radius: 999px;
}

/* ============================================
   CLEAN FIXES (no duplicates)
   ============================================ */

/* Input width inside panels */
.char-step-panel input.char-text-input {
    max-width: 420px;
    width: 100%;
}

/* Ensure panel content stays inside panel */
.char-step-panel-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Height scroller — final working version */
.char-height-scroll {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Height option buttons */
.char-height-option {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: 8px;

    background: #1a1d24;
    border: 1px solid var(--border-soft);
    color: var(--text-main);

    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.char-height-option:hover {
    border-color: var(--accent-soft);
}

.char-height-option.is-selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 600;
}

/* Description textarea — prevent overflow */
.char-textarea {
    width: 100%;
    max-width: 100%;
    min-height: 160px;
    padding: 10px 12px;
    background: #0b0d11;

    border-radius: 10px;
    border: 1px solid var(--border-soft);

    color: var(--text-main);
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    box-sizing: border-box;
}

/* Ensure step panels cannot overflow horizontally */
.char-step-panel {
    max-width: 100%;
}

/* Characters profile link */
.char-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.char-link:hover {
    text-decoration: underline;
}

/* ============================================
   Character Profile Page
   ============================================ */
   
/* Character profile overall layout */
.char-page {
    max-width: 1200px;
    margin: 0 auto 32px;
}

/* TOP SUMMARY CARD */
.char-summary-card {
    margin-bottom: 24px;
}

.char-summary-header {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: stretch;
}

.char-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.char-avatar-inner {
    width: 180px;
    height: 260px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: 14px;
    color: #9ca3af;
    padding: 8px;
    text-align: center;
}

.char-summary-name h2 {
    margin: 0 0 4px;
    font-size: 22px;
}

.char-summary-sub {
    font-size: 13px;
    color: #9ca3af;
}

.char-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.char-summary-block {
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    padding: 10px 12px;
}

.char-summary-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #ffffff;
}

.char-summary-list {
    margin: 0;
    padding: 0;
}

.char-summary-list > div {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 2px 0;
}

.char-summary-list dt {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    font-weight: 350; /* match visual weight of labels */
    opacity: 0.85;    /* optional – matches your lower card tone */
}

.char-summary-list dd {
    margin: 0;
    color: #f9fafb;
}

/* Description */
.char-desc-block {
    margin-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 12px;
}

.char-desc-text {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.5;
}

/* MAIN GRID */
.char-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
    gap: 20px;
}

.char-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.char-section-card {
    padding: 14px 18px;
}

/* Fields / tables */
.char-section-title {
    margin: 0 0 10px;
    font-size: 15px;
}

.char-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
}

.char-field-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

.char-field-value {
    font-size: 14px;
}

.char-empty {
    font-size: 13px;
    color: #9ca3af;
}

/* Vehicles / properties cards */
.char-vehicle-list,
.char-asset-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.char-asset-card {
    display: flex;
    gap: 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    overflow: hidden;
    padding: 10px;
}

.char-vehicle-card .char-asset-thumb {
    flex: 0 0 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
}

.char-asset-thumb img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.char-asset-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.char-asset-title {
    font-weight: 600;
    font-size: 17px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* NEW: Each row is a flex-row of grouped items */
.char-asset-row {
    display: flex;
    flex-wrap: nowrap;     /* Prevent wrapping */
    gap: 25px;             /* Adjust spacing */
}

/* Individual key/value pairs */
.char-asset-field {
    display: flex;
    flex-direction: column;
    min-width: 90px;
}

/* Label */
.char-asset-field-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

/* Value */
.char-asset-field-value {
    font-size: 14px;
    color: #e5e7eb;
}

/* Smaller colour row text */
.char-asset-meta-small {
    font-size: 12px;
    color: #9ca3af;
}

.char-tag {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(56,189,248,0.15);
    color: #7dd3fc;
}

.char-tag-muted {
    background: rgba(148,163,184,0.16);
    color: #e5e7eb;
}

/* Table tweaks */
.char-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.char-table th,
.char-table td {
    padding: 6px 6px;
    border-bottom: 1px solid rgba(148,163,184,0.2);
    text-align: left;
}

.char-table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.char-col-small {
    width: 60px;
}

/* Back link */
.char-back-link {
    text-align: right;
    margin: 40px 0 20px;
}

.char-back-link a.char-back-link-btn {
    color: #9ca3af;
    text-decoration: none;
}

.char-back-link a.char-back-link-btn:hover {
    color: #ff7a00 !important;   /* forced orange even if global has !important */
    text-decoration: none;
}

/* Responsive */
@media (max-width: 960px) {
    .char-summary-header {
        grid-template-columns: 1fr;
    }
    .char-summary-grid {
        grid-template-columns: 1fr;
    }
    .char-main-grid {
        grid-template-columns: 1fr;
    }
}

.char-avatar {
    width: 230px;
    height: 330px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.char-avatar-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.char-avatar-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.char-avatar-skin-overlay {
    position: absolute;
    bottom: 6px;
    width: 100%;
    text-align: center;
    font-size: 13px;
    opacity: 0.8;
    pointer-events: none;
}

.char-health-bars {
    margin: 12px 0 20px 0;
}

.char-bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.char-bar-label {
    width: 70px;
    font-size: 14px;
}

.char-bar {
    flex: 1;
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 5px;
    overflow: hidden;
    margin: 0 8px;
}

.char-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.char-bar-fill.is-health {
    background: #e63946; /* red */
}

.char-bar-fill.is-armour {
    background: #4c9aff; /* GTA SA armour blue */
}

.char-bar-value {
    width: 40px;
    text-align: right;
    font-size: 14px;
}

.ucp-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.ucp-table th {
    text-align: left;
    padding: 8px 10px;
    color: #e5e7eb;
    background: rgba(255,255,255,0.05);
    font-weight: 600;
}

.ucp-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ucp-muted {
    color: #9ca3af;
    font-size: 14px;
}

/* Admin Records – spacing between sections */
.admin-record-section {
    margin-top: 25px;
}

/* Card padding override */
.admin-record-card {
    padding: 20px 24px;
}

/* Table spacing inside cards */
.admin-record-table {
    margin-top: 14px;
}

/* Header row */
.admin-record-table thead th {
    padding: 10px 12px;
}

/* Body rows */
.admin-record-table tbody td {
    padding: 10px 12px;
}

/* SERVER STATUS CARD */
.server-status-card {
    padding: 24px;
}

.server-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.server-icon {
    font-size: 28px;
    color: var(--accent);
}

.status-badge {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge.online {
    background: #1f9d55;
    color: #fff;
    box-shadow: 0 0 10px rgba(31,157,85,0.5);
}

.status-badge.offline {
    background: #c53030;
    color: #fff;
    box-shadow: 0 0 10px rgba(197,48,48,0.5);
}

.server-grid {
    display: grid;
    row-gap: 10px;
    font-size: 15px;
}

.server-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.server-row i {
    margin-right: 6px;
    color: var(--accent-soft);
}

.server-join-btn {
    margin-top: 22px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

/* =========================================
   MDC Flash Notification
   ========================================= */

.mdc-flash-error {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 10px 18px;
    border-radius: 999px;

    background: rgba(220, 38, 38, 0.95); /* red */
    color: #fff;
    font-size: 14px;
    font-weight: 500;

    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.15);

    opacity: 0;
    z-index: 9999;

    animation: mdcFlashIn 0.35s ease forwards,
               mdcFlashOut 0.35s ease forwards 4.8s;
}

@keyframes mdcFlashIn {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes mdcFlashOut {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}