/* 
    Hipotecaaqui - Premium Design System 
    Colors: Blue Gray (#33475b), Coral Red (#ff5a5f)
*/

:root {
    --primary: #33475b;
    --primary-light: #4a627a;
    --secondary: #ff5a5f;
    --secondary-hover: #e04a4f;
    --text-dark: #1a1a1a;
    --text-light: #f4f7f9;
    --bg-light: #ffffff;
    --bg-alt: #f8fafc;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.2;
    color: var(--primary);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.5rem; margin-bottom: 1rem; }

p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 1rem;
}

.highlight {
    color: var(--secondary);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 100px 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--secondary);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 90, 95, 0.3);
}

.btn-primary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 90, 95, 0.4);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 0;
    transition: var(--transition);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    z-index: 1001;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--secondary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f4f7f9 0%, #ffffff 100%);
    position: relative;
    padding-top: 80px;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40%;
    height: 80%;
    background: radial-gradient(circle at center, rgba(255, 90, 95, 0.05) 0%, transparent 70%);
    z-index: 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-image {
    position: relative;
    z-index: 1;
}

.hero-image img {
    width: 100%;
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    transform: rotate(2deg);
    transition: var(--transition);
}

.hero-image img:hover {
    transform: rotate(0deg) scale(1.02);
}

@media (max-width: 968px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-btns {
        justify-content: center;
    }
    .hero-image {
        display: none;
    }
}

.hero p {
    font-size: 1.25rem;
    margin: 2rem 0;
    color: #444;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
}

/* Cards & Sections */
.bg-alt {
    background-color: var(--bg-alt);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.02);
}

.card:hover {
    transform: translateY(-10px);
}

.icon-box {
    width: 60px;
    height: 60px;
    background: rgba(51, 71, 91, 0.05);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.5rem;
}

/* AKIA Section */
.akia-section {
    background-color: var(--primary);
    color: white;
}

.akia-section h2, .akia-section h3, .akia-section h4, .akia-section p {
    color: white;
}

.akia-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 20px;
    transition: var(--transition);
}

.akia-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.akia-card.highlight-card {
    border: 2px solid var(--secondary);
    background: rgba(255, 90, 95, 0.15);
    box-shadow: 0 0 30px rgba(255, 90, 95, 0.3);
    position: relative;
    overflow: hidden;
}

.akia-card.highlight-card::after {
    content: 'TOP';
    position: absolute;
    top: 10px;
    right: -25px;
    background: var(--secondary);
    color: white;
    padding: 2px 30px;
    font-size: 0.7rem;
    font-weight: 900;
    transform: rotate(45deg);
}

.akia-card.highlight-card h4 {
    color: var(--secondary) !important;
}

/* Stats */
.stats {
    background-color: var(--secondary);
    color: white;
    padding: 60px 0;
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
    text-align: center;
}

.stat-item h3 {
    font-size: 3rem;
    color: white;
    margin-bottom: 0.5rem;
}

/* Emotional Section */
.emotional-banner {
    background: linear-gradient(rgba(51, 71, 91, 0.85), rgba(51, 71, 91, 0.85)), url('imagenes/family_moving.webp') center/cover fixed;
    color: white;
    text-align: center;
    padding: 150px 0;
    position: relative;
}

.emotional-banner h2 {
    color: white;
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    margin-bottom: 2rem;
}

.emotional-banner p {
    color: rgba(255, 255, 255, 0.8);
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.4rem;
    line-height: 1.8;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Testimonials */
.testimonial {
    font-style: italic;
    border-left: 4px solid var(--secondary);
    padding-left: 1.5rem;
    margin: 2rem 0;
}

/* FAQ */
.faq-item {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem 0;
    cursor: pointer;
    transition: var(--transition);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    gap: 1rem;
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--secondary);
    flex-shrink: 0;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0, 1, 0, 1);
    color: #666;
    font-size: 1rem;
    line-height: 1.7;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    margin-top: 1rem;
    transition: all 0.4s cubic-bezier(1, 0, 1, 0);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-category {
    margin-top: 4rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--secondary);
    display: inline-block;
}

/* Footer */
footer {
    background-color: #1a2a3a;
    color: white;
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
}

.footer-links h4 {
    color: white;
    margin-bottom: 1.5rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--secondary);
}

.copyright {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: #777;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 100px 2rem;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        transition: var(--transition);
        z-index: 1000;
        gap: 1.5rem;
    }

    .nav-links.active {
        right: 0;
    }

    .mobile-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .hero-btns { flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    section { padding: 60px 0; }
}

/* Modal & Form Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 42, 58, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 2rem;
    opacity: 0;
    transition: var(--transition);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 24px;
    position: relative;
    padding: 2rem 2.5rem;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--secondary);
    transform: rotate(90deg);
}

.form-header {
    text-align: center;
    margin-bottom: 1.2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
}

.form-group input, .form-group select {
    padding: 0.65rem 1rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(255, 90, 95, 0.1);
}

.full-width {
    grid-column: span 2;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: 12px;
}

.toggle-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.conditional-block {
    grid-column: span 2;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease;
    opacity: 0;
    pointer-events: none;
}

.conditional-block.active {
    max-height: 1000px;
    opacity: 1;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px dashed #ddd;
    pointer-events: auto;
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
}

.success-message {
    text-align: center;
    padding: 4rem 0;
    display: none;
}

.success-message i {
    font-size: 4rem;
    color: #4ade80;
    margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .full-width {
        grid-column: span 1;
    }
    .modal-content {
        padding: 2rem 1.5rem;
    }
}
