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

:root {
    --dark-purple: #311B92;
    --primary: #6D49F2;
    --primary-glow: rgba(109, 73, 242, 0.6);
    --light-purple: #E2DAF3;
    --success-green: #4CAF50;
    --warning-yellow: #FFEA00;
    --warning-orange: #FF9100;
    --white: #F2F2FF;
    --light-grey: #D7D7D7;
    --dark-grey: #757575;
    --black-text: #212121;
    --error-red: #E53935;
    --bg-dark: #0a0614;
    --bg-light: #f3f4f6;
}

.material-symbols-rounded {
    font-family: 'Material Symbols Rounded' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    display: inline-block;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--black-text);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100vw;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
}

.mobile-break { display: none; }

.cursor-glow {
    position: fixed;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    mix-blend-mode: screen;
    transition: width 0.3s, height 0.3s;
}

body.landing-page {
    background-color: var(--bg-dark);
    color: var(--white);
}

body.landing-page .main-content {
    max-width: 100%;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
}

body.portal-page {
    background-color: var(--bg-dark);
    color: var(--white);
}

body.unauthenticated-bg .main-content {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

.public-navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    background: rgba(10, 6, 20, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(226, 218, 243, 0.05);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), background 0.3s;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--warning-yellow);
    position: relative;
    z-index: 1001;
}

.nav-logo-svg {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 0 10px var(--primary-glow));
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-brand:hover .nav-logo-svg {
    transform: rotate(15deg) scale(1.1);
    filter: drop-shadow(0 0 20px var(--primary));
}

.nav-logo-svg-dark {
    width: 34px;
    height: 34px;
}

.nav-brand-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--warning-yellow);
    letter-spacing: -0.5px;
}

.nav-brand-text span {
    color: var(--warning-yellow);
}

.portal-navbar .nav-brand-text {
    color: var(--warning-yellow);
}

.portal-navbar .nav-brand-text span {
    color: var(--white);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.public-navbar .nav-item {
    text-decoration: none;
    color: var(--light-grey);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    padding: 5px 0;
}

.public-navbar .nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.public-navbar .nav-item:hover {
    color: var(--white);
}

.public-navbar .nav-item:hover::after {
    width: 100%;
    box-shadow: 0 0 10px var(--primary);
}

.mobile-menu-toggle {
    display: none;
    color: var(--white);
    cursor: pointer;
    z-index: 1001;
}

.portal-navbar {
    background: rgba(10, 6, 20, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0 5%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(226, 218, 243, 0.05);
}

.nav-user-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-left: 1.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.avatar-icon {
    font-size: 2.2rem;
    color: var(--primary);
}

.user-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--white);
    line-height: 1.2;
}

.user-role {
    font-size: 0.7rem;
    color: var(--light-purple);
    font-weight: 500;
}

