:root {
    --primary: #ff3e3e;
    --primary-hover: #ff6060;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --accent: #38bdf8;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(255, 62, 62, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 62, 62, 0.4);
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 62, 62, 0.2);
    }
}

header {
    margin-top: 4rem;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #ff3e3e, #f87171);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-dim);
    font-size: 1.2rem;
}

.container {
    width: 100%;
    max-width: 1100px;
    padding: 1.5rem;
    margin-top: 1rem;
}

section {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 3.5rem;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.6s ease-out forwards;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text);
    font-weight: 700;
}

.input-group {
    margin-bottom: 2.25rem;
    /* Separación ampliada */
    position: relative;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(255, 62, 62, 0.1);
}

input::placeholder {
    color: #64748b;
}

.button-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

button {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#btnSignUp,
#generateBtn,
#pushBtn {
    background: var(--primary);
    color: white;
}

#btnSignUp:hover,
#generateBtn:hover,
#pushBtn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(255, 62, 62, 0.3);
}

#btnSignIn,
#pay-button {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
}

#btnSignIn:hover,
#pay-button:hover {
    background: var(--glass);
    border-color: var(--text-dim);
}

/* PWA Form Specifics */
.file-input-wrapper {
    background: var(--glass);
    border: 1px dashed var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.75rem;
    display: block;
    width: 100%;
}

.file-input-wrapper:hover {
    border-color: var(--primary);
}

input[type="file"] {
    display: none;
}

.color-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--glass);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

#planInfo {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-dim);
    margin: 1rem 0;
}

/* Notifications */
#notifications {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

.notification {
    background: #1e293b;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Project List */
.project-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1.25rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-item h3 {
    font-size: 1rem;
    color: var(--text);
}

.download-btn {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: var(--accent);
    color: #0f172a;
}

.download-btn:hover {
    background: #7dd3fc;
    transform: scale(1.05);
}

/* Dashboard Specific */
#panel h2 {
    margin-top: 2rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 1.5rem;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 3rem 2rem;
    max-width: 450px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.modal-content p {
    color: var(--text-dim);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.upsell-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upsell-btn {
    padding: 1.25rem;
    border-radius: 16px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.btn-once {
    background: var(--glass);
    border-color: var(--glass-border);
    color: var(--text);
}

.btn-once:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-premium {
    background: linear-gradient(135deg, var(--primary), #ec4899);
    color: white;
}

.btn-premium:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(255, 62, 62, 0.3);
}

.btn-close {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-dim);
    background: none;
    border: none;
    cursor: pointer;
}

.btn-close:hover {
    color: var(--text);
}

/* Template Cards */
.template-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.template-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.template-card.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    box-shadow: 0 0 15px rgba(255, 62, 62, 0.2);
}

.template-card div {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.template-card span {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Icon Gallery */
.icon-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.icon-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
    border-color: var(--primary);
}

.icon-item.active {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 62, 62, 0.2);
}

/* Upsell Modal Enhancements */
.upsell-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 10px 30px rgba(255, 62, 62, 0.1);
}

/* Live Preview Phone Mockup */
.builder-layout {
    display: flex;
    gap: 4rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.preview-container {
    padding: 2.5rem;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.1), transparent);
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 1s ease-out;
}

.phone-mockup {
    width: 290px;
    height: 590px;
    background: #000;
    border-radius: 45px;
    border: 12px solid #1e293b;
    padding: 12px;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #f8fafc;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Status Bar & Nav Bar */
.status-bar {
    height: 24px;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    color: white;
    background: rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 10;
}

.status-icons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.battery {
    width: 14px;
    height: 7px;
    border: 1px solid white;
    border-radius: 2px;
    position: relative;
}

.battery::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 2px;
    width: 1px;
    height: 3px;
    background: white;
}

.nav-bar {
    height: 40px;
    background: #000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 40px;
    position: absolute;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
}

.nav-item {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    opacity: 0.8;
}

.nav-square {
    border-radius: 2px;
}

.nav-circle {
    border-radius: 50%;
}

.nav-triangle {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid rgba(255, 255, 255, 0.7);
    border-top: none;
    background: none;
}

.phone-header {
    height: 60px;
    background: var(--primary);
    width: 100%;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-end;
    padding-bottom: 8px;
    justify-content: center;
}

.phone-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
}

.phone-logo-preview {
    width: 90px;
    height: 90px;
    background: #f1f5f9;
    border-radius: 20px;
    margin-bottom: 2rem;
    background-size: cover;
    background-position: center;
    border: 4px solid white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.phone-title-preview {
    color: #0f172a;
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.phone-guide-preview {
    margin-top: 1.25rem;
    background: #f1f5f9;
    padding: 15px;
    border-radius: 16px;
    width: 100%;
    text-align: left;
    font-size: 0.75rem;
    color: #475569;
    line-height: 1.4;
    border: 1px solid #e2e8f0;
}

.phone-guide-preview b {
    color: var(--primary);
    display: block;
    margin-bottom: 4px;
}

.phone-install-btn {
    margin-top: auto;
    background: var(--primary);
    color: white;
    padding: 14px 0;
    width: 100%;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Ajustes Responsive */
@media (max-width: 1000px) {
    .builder-layout {
        flex-direction: column;
        align-items: center;
        gap: 3rem;
    }

    .preview-container {
        order: 2;
        /* Celular DEBAJO del formulario en móvil */
        width: 100%;
        display: flex;
        justify-content: center;
        background: none;
        border: none;
        padding: 0;
    }

    .form-side {
        width: 100%;
    }

    .phone-mockup {
        width: 320px;
        height: 650px;
    }
}

@media (max-width: 650px) {
    header h1 {
        font-size: 2.5rem;
    }

    header {
        margin-top: 2rem;
    }

    section {
        padding: 2.5rem 1.25rem;
        border-radius: 20px;
    }

    .phone-mockup {
        width: 88vw;
        height: 176vw;
        max-width: 340px;
        max-height: 680px;
        border-width: 8px;
    }

    .phone-screen {
        border-radius: 26px;
    }

    .container {
        padding: 1rem;
    }

    /* Feature Grid Landing */
    .features-grid {
        background: rgba(255, 255, 255, 0.03);
        padding: 1.5rem;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    @media (max-width: 480px) {
        .features-grid {
            grid-template-columns: 1fr !important;
            gap: 1.5rem !important;
        }
    }
}