:root {
    --bg: #000000;
    --surface: #0a0a0a;
    --surface-glass: rgba(20, 20, 20, 0.6);
    --border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-muted: #a1a1aa;

    /* Main Theme Colors */
    --primary: #EEA235;
    /* Green */
    --primary-glow: rgba(238, 162, 53, 0.4);

    --danger: #ef4444;
    --success: #EEA235;
    /* Unified success with primary */

    --radius-card: 24px;
    --radius-btn: 99px;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.app-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* AUTH CSS */
.auth-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: radial-gradient(circle at 50% 50%, rgba(238, 162, 53, 0.05) 0%, transparent 50%);
}

.brand {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    letter-spacing: -0.05em;
}

.brand span {
    color: var(--primary);
}

.auth-card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    padding: 3rem;
    border-radius: var(--radius-card);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s;
}

.auth-card:hover {
    border-color: rgba(238, 162, 53, 0.3);
}

.auth-card h2 {
    margin: 0 0 10px 0;
    font-size: 1.75rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-muted);
    text-align: center;
    margin: 0 0 2rem 0;
    font-size: 1rem;
    line-height: 1.5;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(238, 162, 53, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

button#btnLogin {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: var(--radius-btn);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(238, 162, 53, 0.2);
}

button#btnLogin:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(238, 162, 53, 0.4);
}

button#btnLogin:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-footer {
    margin-top: 2rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.error-msg {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 1rem;
    text-align: center;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: none;
}

/* LOADER */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* DASHBOARD CSS */
.dashboard-wrapper {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, rgba(238, 162, 53, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(238, 162, 53, 0.03) 0%, transparent 40%);
}

header {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Mobile Menu Elements */
.logo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: auto;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
    color: #fff;
}

#mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* Nav Container - Desktop */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
    margin-left: 60px;
}

/* TABS */
.nav-tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 99px;
    border: 1px solid var(--border);
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 99px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-tab:hover {
    color: white;
}

.nav-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu span {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

main {
    padding: 3rem 24px;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-size: 2.5rem;
    margin: 0 0 2.5rem 0;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 3rem;
    max-width: 60ch;
}

/* ORDER CARD (Glassmorphism) */
.order-card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
}

.order-card:hover {
    border-color: rgba(238, 162, 53, 0.3);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.order-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.badge {
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.active {
    background: rgba(238, 162, 53, 0.1);
    color: var(--primary);
    border: 1px solid rgba(238, 162, 53, 0.2);
}

.badge.expired {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge.pending {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.expiry-info {
    text-align: right;
}

.expiry-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.expiry-date {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-top: 4px;
    font-family: monospace;
}

.expiry-date.expired {
    color: var(--danger);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.detail-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    font-weight: 600;
}

.detail-value {
    background: rgba(0, 0, 0, 0.3);
    padding: 14px 16px;
    padding-right: 60px;
    /* Space for Copy button */
    border-radius: 12px;
    border: 1px solid var(--border);
    font-family: monospace;
    color: var(--primary);
    font-size: 1.1rem;
    overflow-wrap: anywhere;
    /* Better wrapping support */
    position: relative;
    transition: all 0.2s;
}

.copy-hint {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    font-size: 0.75rem;
    font-weight: 600;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value:hover {
    border-color: var(--primary);
    cursor: pointer;
    background: rgba(238, 162, 53, 0.05);
}

.status-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 30px;
    overflow: hidden;
}

.status-progress {
    height: 100%;
    background: var(--primary);
    width: 0%;
    box-shadow: 0 0 10px var(--primary);
}

.status-progress.warning {
    background: #f59e0b;
    box-shadow: none;
}

.status-progress.critical {
    background: var(--danger);
    box-shadow: none;
}

/* Multi-Device Cards */
.devices-container {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.device-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.2s;
}

.device-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.device-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.device-name {
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.device-name::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    margin-right: 12px;
    /* FLat icon: No box-shadow */
}

/* GUIDE / APPS / SUPPORT CARDS */
.guide-grid,
.apps-grid,
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 2rem;
}

.guide-card,
.app-card-large,
.support-card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 2.5rem 2rem;
    text-align: center;
    /* Default center, flexible later */
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.guide-card:hover,
.app-card-large:hover,
.support-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.guide-icon,
.app-icon-large,
.support-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    color: var(--primary);
}

.guide-card h3,
.app-card-large h3,
.support-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.guide-card p,
.app-card-large p,
.support-card p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

/* BUTTONS inside cards */
.btn-renew {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 24px;
    border-radius: 99px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    /* Push to right if flex container allows */
}

.btn-renew:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(238, 162, 53, 0.3);
}

/* Premium Subscribe Button */
.btn-subscribe {
    background: var(--primary);
    color: #000;
    padding: 12px 32px;
    border-radius: 99px;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    box-shadow: 0 0 25px rgba(238, 162, 53, 0.4);
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-subscribe::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
    z-index: -1;
}

.btn-subscribe:hover::before {
    transform: translateX(100%);
}

.btn-subscribe:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 50px rgba(238, 162, 53, 0.6);
    background: #1aff9d;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 99px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

/* Guide Link */
.guide-card a {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--border);
    padding: 10px 24px;
    border-radius: 99px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.guide-card a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Download / Support Links */
.btn-download {
    background: var(--primary);
    color: #000;
    padding: 12px 28px;
    border-radius: 99px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(238, 162, 53, 0.2);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(238, 162, 53, 0.4);
}

.support-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
}

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

