:root {
    --prime-bg: #07070d;
    --prime-bg-soft: rgba(15, 15, 24, 0.92);
    --prime-card: rgba(18, 18, 30, 0.88);
    --prime-border: rgba(139, 92, 246, 0.22);
    --prime-border-strong: rgba(139, 92, 246, 0.38);
    --prime-purple: #8b5cf6;
    --prime-purple-strong: #7c3aed;
    --prime-blue: #4f46e5;
    --prime-text: #f8fafc;
    --prime-muted: #94a3b8;
    --prime-success: #22c55e;
    --prime-danger: #ef4444;
    --prime-warning: #f59e0b;
    --prime-shadow: 0 24px 80px rgba(76, 29, 149, 0.18);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.22), transparent 32%),
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.18), transparent 28%),
        linear-gradient(180deg, #09090f 0%, #05050a 100%);
    color: var(--prime-text);
    font-family: "Tajawal", system-ui, sans-serif;
}

body.auth-page,
body.profile-page {
    position: relative;
    overflow-x: hidden;
}

.auth-shell,
.profile-shell {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 18px 64px;
}

.auth-shell.auth-shell-narrow {
    max-width: 920px;
}

.auth-topbar,
.profile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--prime-text);
    text-decoration: none;
}

.brand-link img {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.28);
}

.brand-link strong {
    display: block;
    font-size: 1.08rem;
}

.brand-link span {
    display: block;
    color: var(--prime-muted);
    font-size: 0.9rem;
}

.topbar-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.chip-link,
.chip-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--prime-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--prime-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    cursor: pointer;
}

.chip-link:hover,
.chip-button:hover {
    transform: translateY(-2px);
    border-color: var(--prime-border-strong);
}

.chip-link.primary,
.chip-button.primary {
    background: linear-gradient(135deg, var(--prime-purple-strong), var(--prime-blue));
    border-color: transparent;
    box-shadow: 0 18px 40px rgba(124, 58, 237, 0.24);
}

.chip-link.danger,
.chip-button.danger {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.08);
}

.auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
    gap: 28px;
    align-items: start;
}

.auth-hero,
.auth-card,
.profile-card,
.profile-sidebar {
    background: var(--prime-card);
    border: 1px solid var(--prime-border);
    border-radius: 28px;
    box-shadow: var(--prime-shadow);
    backdrop-filter: blur(18px);
}

.auth-hero {
    padding: 34px;
    min-height: 100%;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.14);
    color: #ddd6fe;
    font-size: 0.86rem;
    font-weight: 700;
}

.auth-hero h1,
.profile-header h1 {
    margin: 22px 0 14px;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.15;
}

.auth-hero p,
.profile-header p,
.muted-text {
    color: var(--prime-muted);
    line-height: 1.9;
}

.auth-features {
    display: grid;
    gap: 14px;
    margin-top: 26px;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-feature i {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.18);
    color: #d8b4fe;
}

.auth-card {
    padding: 30px;
}

.section-label {
    color: #c4b5fd;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-card h2,
.profile-section-title {
    margin: 8px 0 10px;
    font-size: 1.7rem;
}

.stack {
    display: grid;
    gap: 18px;
}

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

.field {
    display: grid;
    gap: 8px;
}

.field label {
    color: #dbe4f2;
    font-weight: 700;
    font-size: 0.95rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid var(--prime-border);
    background: rgba(255, 255, 255, 0.035);
    color: var(--prime-text);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
    min-height: 128px;
    padding: 14px 16px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.62);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
}

.field small {
    color: var(--prime-muted);
    line-height: 1.7;
}

.submit-button,
.inline-button,
.social-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 18px;
    border-radius: 18px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--prime-purple-strong), var(--prime-blue));
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 18px 40px rgba(124, 58, 237, 0.24);
}

.submit-button:hover,
.inline-button:hover,
.social-button:hover {
    transform: translateY(-2px);
}

.inline-button.ghost,
.submit-button.ghost {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--prime-border);
    box-shadow: none;
}

.inline-button.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: none;
}

.social-grid {
    display: grid;
    gap: 12px;
}

.social-button {
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--prime-border);
    box-shadow: none;
}

.social-button.google {
    color: #f8fafc;
}

.social-button.discord {
    color: #e0e7ff;
}

.divider {
    position: relative;
    text-align: center;
    margin: 14px 0;
    color: var(--prime-muted);
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.divider span {
    position: relative;
    display: inline-block;
    padding: 0 12px;
    background: rgba(18, 18, 30, 0.94);
}

.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid transparent;
    line-height: 1.8;
}

.alert-box.success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

.alert-box.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.alert-box.info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
}

.helper-links {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--prime-muted);
}

.helper-links a {
    color: #d8b4fe;
    text-decoration: none;
    font-weight: 700;
}

.auth-grid-simple {
    grid-template-columns: minmax(0, 0.95fr) minmax(380px, 0.85fr);
}

.auth-simple-wrap {
    max-width: 560px;
    margin: 0 auto;
}

.auth-card.slim {
    padding: 28px;
    border-radius: 24px;
}

.auth-card-head h1 {
    margin: 8px 0 6px;
    font-size: clamp(1.7rem, 2vw, 2.1rem);
}

.auth-card-head p {
    margin: 0;
}