.logout-form { margin: 0; }

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background-color: transparent;
    color: var(--error-red);
    border: 1px solid rgba(229, 57, 53, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-logout:hover {
    background-color: var(--error-red);
    color: var(--white);
    border-color: var(--error-red);
}

.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    padding: 12px 20px;
    background: var(--white);
    color: var(--black-text);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    font-weight: 600;
    font-size: 0.9rem;
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast-error {
    border-left-color: var(--error-red);
    color: var(--error-red);
}

.toast-success {
    border-left-color: var(--success-green);
    color: var(--success-green);
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.input-group { margin-bottom: 1.5rem; }
.input-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 600; color: var(--black-text); }
.input-group input {
    width: 100%; padding: 1rem; background-color: var(--bg-light); border: 2px solid transparent; border-radius: 0.75rem;
    font-size: 1rem; color: var(--black-text); outline: none; transition: all 0.3s;
}
.input-group input:focus { border-color: var(--primary); background-color: var(--white); box-shadow: 0 0 0 4px var(--light-purple); }

.btn-submit {
    width: 100%; background-color: var(--primary); color: var(--white); padding: 1rem; border: none; border-radius: 0.75rem;
    font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: background-color 0.3s; margin-top: 1rem;
}
.btn-submit:hover { background-color: var(--dark-purple); }

.dashboard-header { margin-bottom: 2.5rem; }
.dashboard-header h1 { font-size: clamp(1.5rem, 4vw, 2rem); color: var(--white); }
.dashboard-header p { color: var(--dark-grey); }

.tickets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1.5rem; }
.ticket-card {
    background: var(--white); border-radius: 1rem; padding: 1.5rem; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex; flex-direction: column; gap: 0.75rem; border-top: 5px solid var(--primary); transition: transform 0.3s ease;
}
.ticket-card:hover { transform: translateY(-5px); }
.ticket-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.ticket-id { font-weight: 800; color: var(--dark-grey); font-size: 0.9rem; }
.ticket-topic { background: var(--light-purple); color: var(--dark-purple); padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.ticket-title { font-size: 1.2rem; font-weight: 700; margin: 0.5rem 0; color: var(--black-text); line-height: 1.4; }
.ticket-meta { display: flex; align-items: center; gap: 0.5rem; color: var(--dark-grey); font-size: 0.9rem; font-weight: 500; }
.ticket-meta .material-symbols-rounded { font-size: 1.2rem; color: var(--primary); }

.btn-action {
    margin-top: 1rem; background-color: var(--primary); color: var(--white); text-decoration: none; padding: 0.8rem;
    border-radius: 0.5rem; display: flex; justify-content: center; align-items: center; gap: 0.5rem; font-weight: 600; transition: background-color 0.3s;
}
.btn-action:hover { background-color: var(--dark-purple); }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 5rem 2rem; background: var(--white); border-radius: 1rem; border: 2px dashed var(--light-grey); }
.empty-icon { font-size: 5rem; color: var(--success-green); margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.5rem; color: var(--black-text); }
.empty-state p { color: var(--dark-grey); margin-top: 0.5rem; }

footer { 
    background: #05030a; 
    padding: clamp(40px, 6vw, 60px) 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-top: 1px solid rgba(255,255,255,0.05); 
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-logo-img {
    width: 30px;
    height: 30px;
    opacity: 0.8;
    filter: grayscale(100%);
    transition: all 0.3s;
}

.footer-brand:hover .footer-logo-img {
    opacity: 1;
    filter: grayscale(0%) drop-shadow(0 0 8px var(--primary));
}

.footer-logo { 
    font-family: 'Poppins', sans-serif; 
    font-weight: 800; 
    font-size: 1.2rem; 
    color: var(--white); 
    letter-spacing: -0.5px;
}

.footer-links { display: flex; gap: clamp(20px, 4vw, 40px); flex-wrap: wrap; }
.footer-links a { 
    color: var(--dark-grey); 
    text-decoration: none; 
    font-size: 0.95rem; 
    font-weight: 500;
    transition: color 0.3s; 
}
.footer-links a:hover { color: var(--white); }

@media (max-width: 768px) {
    .mobile-menu-toggle { display: block; }
    
    .public-navbar .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: rgba(10, 6, 20, 0.98);
        flex-direction: column;
        padding: 2rem 0;
        gap: 2rem;
        transform: translateY(-150%);
        opacity: 0;
        transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
        z-index: 999;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .public-navbar .nav-links.active {
        transform: translateY(0);
        opacity: 1;
    }
    
    .mobile-break { display: block; }

    .footer-brand {
        width: 100%;
        justify-content: center;
        margin-bottom: 20px;
    }

    .footer-links {
        width: 100%;
        justify-content: center;
    }

    footer {
        flex-direction: column;
        text-align: center;
    }
}

/* =========================================
   SWEETALERT2 CUSTOMIZATION (CartMaker UI)
   ========================================= */
.cm-modal-popup {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 24px !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5) !important;
}

.cm-modal-title {
    font-family: 'Poppins', 'Inter', sans-serif !important;
    font-weight: 800 !important;
    font-size: 1.5rem !important;
}

.cm-modal-text {
    font-family: 'Inter', sans-serif !important;
    color: var(--light-grey) !important;
    font-size: 0.95rem !important;
}

/* Ajuste para que los botones de Swal usen tu UI */
.cm-modal-btn {
    margin: 0 10px !important;
    width: auto !important;
    padding: 1rem 2rem !important;
}

.cm-modal-cancel {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--white) !important;
}

.cm-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--white) !important;
}