@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============ DESIGN TOKENS ============ */
:root {
    --bg-primary: #060a18;
    --bg-secondary: #0c1129;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-input: #0e1430;
    --glass-border: rgba(255, 255, 255, 0.08);
    --border-subtle: #1a2040;
    --accent-purple: #8d4acd;
    --accent-blue: #0066FF;
    --accent-cyan: #00E5FF;
    --accent-magenta: #c746ff;
    --accent-green: #00c853;
    --text-primary: #FFFFFF;
    --text-secondary: #8892B0;
    --text-muted: #5a6380;
    --danger: #ff4d6a;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 100px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Noise overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

/* ============ AMBIENT ORBS ============ */
.gs-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}
.gs-orb-1 {
    width: 500px; height: 500px;
    background: rgba(141, 74, 205, 0.10);
    top: -10%; right: -5%;
}
.gs-orb-2 {
    width: 400px; height: 400px;
    background: rgba(0, 102, 255, 0.08);
    bottom: -10%; left: -5%;
}

/* ============ HEADER ============ */
.gs-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 0 40px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(6, 10, 24, 0.88);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.gs-header .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.gs-header .logo img {
    height: 42px;
    width: auto;
}

.gs-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gs-header-nav {
    display: flex;
    gap: 28px;
    list-style: none;
}

.gs-header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition);
}

.gs-header-nav a:hover {
    color: var(--text-primary);
}

.gs-user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
}

.gs-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.gs-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.gs-logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all var(--transition);
}

.gs-logout-btn:hover {
    color: var(--danger);
    background: rgba(255, 77, 106, 0.1);
}

/* ============ MAIN LAYOUT ============ */
.gs-main {
    flex: 1;
    padding-top: 72px;
    position: relative;
    z-index: 1;
}

/* ============ LOGIN PAGE ============ */
.gs-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 72px);
    padding: 40px 20px;
}

.gs-login-content {
    text-align: center;
    max-width: 440px;
    width: 100%;
}

.gs-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    font-size: 13px;
    color: var(--accent-cyan);
    font-weight: 500;
    margin-bottom: 28px;
    animation: fadeInUp 0.6s ease-out;
}

.gs-badge .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent-cyan);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.gs-login-content h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 12px;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.gs-login-content .subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 36px;
    animation: fadeInUp 0.6s ease-out 0.15s both;
}

/* Login Card */
.gs-login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.gs-phone-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.gs-prefix-select {
    flex: 0 0 110px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: border-color var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238892B0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.gs-prefix-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.gs-phone-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    transition: border-color var(--transition);
}

.gs-phone-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.gs-phone-input::placeholder {
    color: var(--text-muted);
}

/* OTP Input */
.gs-otp-section {
    display: none;
    margin-bottom: 20px;
    animation: fadeInUp 0.4s ease-out;
}

.gs-otp-section.active {
    display: block;
}

.gs-otp-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-align: left;
}

.gs-otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.gs-otp-input {
    width: 48px; height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    font-family: 'Space Grotesk', monospace;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: border-color var(--transition);
}

.gs-otp-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.gs-resend-link {
    font-size: 13px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition);
    font-family: 'Outfit', sans-serif;
}

.gs-resend-link:hover {
    color: var(--accent-cyan);
}

.gs-resend-link:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Buttons */
.gs-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 28px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 24px rgba(0, 102, 255, 0.25);
}

.gs-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 102, 255, 0.4);
}

.gs-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.gs-btn-primary .spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.gs-btn-primary.loading .spinner { display: block; }
.gs-btn-primary.loading .btn-text { display: none; }

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

.gs-wa-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.gs-wa-hint svg {
    color: #25d366;
}

.gs-error-msg {
    background: rgba(255, 77, 106, 0.1);
    border: 1px solid rgba(255, 77, 106, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--danger);
    display: none;
}

.gs-error-msg.visible {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.gs-register-link {
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.gs-register-link a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 500;
}

.gs-register-link a:hover {
    text-decoration: underline;
}

/* ============ DASHBOARD ============ */
.gs-dashboard {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* Greeting */
.gs-greeting {
    margin-bottom: 36px;
    animation: fadeInUp 0.5s ease-out;
}

.gs-greeting h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.gs-greeting p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Tabs */
.gs-tabs {
    display: flex;
    gap: 32px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 36px;
    animation: fadeInUp 0.5s ease-out 0.05s both;
}

.gs-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 500;
    padding: 12px 4px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    position: relative;
    top: 1px;
}

.gs-tab:hover {
    color: var(--text-secondary);
}

.gs-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-cyan);
}

/* Tab Content */
.gs-tab-content {
    display: none;
    animation: fadeInUp 0.4s ease-out;
}

.gs-tab-content.active {
    display: block;
}

/* Section Header */
.gs-section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 20px;
}

/* Info Grid */
.gs-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 40px;
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.gs-info-field {
    min-width: 0;
}

