/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #5c4282;
    --secondary-color: #a78bfa;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --success-color: #10b981;
    --error-color: #ef4444;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --container-padding: 10px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--bg-white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero-logo {
    width: clamp(160px, 35vw, 240px);
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.12));
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.hero-description {
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    line-height: 1.8;
}

/* Download Buttons */
.download-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: nowrap;
    align-items: center;
    margin-top: 2rem;
    position: relative;
    z-index: 2;
}

.download-btn {
    display: inline-block;
    transition: transform 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
    width: 134px;
    height: 46px;
}

.download-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.download-btn img {
    height: 100%;
    width: 100%;
    display: block;
    pointer-events: none;
    object-fit: contain;
}

/* Features Section */
.features {
    padding: 80px 0;
    background-color: var(--bg-light);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Ecosistema de Servicios Section */
.ecosystem-section {
    padding: 80px 0;
    background-color: var(--bg-light);
}

.ecosystem-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.ecosystem-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.ecosystem-card {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ecosystem-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.ecosystem-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.ecosystem-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.ecosystem-card-description {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Tester Section */
.tester-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
}

.tester-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.tester-section .section-title {
    color: white;
    margin-bottom: 1.5rem;
}

.tester-description {
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    line-height: 1.8;
}

/* Form Styles */
.tester-form {
    margin-top: 2rem;
}

.form-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.form-input {
    flex: 1;
    min-width: 250px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s ease, background 0.3s ease;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.submit-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    background: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-loader.active {
    display: block;
}

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

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    display: none;
    animation: slideDown 0.3s ease;
}

.form-message.show {
    display: block;
}

.form-message.success {
    background: rgba(16, 185, 129, 0.2);
    color: #d1fae5;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.form-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fee2e2;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Admin Section */
.admin-section {
    padding: 80px 0;
    background-color: var(--bg-light);
}

.admin-content {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.admin-section .section-title {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.admin-section .tester-description {
    color: var(--text-secondary);
}

.admin-section .form-input {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.admin-section .form-input::placeholder {
    color: var(--text-secondary);
}

.admin-section .form-input:focus {
    border-color: var(--primary-color);
    background: var(--bg-white);
}

.submit-btn.outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.admin-actions {
    margin-top: 1.5rem;
    display: none;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.admin-list {
    margin-top: 1.5rem;
    text-align: left;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    max-height: 320px;
    overflow: auto;
    box-shadow: var(--shadow-sm);
}

.admin-group {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.admin-group:last-child {
    border-bottom: none;
}

.admin-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.admin-group-title {
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.admin-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.admin-list li:last-child {
    border-bottom: none;
}

.admin-time {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 48px;
}

.admin-email {
    color: var(--text-primary);
    word-break: break-all;
}

#adminLogoutBtn {
    display: none;
}

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

/* Footer */
.footer {
    background-color: var(--text-primary);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-text {
    opacity: 0.8;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-logo {
        width: clamp(140px, 45vw, 200px);
    }

    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .download-buttons {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0.75rem;
    }
    
    .download-btn img {
        height: 100%;
        width: 100%;
    }

    .download-btn {
        width: 122px;
        height: 42px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .ecosystem-section {
        padding: 60px 0;
    }
    
    .ecosystem-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem;
    }
    
    .ecosystem-card {
        padding: 1.25rem 0.5rem;
        min-width: 0;
    }
    
    .ecosystem-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .ecosystem-card-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .ecosystem-card-description {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem;
    }
    
    .feature-card {
        padding: 1.25rem 0.5rem;
        min-width: 0;
    }
    
    .feature-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .feature-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .feature-description {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .form-group {
        flex-direction: column;
    }
    
    .form-input {
        width: 100%;
    }
    
    .submit-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.5rem;
        margin-top: 2rem;
    }
    
    .feature-card {
        padding: 0.75rem 0.5rem;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }
    
    .feature-icon {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .feature-title {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
        line-height: 1.3;
    }
    
    .feature-description {
        font-size: 0.75rem;
        line-height: 1.3;
    }

    .hero-logo {
        width: clamp(120px, 55vw, 180px);
        margin-bottom: 1.25rem;
    }

    .hero {
        padding: 60px 0;
        min-height: 60vh;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .features,
    .ecosystem-section,
    .tester-section {
        padding: 60px 0;
    }
    
    .ecosystem-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.5rem;
        margin-top: 2rem;
    }
    
    .ecosystem-card {
        padding: 0.75rem 0.5rem;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }
    
    .ecosystem-icon {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .ecosystem-card-title {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
        line-height: 1.3;
    }
    
    .ecosystem-card-description {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}
