:root {
    --primary: #5A1285;
    --primary-light: #7B1FA2;
    --primary-dark: #3E0D5F;
    --success: #1DBF73;
    --error: #E63946;
    --warning: #F4A261;
    --bg-light: #F7F5FA;
    --dark-text: #1A1A1A;
    --grey-text: #888888;
    --card-bg: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #F1F5F9;
    color: var(--dark-text);
    -webkit-font-smoothing: antialiased;
}

/* Dashboard Layout */
.layout-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    width: 260px;
    background: var(--primary-dark);
    color: #fff;
    flex-shrink: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-logo {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
}

.sidebar-logo span {
    background: #fff;
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 18px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link svg {
    opacity: 0.8;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-link:hover svg,
.nav-link.active svg {
    opacity: 1;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #F1F5F9;
    min-width: 0;
}

.header {
    height: 75px;
    background: #fff;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--dark-text);
    cursor: pointer;
    padding: 8px;
}

.content-body {
    padding: 30px;
    flex: 1;
}

.footer {
    padding: 20px;
    text-align: center;
    color: var(--grey-text);
    font-size: 13px;
}

/* Responsive Dashboard adjustments */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        height: 100vh;
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .overlay.open {
        display: block;
    }

    .menu-toggle {
        display: flex;
    }

    .content-body {
        padding: 20px;
    }
}

/* Auth / General Utilities */
body.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-top: 40px;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    padding: 30px;
    border-radius: 28px;
}

@media (max-width: 490px) {
    body.auth-page {
        margin-top: 0;
    }

    .auth-container {
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.max-w-md {
    max-width: 480px;
    margin: 0 auto;
}

.max-w-lg {
    max-width: 800px;
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.font-bold {
    font-weight: 700;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 32px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(90, 18, 133, 0.25);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background-color: rgba(90, 18, 133, 0.05);
}

.btn-auto {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-text);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #E0D6F0;
    border-radius: 12px;
    font-size: 15px;
    color: var(--dark-text);
    background-color: #FAFAFA;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #FFF;
    box-shadow: 0 0 0 4px rgba(90, 18, 133, 0.15);
}

/* Glass Header (for login/register pages) */
.glass-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 40px 24px;
    border-radius: 0 0 28px 28px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.glass-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(40px);
}

.glass-header.auth {
    border-radius: 20px;
    margin: -30px -30px 30px -30px;
}

@media (max-width: 490px) {
    .glass-header.auth {
        border-radius: 0 0 28px 28px;
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error {
    background-color: rgba(230, 57, 70, 0.1);
    color: var(--error);
    border: 1px solid rgba(230, 57, 70, 0.2);
}

.alert-success {
    background-color: rgba(29, 191, 115, 0.1);
    color: var(--success);
    border: 1px solid rgba(29, 191, 115, 0.2);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-popular {
    background: rgba(244, 162, 97, 0.15);
    color: #D47B2A;
}

/* Grid Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .grid-4 {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Dashboard Premium Wallet */
.wallet-card {
    background: linear-gradient(135deg, #4A00E0, #8E2DE2);
    border-radius: 24px;
    padding: 28px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(74, 0, 224, 0.25);
    margin-bottom: 30px;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.wallet-card::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: 100px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.wallet-title {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.wallet-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.wallet-balance {
    font-size: 38px;
    font-weight: 800;
    margin: 16px 0 24px;
    position: relative;
    z-index: 2;
    letter-spacing: -1px;
}

.wallet-actions {
    display: flex;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.wallet-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-decoration: none;
    outline: none;
}

.wallet-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
}

.wallet-btn .icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-btn span {
    font-size: 12px;
    font-weight: 600;
}

/* Premium Provider Cards */
.provider-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px 16px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.provider-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-color, #ccc);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.provider-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.05);
}

.provider-card:hover::before {
    opacity: 1;
}

.provider-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.provider-card:hover .provider-icon-wrapper {
    transform: scale(1.1);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Modal Implementation */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--grey-text);
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(230, 57, 70, 0.1);
    color: var(--error);
}

.modal-header {
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark-text);
}