.gs-info-field .label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.gs-info-field .value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.gs-info-field.full-width {
    grid-column: span 2;
}

.gs-edit-row {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    grid-column: span 2;
}

.gs-btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--accent-cyan);
    font-size: 13px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all var(--transition);
}

.gs-btn-edit:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 229, 255, 0.2);
}

/* ============ PURCHASE CARDS ============ */
.gs-purchases-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gs-purchase-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition);
}

.gs-purchase-card:hover {
    border-color: rgba(141, 74, 205, 0.25);
}

/* Card top: games */
.gs-purchase-games {
    padding: 24px 24px 16px;
}

.gs-game-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.gs-game-row:last-child {
    margin-bottom: 0;
}

.gs-game-title {
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
}

.gs-badge-pill {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.gs-badge-ps5 {
    background: rgba(0, 102, 255, 0.8);
    color: #fff;
}

.gs-badge-ps4 {
    background: rgba(141, 74, 205, 0.8);
    color: #fff;
}

.gs-badge-primaria {
    background: rgba(0, 200, 83, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(0, 200, 83, 0.25);
}

.gs-badge-secundaria {
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 229, 255, 0.2);
}

/* Card divider */
.gs-purchase-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0 24px;
}

/* Card bottom: credentials */
.gs-purchase-creds {
    padding: 16px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gs-cred-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.gs-cred-row svg {
    flex-shrink: 0;
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.gs-cred-value {
    flex: 1;
    font-family: 'Space Grotesk', monospace;
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gs-cred-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.gs-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: all var(--transition);
}

.gs-icon-btn:hover {
    color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.1);
}

.gs-icon-btn.copied {
    color: var(--accent-green);
}

.gs-purchase-date {
    display: flex;
    justify-content: flex-end;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============ EMPTY STATE ============ */
.gs-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.gs-empty-state svg {
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.gs-empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.gs-empty-state p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ============ SUPPORT TAB ============ */
.gs-support-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
}

.gs-support-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.gs-support-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.6;
}

.gs-btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: var(--radius-pill);
    background: #25d366;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.25);
}

.gs-btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.35);
    background: #1ebe5e;
}

/* ============ FOOTER ============ */
.gs-footer {
    text-align: center;
    padding: 24px 20px;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    position: relative;
    z-index: 1;
}

.gs-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.gs-footer a:hover {
    color: var(--text-primary);
}

/* ============ ANIMATIONS ============ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gs-animate {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.gs-animate-d1 { animation-delay: 0.1s; }
.gs-animate-d2 { animation-delay: 0.2s; }
.gs-animate-d3 { animation-delay: 0.3s; }

/* ============ TOAST NOTIFICATION ============ */
.gs-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    font-size: 13px;
    color: var(--text-primary);
    z-index: 10000;
    transition: transform 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gs-toast.show {
    transform: translateX(-50%) translateY(0);
}

.gs-toast svg {
    color: var(--accent-green);
}

/* ============ MOBILE TOGGLE ============ */
.gs-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .gs-header {
        padding: 0 20px;
        height: 64px;
    }

    .gs-header .logo img {
        height: 34px;
    }

    .gs-header-nav {
        display: none;
    }

    .gs-mobile-toggle {
        display: flex;
    }

    .gs-main {
        padding-top: 64px;
    }

    .gs-login-card {
        padding: 24px 20px;
    }

    .gs-phone-row {
        flex-direction: column;
    }

    .gs-prefix-select {
        flex: 1;
    }

    .gs-otp-input {
        width: 42px;
        height: 48px;
        font-size: 18px;
    }

    .gs-dashboard {
        padding: 24px 16px 60px;
    }

    .gs-greeting h1 {
        font-size: 22px;
    }

    .gs-tabs {
        gap: 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .gs-tab {
        font-size: 14px;
        white-space: nowrap;
    }

    .gs-info-grid {
        grid-template-columns: 1fr;
        padding: 24px 20px;
        gap: 20px;
    }

    .gs-info-field.full-width,
    .gs-edit-row {
        grid-column: span 1;
    }

    .gs-purchase-games {
        padding: 20px 16px 12px;
    }

    .gs-game-title {
        font-size: 15px;
    }

    .gs-purchase-divider {
        margin: 0 16px;
    }

    .gs-purchase-creds {
        padding: 12px 16px 16px;
    }

    .gs-user-name {
        display: none;
    }

    .gs-support-card {
        padding: 32px 20px;
    }
}

@media (max-width: 480px) {
    .gs-login-content h1 {
        font-size: 1.8rem;
    }

    .gs-otp-inputs {
        gap: 6px;
    }

    .gs-otp-input {
        width: 38px;
        height: 44px;
        font-size: 16px;
    }

    .gs-game-row {
        gap: 6px;
    }

    .gs-badge-pill {
        font-size: 10px;
        padding: 2px 8px;
    }
}