/* Code Box */
.code-box {
    background: #000;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: monospace;
    font-size: 1.1rem;
}

.code-box strong {
    color: var(--primary);
    font-size: 1.3rem;
    letter-spacing: 1px;
}

/* Full Guide Button */
.btn-full-guide {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 10px 20px;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-full-guide:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}


/* MOBILE */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
    }

    /* Fix Grid Overflow on Mobile */
    .devices-container,
    .guide-grid,
    .apps-grid,
    .support-grid {
        grid-template-columns: 1fr;
        /* Force single column, full width */
        gap: 16px;
        /* Reduce gap */
    }

    /* Reduce body/main padding */
    main {
        padding: 2rem 16px;
    }

    .detail-value {
        padding-right: 16px;
        /* Reset: text uses full width */
        padding-bottom: 30px;
        /* Space for copy button at bottom */
    }

    .copy-hint {
        top: auto;
        bottom: 6px;
        right: 10px;
        transform: none;
        background: rgba(255, 255, 255, 0.15);
    }

    .logo-row {
        width: 100%;
    }

    #mobile-menu-btn {
        display: block;
    }

    .nav-container {
        display: none;
        flex-direction: column;
        margin-left: 0;
        margin-top: 10px;
        padding-top: 20px;
        border-top: 1px solid var(--border);
        width: 100%;
        animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .nav-container.active {
        display: flex;
    }

    .nav-tabs {
        flex-direction: column;
        width: 100%;
        gap: 8px;
        background: transparent;
        border: none;
        padding: 0;
    }

    .nav-tab {
        width: 100%;
        text-align: left;
        background: rgba(255, 255, 255, 0.05);
        padding: 12px 20px;
        border-radius: 12px;
    }

    .nav-tab.active {
        background: var(--primary);
        color: #000;
        border: none;
    }

    .user-menu {
        margin-top: 20px;
        width: 100%;
        justify-content: space-between;
        padding-top: 20px;
        border-top: 1px solid var(--border);
    }

    .page-title {
        font-size: 2rem;
    }

    .apps-grid,
    .support-grid,
    .guide-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FINAL PREMIUM BUTTON STYLE (Ensured Load) */
.btn-premium-sub {
    background: linear-gradient(135deg, #EEA235 0%, #cc851f 100%);
    color: #000 !important;
    padding: 12px 30px;
    border-radius: 99px;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    box-shadow: 0 4px 15px rgba(238, 162, 53, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.btn-premium-sub:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 25px rgba(238, 162, 53, 0.6);
    background: linear-gradient(135deg, #ffb85c 0%, #EEA235 100%);
}

.btn-premium-sub:active {
    transform: translateY(0);
}

.btn-premium-sub i {
    font-size: 1.1em;
}