/* --- styles.css --- */

/* --- GENERAL STYLES --- */
:root {
    --primary: #003366;   /* Dark Corporate Blue */
    --secondary: #005b96; /* Medium Blue */
    --accent: #25D366;    /* WhatsApp Green */
    --light: #f4f7f6;
    --text: #333;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    scroll-behavior: smooth;
}

body {
    color: var(--text);
    background-color: var(--light);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- HEADER --- */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.8rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo alignment */
.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-container:hover .logo-img {
    transform: scale(1.02);
}

.logo-img {
    height: 75px;
    width: auto;
    transition: 0.3s;
    display: block;
}

/* Footer logo */
.footer-logo-img {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
    vertical-align: middle;
    margin-right: 8px;
}

.social-icons a {
    color: var(--white);
    text-decoration: none;
}

.social-icons a:hover i {
    color: var(--accent);
}


nav ul {
    display: flex;
    gap: 20px;
}

nav ul li a {
    font-weight: 600;
    color: var(--primary);
    transition: 0.3s;
    font-size: 0.95rem;
}

nav ul li a:hover { color: var(--secondary); }

/* --- HERO / ABOUT US --- */
#nosotros {
    /* Blue gradient overlay on business/office background image */
    background: linear-gradient(rgba(0,51,102,0.85), rgba(0,51,102,0.85)), url('https://images.unsplash.com/photo-1497366216548-37526070297c?ixlib=rb-4.0.3&auto=format&fit=crop&w=1469&q=80');
    background-size: cover;
    background-position: center;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    padding: 60px 20px;
}

#nosotros h1 { font-size: 2.5rem; margin-bottom: 1rem; }
#nosotros p { max-width: 700px; margin-bottom: 2rem; font-size: 1.1rem; }

.btn-hero {
    background-color: var(--accent);
    color: var(--white);
    padding: 12px 35px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform 0.3s, background-color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-hero:hover { transform: translateY(-3px); background-color: #20bd5a; box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4); }

/* --- GENERAL SECTIONS --- */
section {
    padding: 80px 5%;
    scroll-margin-top: 95px; /* offset so sticky header doesn't cover section title on anchor jump */
}
.section-title {
    text-align: center;
    color: var(--primary);
    margin-bottom: 50px;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}
/* Small decorative line below section titles */
.section-title::after {
    content: ''; display: block; width: 60px; height: 3px; background: var(--secondary); margin: 15px auto 0;
}

/* --- CARD GRID SYSTEM (used in Quote and Self-management sections) --- */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 fixed columns: 8 cards = 2 symmetric rows */
    gap: 25px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Self-management section override: 6 cards = 2 symmetric rows of 3 */
#autogestion .grid-cards {
    grid-template-columns: repeat(3, 1fr);
}

/* Base card styles */
.card {
    background: var(--white);
    padding: 35px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%; /* Equal height for all cards in a row */
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--secondary);
    box-shadow: 0 15px 30px rgba(0,51,102,0.15);
}

.card i {
    font-size: 2.8rem;
    color: var(--secondary);
    margin-bottom: 20px;
}

.card h3 { font-size: 1.1rem; color: var(--primary); font-weight: 600;}

/* Specific styles for self-management cards (anchor elements) */
a.autogestion-card {
    text-decoration: none;
    color: inherit;
    display: flex; /* Ensures flexbox behavior for centering */
    justify-content: center;
    align-items: center;
    min-height: 120px; /* Minimum height for visual consistency without an icon */
}
a.autogestion-card h3 { margin: 0; } /* Center text when there is no icon */


