:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.background-animate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    animation: pulse 8s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0.8; }
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1rem;
    font-size: 1.8rem;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

header h1 span {
    color: var(--primary);
}

header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.step {
    margin-bottom: 1.8rem;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

label i {
    margin-right: 8px;
    color: var(--primary);
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.platform-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 8px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.platform-btn .logo-wrapper {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-bottom: 4px;
    transition: all 0.3s;
}

.platform-btn img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.platform-btn:hover .logo-wrapper {
    transform: scale(1.1);
}

.platform-btn.active .logo-wrapper {
    background: #f8fafc;
    box-shadow: 0 0 15px rgba(255,255,255,0.4);
}

.platform-btn span {
    font-size: 0.75rem;
    font-weight: 500;
}

.platform-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.platform-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input[type="email"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 14px 15px 14px 45px;
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 0.5rem;
}

.search-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.search-btn:active {
    transform: scale(0.98);
}

.search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.search-btn.error {
    background: var(--error);
}

.result {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

.result-header {
    text-align: center;
    margin-bottom: 1rem;
}

.result-header span {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
}

/* Skeleton Loader */
.skeleton-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.skeleton-box {
    width: 220px;
    height: 60px;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.03) 25%, 
        rgba(255,255,255,0.08) 50%, 
        rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    border-radius: 12px;
    animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.code-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    position: relative;
    border: 1px dashed var(--glass-border);
}

#code-display {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--text-main);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s;
}

.copy-btn:hover {
    color: var(--text-main);
    transform: scale(1.1);
}

.expiry-note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-style: italic;
}

footer {
    margin-top: 2rem;
    text-align: center;
}

footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* Responsive fixes */
@media (max-width: 400px) {
    .container {
        padding: 1rem;
    }
    .card {
        padding: 1.5rem;
    }
    #code-display {
        font-size: 2.2rem;
    }
}

/* Estilos para el login y admin */
.user-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: rgba(30, 33, 58, 0.5);
    border-radius: 12px;
}
.nav-link {
    text-decoration: none;
    font-size: 0.9rem;
    padding: 5px 12px;
    border-radius: 8px;
    transition: 0.3s;
}
.admin-link {
    background: #6366f1;
    color: white;
}
.admin-link:hover {
    background: #4f46e5;
}
.logout-link {
    color: #ef4444;
}
.logout-link:hover {
    color: #ff4d4d;
}
/* Panel Admin Sidebar Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: 700;
}

.sidebar-header h2 span {
    color: var(--primary);
}

.nav-menu {
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.nav-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.nav-item:hover, .nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.sidebar-footer {
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.main-content {
    flex-grow: 1;
    margin-left: 260px;
    padding: 2.5rem;
    background: transparent;
    width: calc(100% - 260px);
}

.mobile-header {
    display: none;
    padding: 1rem 1.5rem;
    background: rgba(15, 23, 42, 0.9);
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 900;
    border-bottom: 1px solid var(--glass-border);
}

.menu-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Responsive Sidebar */
@media (max-width: 992px) {
    .sidebar {
        left: -260px;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 950;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}