.simple-socials {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.simple-socials .social-button {
    justify-content: center;
    min-height: 50px;
    border-radius: 14px;
}

.compact-stack {
    gap: 14px;
}

.compact-submit {
    min-height: 48px;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(124, 58, 237, 0.18);
}

.compact-links {
    justify-content: center;
}

.auth-features.compact {
    gap: 12px;
}

.compact-title {
    margin: 8px 0 10px;
    font-size: 1.4rem;
}

.remember-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--prime-text);
    font-weight: 700;
}

.remember-toggle.simple {
    padding: 12px 14px;
    border-radius: 14px;
}

.remember-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--prime-purple);
}

.remember-control {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.remember-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(139, 92, 246, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--prime-text);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.remember-pill i {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
}

.remember-pill.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(79, 70, 229, 0.72));
    border-color: transparent;
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.18);
}

.remember-pill.active i {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.remember-pill:hover {
    transform: translateY(-1px);
}

.otp-box {
    display: grid;
    gap: 16px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.16);
}

.compact-box {
    border-radius: 18px;
}

.profile-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 24px;
}

.profile-sidebar {
    padding: 24px;
    position: sticky;
    top: 26px;
    overflow: hidden;
}

.profile-user {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding: 16px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(139, 92, 246, 0.16);
}

.profile-user > div {
    min-width: 0;
    flex: 1;
}

.profile-user img {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    object-fit: cover;
}

.profile-user strong {
    display: block;
    font-size: 1.1rem;
    overflow-wrap: anywhere;
}

.profile-user span {
    display: block;
    color: var(--prime-muted);
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.profile-nav {
    display: grid;
    gap: 10px;
}

.profile-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    color: var(--prime-text);
    text-decoration: none;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
}

.profile-nav a.active,
.profile-nav a:hover {
    border-color: var(--prime-border);
    background: rgba(139, 92, 246, 0.12);
}

.profile-content {
    display: grid;
    gap: 20px;
}

.profile-card {
    padding: 26px;
}

.meta-grid,
.linked-grid,
.device-grid,
.orders-grid {
    display: grid;
    gap: 16px;
}

.meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-box,
.linked-item,
.device-item,
.order-card {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.meta-box span,
.label-muted {
    color: var(--prime-muted);
    font-size: 0.9rem;
}

.meta-box strong {
    display: block;
    margin-top: 6px;
    font-size: 1.05rem;
}

.linked-item,
.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
}

.status-pill.linked,
.status-pill.success {
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
}

.status-pill.pending,
.status-pill.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
}

.status-pill.unlinked,
.status-pill.error {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
}

.inline-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.order-card {
    display: grid;
    gap: 16px;
}

.order-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.order-price {
    color: #c4b5fd;
    font-size: 1.1rem;
    font-weight: 800;
}

.order-items {
    display: grid;
    gap: 12px;
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(139, 92, 246, 0.08);
}

.order-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-item-left img {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    object-fit: cover;
}

.order-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.empty-state {
    padding: 26px;
    text-align: center;
    color: var(--prime-muted);
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.account-layout,
.order-detail-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.account-sidebar {
    display: grid;
    gap: 18px;
    align-content: start;
    min-width: 0;
}

.account-sidebar > * {
    min-width: 0;
}

.account-stat-grid,
.account-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.account-stat {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.account-stat span {
    display: block;
    color: var(--prime-muted);
    font-size: 0.86rem;
}

.account-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 1rem;
}

.account-nav {
    display: grid;
    gap: 10px;
    padding: 10px;
    border-radius: 22px;
    background: rgba(8, 8, 14, 0.42);
    border: 1px solid rgba(139, 92, 246, 0.12);
}

.account-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    color: var(--prime-text);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.account-nav a i {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.18);
    color: #ddd6fe;
    flex: none;
    font-size: 1rem;
}

.account-nav a span {
    font-weight: 700;
}

.account-nav a.active,
.account-nav a:hover {
    border-color: rgba(139, 92, 246, 0.28);
    background: rgba(139, 92, 246, 0.12);
    transform: translateX(-2px);
}

.account-nav a.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(79, 70, 229, 0.72));
    border-color: transparent;
    box-shadow: 0 16px 32px rgba(79, 70, 229, 0.2);
}

.account-nav a.active i {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.account-panel {
    display: grid;
    gap: 20px;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-heading h1 {
    margin: 8px 0 10px;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
}

.account-list {
    display: grid;
    gap: 16px;
}

.account-list-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.account-list-main {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.account-list-main strong {
    display: block;
    margin-bottom: 4px;
}

.account-list-icon,
.order-item-thumb {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ddd6fe;
    flex: none;
}

.order-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
}

.account-item-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.mini-note {
    color: var(--prime-muted);
    font-size: 0.86rem;
}

@media (max-width: 1100px) {
    .auth-grid,
    .profile-layout,
    .account-layout,
    .order-detail-layout {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        position: static;
    }
}

@media (max-width: 720px) {
    .field-grid,
    .meta-grid,
    .account-stat-grid,
    .account-info-grid {
        grid-template-columns: 1fr;
    }

    .simple-socials {
        grid-template-columns: 1fr;
    }

    .auth-shell,
    .profile-shell {
        padding-inline: 14px;
    }

    .auth-card,
    .auth-hero,
    .profile-card,
    .profile-sidebar {
        padding: 20px;
        border-radius: 22px;
    }

    .account-list-card,
    .page-heading {
        align-items: stretch;
    }

    .account-item-cta {
        width: 100%;
        justify-content: flex-start;
    }
}
