@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root { --primary: #6c5ce7; --secondary: #a29bfe; --dark: #2d3436; --light: #fab1a0; }
* { box-sizing: border-box; }
body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: #f0f2f5;
    margin: 0;
    color: var(--dark);
}
a { color: inherit; }

.card { background: white; padding: 25px; border-radius: 15px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); max-width: 500px; margin: 20px auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 25px; background: var(--primary); color: white; text-decoration: none; border-radius: 8px; border: none; cursor: pointer; gap: 8px; font-weight: 600; }
.btn-secondary { background: var(--secondary); }
.btn-ghost { background: #e9ecef; color: var(--dark); }
.btn-small { 
    background: var(--dark); 
    color: white; 
    padding: 8px 18px; 
    border-radius: 20px; 
    text-decoration: none; 
    font-size: 0.85rem; 
}
input, select, textarea { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #ddd; border-radius: 5px; font-family: inherit; }
textarea { resize: vertical; }
.form-control { width: 100%; }

.page-shell { max-width: 1100px; margin: 0 auto; padding: 40px 20px; }
.page-header { text-align: center; margin-bottom: 40px; }
.page-title { margin: 0; color: var(--dark); font-size: 2rem; }
.page-subtitle { color: #666; margin-top: 8px; }
.legal-page .language-switcher { justify-content: flex-end; margin-bottom: 20px; }
.legal-content {
    background: white;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    line-height: 1.7;
}
.legal-content h2 { margin-top: 28px; color: var(--primary); }
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content ul { padding-left: 20px; }
.legal-content p { color: #555; }

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    justify-content: space-between;
}
.auth-layout {
    width: 100%;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.auth-message { background: #e3fcef; color: #00d1b2; padding: 15px; border-radius: 10px; text-align: center; margin-bottom: 20px; }
.auth-card { width: 100%; max-width: 480px; }
.auth-title { text-align: center; margin-bottom: 1.5rem; color: var(--primary); }
.form-actions { display: flex; gap: 10px; margin-top: 25px; }
.form-actions .btn { flex: 1; }

/* AJUSTES PARA EL NAVBAR PROFESIONAL */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 5%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-logo { text-decoration: none; color: var(--primary); font-weight: 700; font-size: 1.3rem; display: inline-flex; align-items: center; gap: 10px; }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-item { text-decoration: none; color: var(--dark); font-weight: 500; font-size: 0.9rem; transition: 0.3s; }
.nav-item:hover { color: var(--primary); }
.nav-greeting { font-weight: 600; color: var(--primary); }
.menu-toggle { display: none; align-items: center; justify-content: center; cursor: pointer; font-size: 1.4rem; color: var(--primary); background: transparent; border: none; }
.language-switcher { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.language-switcher label { font-weight: 600; color: var(--dark); }
.language-switcher select { width: auto; margin: 0; }

.dashboard-main { max-width: 1000px; margin: 40px auto; padding: 0 20px; }
.dashboard-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.pets-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; }
.pet-card { margin: 0; position: relative; text-align: center; animation: fadeIn 0.5s ease-out; }
.pet-card .edit-link { position: absolute; top: 15px; right: 15px; color: #ccc; }
.pet-avatar { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 3px solid var(--secondary); padding: 3px; }
.pet-name { color: var(--primary); margin: 10px 0; }
.pet-details { background: #f8f9fa; border-radius: 10px; padding: 15px; margin-top: 15px; }
.pet-details p { margin: 5px 0; font-size: 0.85rem; color: #666; }
.status-badge { font-weight: bold; }
.status-active { color: #27ae60; }
.status-pending { color: #f39c12; }
.pet-card .btn { width: 90%; font-size: 0.8rem; text-align: center; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 50px; }

.form-card { width: 100%; max-width: 500px; animation: fadeIn 0.5s ease-out; }
.form-header { text-align: center; margin-bottom: 25px; }
.form-header .icon { color: var(--primary); font-size: 2rem; margin-bottom: 10px; }
.form-note { color: #666; font-size: 0.9rem; }
.form-success { background: #e3fcef; color: #00d1b2; padding: 10px; border-radius: 8px; text-align: center; margin-bottom: 20px; font-size: 0.9rem; }
.form-alert { color: #e74c3c; background: #fdeaea; padding: 10px; border-radius: 8px; margin-bottom: 15px; font-size: 0.85rem; }
.form-group { margin-bottom: 15px; }
.form-group label { font-weight: 600; font-size: 0.85rem; color: var(--dark); }
.form-stack { display: flex; gap: 10px; margin-top: 25px; }
.form-stack .btn { flex: 1; }
.form-divider { margin-bottom: 25px; padding: 15px; border: 1px dashed #ddd; border-radius: 10px; }
.input-disabled { background: #f9f9f9; color: #999; cursor: not-allowed; }

.public-profile {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.public-layout {
    width: 100%;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.public-card { max-width: 450px; text-align: center; border: none; margin: 0; }
.public-badge { background: #ff4757; color: white; padding: 8px 20px; border-radius: 50px; display: inline-block; margin-bottom: 20px; font-weight: bold; }
.public-avatar { width: 140px; height: 140px; border-radius: 50%; border: 4px solid white; object-fit: cover; }
.public-title { color: var(--primary); margin: 0 0 10px; }
.public-subtitle { color: var(--dark); opacity: 0.8; margin-bottom: 20px; }
.public-info { background: rgba(0,0,0,0.03); padding: 20px; border-radius: 12px; text-align: left; margin-bottom: 25px; }
.public-info-title { font-weight: bold; color: var(--primary); font-size: 0.9rem; margin-bottom: 5px; }
.public-footer { margin-top: 25px; font-size: 0.75rem; color: #999; }

.site-footer {
    background: #f4f4f4;
    border-top: 1px solid #ddd;
    padding: 3rem 8%;
    color: #4b4b4b;
    width: 100%;
    font-size: 0.85rem;
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}
.footer-brand .footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--primary);
}
.footer-tagline { margin: 0.75rem 0 0.5rem; color: #555; }
.footer-contact { font-size: 0.85rem; color: #555; }
.footer-contact a { color: var(--primary); font-weight: 600; }
.footer-links h4 {
    margin: 0 0 0.9rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2b2b2b;
}
.footer-links a,
.footer-links span {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #555;
}
.footer-privacy {
    margin-top: 1rem;
    font-size: 0.78rem;
    color: #555;
    line-height: 1.5;
}
.footer-privacy h5 {
    margin: 0 0 0.6rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2b2b2b;
}
.footer-privacy p {
    margin: 0.5rem 0 0.35rem;
}
.footer-privacy ul {
    margin: 0 0 0.65rem 1.1rem;
    padding: 0;
}
.footer-privacy li {
    margin-bottom: 0.3rem;
}
.footer-bottom {
    margin-top: 2rem;
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: #777;
}
.footer-note { margin-top: 0.35rem; }

.public-profile .site-footer { background: rgba(255, 255, 255, 0.98); }

.admin-container { max-width: 1100px; margin: 40px auto; background: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.admin-title { color: #7d2ae8; border-bottom: 2px solid #f0f2f5; padding-bottom: 10px; margin-top: 0; }
.admin-meta { color: #666; }
.admin-meta a { color: var(--primary); text-decoration: none; font-weight: 600; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.admin-tab {
    padding: 8px 16px;
    border-radius: 18px;
    background: #e9ecef;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}
.admin-tab.active { background: var(--primary); color: white; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.admin-table th, .admin-table td { padding: 12px; text-align: left; border-bottom: 1px solid #eee; }
.admin-table th { background: #fafafa; color: #666; }
.photo-thumb { width: 45px; height: 45px; border-radius: 5px; object-fit: cover; }
.admin-token { color: #999; }
.badge { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; text-transform: uppercase; }
.pendiente { background: #ffeeba; color: #856404; }
.confeccion { background: #b8daff; color: #004085; }
.enviado { background: #c3e6cb; color: #155724; }
.btn-update { background: #7d2ae8; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; }
.admin-form { display: flex; gap: 5px; align-items: center; }
.admin-section { margin-top: 30px; border-top: 1px solid #f0f2f5; padding-top: 20px; }
.admin-subtitle { color: #7d2ae8; margin: 0 0 10px; }
.admin-description { color: #666; margin-top: 0; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-end; margin-top: 15px; }
.filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.filter-field label { font-size: 0.9rem; color: #666; }
.filter-field input { padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; }
.filter-actions { display: flex; gap: 12px; align-items: center; }
.btn-link { color: var(--primary); text-decoration: none; font-weight: 600; }
.admin-empty { text-align: center; color: #777; padding: 20px; }

.agent-layout { width: 100%; max-width: 600px; }
.agent-card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); width: 100%; margin-bottom: 20px; }
.agent-card h2 { color: #7d2ae8; margin-top: 0; }
.agent-card button { background: #7d2ae8; color: white; border: none; cursor: pointer; font-weight: bold; }
.paseo-item { border-left: 5px solid #00d1b2; padding: 15px; background: #fff; margin-bottom: 15px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.inscritos-list { font-size: 0.9rem; background: #f0f0f0; padding: 10px; border-radius: 5px; margin-top: 10px; }
.cupos { font-weight: bold; color: #00d1b2; }

/* UTILIDADES RESPONSIVE */
@media (max-width: 768px) {
    .auth-layout {
        align-items: stretch;
    }

    .auth-card {
        max-width: 100%;
        padding: 28px;
    }

    .menu-toggle { display: inline-flex; }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        box-sizing: border-box;
        align-items: flex-start;
        text-align: left;
    }

    .nav-links.active { display: flex; }
    .nav-item { width: 100%; padding: 10px 0; border-bottom: 1px solid #eee; display: block; }
    .btn-small { width: 100%; text-align: center; margin-top: 10px; }
    .nav-links .language-switcher { width: 100%; }
    .language-switcher select { width: 100%; }
    .container { padding: 0 1rem; }
    
    /* Convertir el header en vertical si es necesario */
    .flex { flex-direction: column; text-align: center; gap: 0.5rem; }
    
    /* Tablas responsivas: permiten scroll lateral en móvil */
    .table-container {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Ajuste de Hero en Landing */
    .hero-text h1 { font-size: 2.2rem; }
    
    /* Grid de 1 sola columna en móviles */
    .grid { grid-template-columns: 1fr !important; }

    /* Ajuste de botones para que sean más fáciles de tocar */
    .btn { width: 100%; margin-bottom: 0.5rem; }

    /* Vista de listado cómoda para el admin en móvil */
    .admin-table {
        border-collapse: separate;
        border-spacing: 0 12px;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tbody tr {
        background: #fff;
        border: 1px solid #eee;
        border-radius: 14px;
        padding: 16px;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.04);
    }

    .admin-table td {
        border: none;
        padding: 10px 0;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .admin-table td::before {
        font-weight: 600;
        color: #666;
        flex: 0 0 40%;
    }

    .admin-table td:nth-child(1)::before { content: "Foto"; }
    .admin-table td:nth-child(2)::before { content: "Mascota"; }
    .admin-table td:nth-child(3)::before { content: "Dueño"; }
    .admin-table td:nth-child(4)::before { content: "Estado"; }
    .admin-table td:nth-child(5)::before { content: "Acción"; }

    .admin-table td:first-child {
        justify-content: flex-start;
        gap: 16px;
    }

    .admin-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .admin-form select,
    .admin-form .btn-update {
        width: 100%;
    }

    .admin-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-field,
    .filter-actions {
        width: 100%;
    }

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-table-logs td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        flex: 0 0 40%;
    }

    .admin-table-owners td::before,
    .admin-table-agents td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        flex: 0 0 40%;
    }

    .site-footer { padding: 2.5rem 6%; }
    .footer-content { grid-template-columns: 1fr; }
    .footer-bottom { text-align: left; }
}

/* EFECTOS DE CRISTALERÍA (GLASSMORPHISM) PARA TARJETAS */
.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.1);
}

/* ANIMACIONES SUAVES */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

main { animation: fadeIn 0.5s ease-out; }

/* LANDING PAGE */
.landing-page {
    --primary: #7d2ae8;
    --primary-dark: #5e1fb4;
    --secondary: #00d1b2;
    --accent: #ffdd57;
    --dark: #1a1a1a;
    --light: #f9f9f9;
    --white: #ffffff;
    --surface: #ffffff;
    --shadow-soft: 0 18px 40px rgba(26, 26, 26, 0.08);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--white);
    margin: 0;
    padding: 0;
}

.landing-page * {
    box-sizing: border-box;
}

.landing-page nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 10%;
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    gap: 1.5rem;
}

.landing-page .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-page .nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.landing-page .nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: 0.3s;
}

.landing-page .nav-links a:hover {
    color: var(--primary);
}

.landing-page .btn-login {
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(125, 42, 232, 0.2);
}

.landing-page .nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(125, 42, 232, 0.25);
    background: var(--white);
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(125, 42, 232, 0.12);
}

.landing-page .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--primary);
    position: relative;
    transition: 0.3s ease;
}

.landing-page .nav-toggle span::before,
.landing-page .nav-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: var(--primary);
    transition: 0.3s ease;
}

.landing-page .nav-toggle span::before { top: -7px; }
.landing-page .nav-toggle span::after { top: 7px; }

.landing-page .nav-open .nav-toggle span { background: transparent; }
.landing-page .nav-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
.landing-page .nav-open .nav-toggle span::after { transform: translateY(-7px) rotate(-45deg); }

.landing-page .hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5rem 10%;
    background: linear-gradient(135deg, #f6f0ff 0%, #ffffff 100%);
    min-height: 80vh;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.landing-page .hero-text { flex: 1 1 320px; }
.landing-page .hero-text h1 { font-size: 3.5rem; line-height: 1.2; margin-bottom: 1.5rem; color: var(--dark); }
.landing-page .hero-text h1 span { color: var(--primary); }
.landing-page .hero-text p { font-size: 1.2rem; margin-bottom: 2rem; color: #555; max-width: 500px; }
.landing-page .hero-cta { padding: 1.2rem 2.5rem; font-size: 1.1rem; }

.landing-page .hero-image { flex: 1 1 320px; text-align: right; }
.landing-page .hero-image img { width: 100%; max-width: 550px; border-radius: var(--radius-lg); transform: rotate(-2deg); box-shadow: 20px 20px 60px rgba(0,0,0,0.1); }

.landing-page .section { padding: clamp(3.5rem, 6vw, 5rem) 10%; text-align: center; }
.landing-page .section-title { font-size: 2.5rem; margin-bottom: 3rem; position: relative; }
.landing-page .section-title::after { content: ''; width: 60px; height: 4px; background: var(--secondary); display: block; margin: 10px auto; border-radius: 2px; }
.landing-page .section-title-light { color: var(--white); }

.landing-page .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.landing-page .card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    transition: 0.4s;
    border: 1px solid #eee;
}
.landing-page .card:hover { transform: translateY(-10px); box-shadow: 0 15px 40px rgba(125, 42, 232, 0.15); }
.landing-page .card-icon { font-size: 3rem; margin-bottom: 1rem; }

.landing-page .how-it-works { background: var(--dark); color: var(--white); padding: clamp(3.5rem, 6vw, 5rem) 10%; }
.landing-page .step { display: flex; align-items: center; margin-bottom: 3rem; gap: 2rem; text-align: left; flex-wrap: wrap; }
.landing-page .step-number { font-size: 4rem; font-weight: 700; color: var(--primary); opacity: 0.5; }
.landing-page .step > div { flex: 1 1 260px; }

.landing-page .gallery-image {
    border-radius: var(--radius-md);
    width: 100%;
    height: 250px;
    object-fit: cover;
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.landing-page .site-footer { padding: 3rem 10%; }
.landing-page .footer-logo { margin-bottom: 1rem; }
.landing-page .footer-note { font-size: 0.8rem; color: #888; margin-top: 10px; }

@media (max-width: 900px) {
    .landing-page nav { flex-wrap: wrap; padding: 1.2rem 6%; }
    .landing-page .nav-toggle { display: inline-flex; margin-left: auto; }
    .landing-page .nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        padding: 1rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        gap: 1rem;
        align-items: flex-start;
        background: var(--surface);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-soft);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-10px);
        transition: max-height 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
        pointer-events: none;
    }
    .landing-page .nav-links li { width: 100%; }
    .landing-page .nav-links a { width: 100%; }
    .landing-page #main-nav.nav-open .nav-links {
        max-height: 400px;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    .landing-page .btn-login { text-align: center; width: 100%; }
}

@media (max-width: 768px) {
    .landing-page nav { padding: 1rem 5%; }
    .landing-page .hero { flex-direction: column; text-align: center; padding: 2.5rem 5%; }
    .landing-page .hero-text h1 { font-size: 2.5rem; }
    .landing-page .hero-image { margin-top: 3rem; text-align: center; }
    .landing-page .section { padding: 3rem 5%; }
    .landing-page .how-it-works { padding: 3rem 5%; }
    .landing-page .step { flex-direction: column; text-align: center; }
    .landing-page .btn-login { padding: 0.75rem 1.2rem; }
}
