:root {
    --ocean: #4FC3F7;
    --forest: #81C784;
    --sun: #FFD54F;
    --primary: #FF7043; 
    --text-main: #37474F;
    --bg-texture: #f4f7f6;
}

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

body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--bg-texture);
    color: var(--text-main);
    background-image: radial-gradient(#dce4e8 1px, transparent 1px), linear-gradient(45deg, #f9f9f9 25%, transparent 25%, transparent 75%, #f9f9f9 75%, #f9f9f9);
    background-size: 20px 20px, 40px 40px;
    background-position: 0 0, 0 0;
    overflow-x: hidden;
}

/* --- NAVBAR --- */
.navbar {
    background: white;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border-bottom: 3px solid var(--sun);
}

.btn-home {
    background: transparent;
    color: var(--text-main);
    border: 2px solid #eee;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: bold;
    font-family: 'Fredoka One', cursive;
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s;
    margin-right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-home:hover { border-color: var(--ocean); color: var(--ocean); background: white; }

.brand {
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    color: var(--ocean);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.brand img { height: 50px; }
.brand span { color: var(--forest); }

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

.btn-nav {
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: bold;
    font-family: 'Fredoka One', cursive;
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-login { background: #f0f0f0; color: #555; }
.btn-login:hover { background: #e0e0e0; }

.btn-register { background: var(--primary); color: white; box-shadow: 0 4px 10px rgba(255, 112, 67, 0.3); }
.btn-register:hover { background: #f4511e; transform: translateY(-2px); }

.btn-dashboard { background: var(--ocean); color: white; box-shadow: 0 4px 10px rgba(79, 195, 247, 0.3); }

/* --- HERO --- */
.hero {
    text-align: center;
    padding: 5rem 1rem;
    background: white;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    margin-bottom: 3rem;
}
.hero-badge {
    background: var(--sun); color: var(--text-main);
    padding: 8px 20px; border-radius: 30px; font-weight: bold;
    display: inline-block; margin-bottom:1rem; box-shadow: 0 4px 10px rgba(255, 213, 79, 0.4);
}
.hero h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 3.5rem; line-height: 1.1;
    color: var(--text-main); margin-bottom:1rem;
}

/* --- FILTROS --- */
.filters-container {
    display: flex; justify-content: center; gap: 1.5rem;
    flex-wrap: wrap; margin-bottom: 3rem;
}
.filter-btn {
    background: white; border: 2px solid transparent; padding: 1rem 2rem;
    border-radius: 50px; cursor: pointer; font-family: 'Fredoka One', cursive;
    font-size: 1.1rem; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: 0.3s;
}
.filter-btn.active {
    border-color: var(--primary); background: #FFF3E0;
    color: var(--primary); transform: scale(1.05);
}

/* --- GRID Y TARJETAS --- */
.section-project {
    padding: 4rem 5%; background: white; margin-bottom: 3rem;
    border-radius: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}
.project-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem; margin-top: 2rem;
}
.project-card {
    background: #FAFAFA; padding: 2rem; border-radius: 20px;
    border-top: 5px solid var(--ocean);
}

.grid-container {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem; padding: 0 5% 5rem; max-width: 1400px; margin: 0 auto;
}

.mission-card {
    background: white; border-radius: 25px; overflow: visible;
    position: relative; box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    transition: all 0.4s ease; border: 8px solid white;
}
.mission-card:hover {
    transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border-color: var(--forest);
}

.card-stamp {
    position: absolute; top: 10px; right: -10px; background: var(--sun);
    color: var(--text-main); padding: 5px 15px; font-family: 'Fredoka One', cursive;
    transform: rotate(10deg); border: 3px dashed white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2); font-size: 0.85rem; z-index: 2;
}
.card-img { height: 200px; width: 100%; object-fit: cover; border-radius: 18px 18px 0 0; }
.card-body { padding: 1.5rem; text-align: center; }
.card-title { font-family: 'Fredoka One', cursive; font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--text-main); }
.card-desc { font-size: 0.95rem; color: #777; margin-bottom: 1rem; min-height: 50px; }

.mission-btn {
    display: block; width: 100%; padding: 12px; border-radius: 50px; border: none;
    font-family: 'Fredoka One', cursive; background: #f0f0f0; color: #777; cursor: pointer; transition: 0.3s;
}
.mission-btn:hover { background: var(--ocean); color: white; }

/* --- MODALES (LIMPIOS) --- */
.modal {
    display: none; position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white; width: 90%; max-width: 600px;
    padding: 0; border-radius: 25px;
    text-align: center; position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    overflow: hidden; 
}

.modal-header-img {
    width: 100%; height: 250px; object-fit: cover;
}

.modal-body {
    padding: 2rem;
}

.modal-title {
    font-family: 'Fredoka One', cursive; font-size: 2rem;
    color: var(--text-main); margin-bottom: 1rem;
}

.modal-text {
    font-size: 1.1rem; color: #555; line-height: 1.6; margin-bottom: 2rem;
    max-height: 300px; overflow-y: auto;
}

.close-btn {
    position: absolute; top: 15px; right: 20px;
    background: rgba(255,255,255,0.8); border-radius: 50%;
    width: 40px; height: 40px; display: flex; justify-content: center;
    align-items: center; font-size: 1.5rem; cursor: pointer; color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2); transition: 0.3s;
}
.close-btn:hover { background: white; color: var(--primary); transform: scale(1.1); }

.form-control {
    width: 100%; padding: 15px; margin-bottom: 1.5rem;
    border: 2px solid #eee; border-radius: 15px;
    font-family: 'Quicksand', sans-serif; font-size: 1.1rem;
}

/* --- FOOTER --- */
footer {
    background: #2C3E50; color: white;
    padding: 4rem 5% 2rem; text-align: center;
}
.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 2rem; flex-wrap: wrap; }
.footer-links a { color: #bdc3c7; text-decoration: none; transition: 0.3s; }
.footer-links a:hover { color: var(--sun); }