/* --- CLAIMS SECTION --- */
.siniestros-options {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.btn-siniestro {
    padding: 15px 35px;
    border-radius: 8px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-whatsapp-outline {
    border: 2px solid var(--accent); color: var(--accent); background: white;
}
.btn-whatsapp-outline:hover { background: var(--accent); color: white; box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3); }

.btn-form-outline {
    border: 2px solid var(--primary); color: var(--primary); background: white;
}
.btn-form-outline:hover { background: var(--primary); color: white; box-shadow: 0 5px 15px rgba(0, 51, 102, 0.3); }


/* --- FOOTER --- */
footer {
    background-color: var(--primary);
    color: rgba(255,255,255,0.8);
    padding: 60px 5% 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-logo {
    color: var(--white); font-size: 1.3rem; font-weight: bold; margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
}
footer h4 { margin-bottom: 20px; color: var(--white); font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px;}
footer p, footer li { margin-bottom: 12px; font-size: 0.95rem; }
footer ul li i { margin-right: 12px; color: var(--secondary); }
.social-icons { font-size: 1.5rem; margin-top: 20px; }
.social-icons i { margin-right: 15px; transition: 0.3s; color: var(--white); cursor: pointer;}
.social-icons i:hover { color: var(--accent); }

/* --- MODALS (POP UPS) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex; /* always in render tree — never toggle display */
    justify-content: center; align-items: center; z-index: 2000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0s 0.18s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.18s ease;
}

.modal-content {
    background: white; padding: 40px 30px; border-radius: 15px; width: 90%; max-width: 450px;
    position: relative; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.18s ease, opacity 0.18s ease;
    will-change: transform, opacity;
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.close-modal {
    position: absolute; top: 15px; right: 20px; font-size: 1.8rem; cursor: pointer; color: #999; transition: 0.3s;
}
.close-modal:hover { color: var(--primary); }

.modal-content h3 { color: var(--primary); margin-bottom: 15px; font-size: 1.5rem;}
.modal-options { display: flex; flex-direction: column; gap: 15px; margin-top: 30px; }

.btn-modal {
    padding: 15px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; font-size: 1rem; display: flex; align-items: center; justify-content: center; gap: 10px; transition: 0.3s;
}
.bg-ws { background: var(--accent); color: white; }
.bg-ws:hover { background-color: #20bd5a; }
.bg-form { background: var(--primary); color: white; }
.bg-form:hover { background-color: var(--secondary); }

/* --- FLOATING WHATSAPP WIDGET --- */
.whatsapp-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* Native WhatsApp-style font */
}

.whatsapp-chat-box {
    background: #f0f2f5; /* Typical light grey chat background */
    width: 330px;
    border-radius: 18px; /* Highly rounded corners */
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
    overflow: hidden;
    display: none; /* Hidden by default */
    animation: slideUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: bottom right;
}

/* Green header */
.chat-header {
    background: #09ce5d; /* Bright green, WhatsApp Business style */
    color: white;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 18px 18px 0 0; /* Rounded top corners only */
}

.header-title {
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-chat {
    cursor: pointer;
    background: rgba(0,0,0,0.1);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}
.close-chat:hover { background: rgba(0,0,0,0.2); }

/* Chat body */
.chat-body {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Message bubble */
.chat-bubble {
    background: white;
    padding: 15px 18px;
    border-radius: 0 15px 15px 15px; /* Pointed top-left corner */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    color: #4a4a4a;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
    margin-left: 10px; /* Space for the bubble tail */
}

/* Bubble tail */
.chat-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10px;
    width: 0;
    height: 0;
    border-top: 15px solid white;
    border-left: 12px solid transparent;
}

/* Widget footer with large button */
.chat-footer {
    padding: 0 20px 20px 20px;
}

.btn-chat-big {
    background: #09ce5d;
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.05rem;
    padding: 14px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(9, 206, 93, 0.3);
}

.btn-chat-big:hover {
    background: #06b550;
    transform: translateY(-2px);
}

/* Floating round button (trigger) */
.whatsapp-icon-btn {
    background: #09ce5d;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}
.whatsapp-icon-btn:hover { transform: scale(1.1); }

/* --- DOCUMENTATION PAGE STYLES --- */
/* Specific styles for the secondary/documentation page */
.doc-container {
    max-width: 800px; margin: 80px auto; padding: 40px 20px; text-align: center; background: white; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.icon-placeholder { font-size: 5rem; color: #ddd; margin-bottom: 30px; }
.doc-container h1 { color: var(--primary); margin-bottom: 20px; }
.btn-back {
    display: inline-flex; align-items: center; gap: 10px; margin-top: 40px; text-decoration: none; color: var(--primary); border: 2px solid var(--primary); padding: 10px 25px; border-radius: 30px; font-weight: 600; transition: 0.3s;
}
.btn-back:hover { background: var(--primary); color: white; }


/* --- RESPONSIVE --- */
@media (max-width: 980px) {
    .nav-text { display: none; }
    nav ul li a { font-size: 1.4rem; }
    nav ul { gap: 22px; }
}

@media (max-width: 768px) {
    header { padding: 15px 5%; }
    .logo-img { height: 40px; }
    section { scroll-margin-top: 65px; } /* shorter header on mobile */
    #nosotros { padding-top: 100px; min-height: auto;} /* Adjustment for sticky header */
    #nosotros h1 { font-size: 2rem; }
    section { padding: 50px 5%; }
    .section-title { font-size: 1.7rem; }
    .grid-cards { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    #autogestion .grid-cards { grid-template-columns: repeat(2, 1fr); } /* Keep 2 cols on tablet too */
    .card { padding: 25px 15px; }
    .card i { font-size: 2rem; }
    .siniestros-options { flex-direction: column; gap: 15px; }
    .btn-siniestro { width: 100%; justify-content: center; }
}

@media (max-width: 600px) {
    nav ul li a { font-size: 0.95rem; }
    nav ul { gap: 14px; }
}

@media (max-width: 400px) {
    nav ul li a { font-size: 14px; }
    nav ul { gap: 10px; }
}

@media (max-width: 480px) {
    /* On very small screens, force single column */
    .grid-cards { grid-template-columns: 1fr; }
    #autogestion .grid-cards { grid-template-columns: 1fr; }
}

/* --- FORM STYLES --- */
.form-container {
    text-align: left;
    margin-top: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    transition: 0.3s;
    background-color: #fcfcfc;
}

.form-control:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 91, 150, 0.1);
    background-color: #fff;
}

/* File input styling */
.form-control-file {
    width: 100%;
    padding: 10px 12px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    background: #fafafa;
    transition: 0.3s;
}
.form-control-file:hover {
    border-color: var(--secondary);
    background: #f0f4f8;
}

/* Error state for inputs */
.form-control.error,
.form-control-file.error { border-color: #e74c3c; }

.form-validation-error {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-bottom: 10px;
    text-align: center;
}

/* Form submit button */
.btn-submit {
    width: 100%;
    background-color: var(--primary);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}
.btn-submit:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
}
