/**
 * Estilos para páginas públicas (landing, login, registro)
 * Agricultura Verde
 */

/* ============================================
   VARIABLES
   ============================================ */
:root {
    --primary-color: #27ae60;
    --primary-dark: #1e8449;
    --primary-light: #58d68d;
    --text-color: #343a40;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
    --white: #ffffff;
    --success-color: #27ae60;
    --border-radius: 8px;
}

/* ============================================
   PWA INSTALL BANNER
   ============================================ */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 1rem;
    z-index: 9999;
    transform: translateY(150%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
}

.pwa-install-banner.visible {
    transform: translateY(0);
}

.pwa-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.pwa-icon {
    font-size: 2rem;
    background: var(--bg-light);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.pwa-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pwa-text strong {
    color: var(--text-color);
    font-size: 0.95rem;
}

.pwa-text small {
    color: var(--text-light);
    font-size: 0.8rem;
}

.btn-install {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

/* ============================================
   RESET Y BASE
   ============================================ */
.public-page {
    background: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   HEADER PÚBLICO
   ============================================ */
.public-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    padding: 0.75rem 0;
}

.public-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.public-header .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.public-header .logo img {
    height: 40px;
    width: 40px;
    object-fit: contain;
}

.public-nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
}

.public-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.public-nav a:hover {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-actions a {
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.header-actions .btn-login {
    color: var(--text-color);
    background: transparent;
    border: 1px solid var(--border-color);
}

.header-actions .btn-login:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.header-actions .btn-register {
    background: var(--primary-color);
    color: white;
}

.header-actions .btn-register:hover {
    background: var(--primary-dark);
}

.mobile-menu-toggle {
    display: none;
}

/* ============================================
   LANDING PAGE
   ============================================ */
.landing-page {
    padding-top: 70px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #175f36 100%);
    color: white;
    padding: 8rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero .container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    max-width: 600px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    line-height: 1.15;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.hero-buttons .btn,
.hero-buttons a.btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.hero-buttons .btn-primary,
.hero-buttons a.btn-primary {
    background: white;
    color: var(--primary-color);
}

.hero-buttons .btn-primary:hover,
.hero-buttons a.btn-primary:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hero-buttons .btn-outline,
.hero-buttons a.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.hero-buttons .btn-outline:hover,
.hero-buttons a.btn-outline:hover {
    background: white;
    color: var(--primary-color);
    border-color: white;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10rem;
    opacity: 0.9;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.2));
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features {
    padding: 8rem 0;
    background: var(--bg-light);
}

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

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: 0 12px 30px rgba(39, 174, 96, 0.4);
    transition: transform 0.3s;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-icon i {
    font-size: 1.75rem;
    color: white;
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ============================================
   PLANS/PRICING SECTION
   ============================================ */
.plans {
    padding: 6rem 0;
    background: white;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    max-width: 960px;
    margin: 0 auto;
}

.plan-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
}

.plan-card:hover {
    border-color: var(--primary-light);
}

.plan-card.featured {
    border-color: var(--primary-color);
    box-shadow: 0 15px 50px rgba(39, 174, 96, 0.2);
    transform: scale(1.03);
}

.plan-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.35rem 1.25rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.plan-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.plan-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.plan-price .price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
}

.plan-price .period {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 400;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    text-align: left;
}

.plan-features li {
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-color);
    font-size: 0.95rem;
}

.plan-features li i {
    width: 20px;
    text-align: center;
}

.plan-features li .fa-check {
    color: var(--success-color);
}

.plan-features li .fa-times {
    color: #ccc;
}

.plan-features li.disabled {
    color: #bbb;
}

.plan-features li strong {
    font-weight: 600;
}

.plan-card .btn,
.plan-card a.btn {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.plan-card .btn-primary,
.plan-card a.btn-primary {
    background: var(--primary-color);
    color: white;
}

.plan-card .btn-primary:hover,
.plan-card a.btn-primary:hover {
    background: var(--primary-dark);
}

.plan-card .btn-outline,
.plan-card a.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.plan-card .btn-outline:hover,
.plan-card a.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    text-align: center;
    color: white;
}

.cta h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta p {
    font-size: 1.15rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.cta .btn,
.cta a.btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.cta .btn:hover,
.cta a.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ============================================
   FOOTER PÚBLICO
   ============================================ */
.public-footer {
    background: #1a252f;
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-decoration: none;
}

.footer-brand .logo img {
    height: 40px;
    filter: brightness(0) invert(1);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    font-size: 0.95rem;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: white;
}

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

.footer-section ul li {
    margin-bottom: 0.6rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* ============================================
   AUTH PAGES (Login, Registro, etc.)
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f5e9 100%);
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo img {
    height: 50px;
    margin-bottom: 0.5rem;
}

.auth-logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
}

.auth-card h2 {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form label {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.auth-form input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15);
}

.auth-form .btn-submit {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-form .btn-submit:hover {
    background: var(--primary-dark);
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check input[type="checkbox"] {
    width: auto;
}

/* ============================================
   ALERTAS
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        display: none;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .public-header .container {
        flex-wrap: wrap;
        position: relative;
    }

    /* Botón hamburguesa */
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
        z-index: 1001;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 25px;
        height: 2px;
        background-color: var(--primary-color);
        margin: 5px 0;
        transition: 0.3s;
    }

    /* Ocultar navegación escritorio */
    .public-nav,
    .header-actions {
        display: none;
        width: 100%;
    }

    /* Menú móvil activo */
    .public-header.mobile-active .public-nav,
    .public-header.mobile-active .header-actions {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        background: white;
        padding: 1rem 0;
        border-top: 1px solid var(--border-color);
        gap: 1rem;
    }

    .public-header.mobile-active .public-nav ul {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .public-header.mobile-active .header-actions {
        padding-top: 0;
    }

    .hero {
        padding: 6rem 0 3rem;
        /* Dar espacio al header fixed */
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

.hero-buttons .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
}

.section-title {
    font-size: 1.75rem;
}

.features-grid {
    grid-template-columns: 1fr;
}

.plans-grid {
    grid-template-columns: 1fr;
}

.plan-card.featured {
    transform: none;
}

.footer-content {
    grid-template-columns: 1fr;
    text-align: center;
}

.footer-section ul {
    margin-bottom: 1.5rem;
}
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .plan-card {
        padding: 1.5rem;
    }

    .auth-card {
        padding: 1.5rem;
    }
}