/* ==========================================================================
   Sistema de Verificación de Títulos - UNIAV
   Vista principal (Index)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables y configuración global
   -------------------------------------------------------------------------- */
:root {
    --primary-dark: #1D630D;
    --primary-hover: #154a09;
    --accent-green: #1D630D;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: #ffffff;
    color: var(--text-dark);
    line-height: 1.5;
}

img {
    max-width: 100%;
    display: block;
}

/* --------------------------------------------------------------------------
   2. Utilidades
   -------------------------------------------------------------------------- */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --------------------------------------------------------------------------
   3. Sección Hero
   -------------------------------------------------------------------------- */
.hero-section {
    position: relative;
    background: linear-gradient(rgba(10, 25, 20, 0.85), rgba(10, 25, 20, 0.85)),
                url('/img/banner.jpeg') center/cover no-repeat;
    padding: 60px 0 40px 0;
    color: #ffffff;
    text-align: center;
}

.hero-logo {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    margin: 0 auto 24px;
}

.hero-title {
    font-size: clamp(1.7rem, 4.5vw + 0.5rem, 2.5rem);
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1rem;
    color: #cbd5e1;
    max-width: 650px;
    margin: 0 auto;
    font-weight: 300;
}

/* --------------------------------------------------------------------------
   4. Botón disparador de la búsqueda
   -------------------------------------------------------------------------- */
.search-trigger-area {
    padding: 28px 20px 20px;
    text-align: center;
}

.btn-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-dark);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 16px 36px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s, transform 0.2s;
}

.btn-search-trigger:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-search-trigger:focus-visible {
    outline: 2px solid var(--accent-green);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   5. Modal de búsqueda
   -------------------------------------------------------------------------- */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(8, 20, 12, 0.65);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.search-modal.is-open {
    visibility: visible;
    opacity: 1;
}

.search-card {
    position: relative;
    width: min(560px, 100%);
    background: var(--card-bg);
    border-radius: 12px;
    padding: 40px 36px 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.modal-close:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.card-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   6. Formulario
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(29, 99, 13, 0.12);
}

.form-input.is-invalid {
    border-color: #dc2626;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-message {
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 12px;
}

.form-message--error {
    color: #dc2626;
}

.btn-search {
    width: 100%;
    background-color: var(--primary-dark);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.btn-search:hover {
    background-color: var(--primary-hover);
}

.btn-search:focus-visible {
    outline: 2px solid var(--accent-green);
    outline-offset: 2px;
}

.btn-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.security-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.security-note i {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 2px;
}

/* --------------------------------------------------------------------------
   7. Sección de proceso de validación
   -------------------------------------------------------------------------- */
.process-section {
    padding: 0 0 80px 0;
    text-align: center;
}

.section-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 550px;
    margin: 0 auto 50px auto;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.step-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px 24px;
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
}

.step-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.step-number {
    display: inline-block;
    background-color: #f1f5f9;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.step-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.step-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   8. Sección de características / garantías
   -------------------------------------------------------------------------- */
.features-section {
    padding: 20px 0 60px 0;
    border-top: 1px solid #f1f5f9;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 1rem;
    flex-shrink: 0;
}

.feature-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.feature-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   9. Accesibilidad y responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .hero-section {
        padding: 44px 0 32px 0;
    }

    .hero-title {
        font-size: clamp(1.6rem, 4.5vw + 0.4rem, 2rem);
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .btn-search-trigger {
        display: flex;
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        justify-content: center;
        padding: 14px 28px;
    }

    .search-card {
        width: 100%;
        padding: 32px 20px 24px;
    }

    .card-title {
        font-size: 1.25rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 36px 0 24px 0;
    }

    .hero-logo {
        width: 76px;
        height: 76px;
        margin-bottom: 16px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        margin-bottom: 32px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .step-card {
        padding: 24px 18px;
    }

    .search-modal {
        align-items: flex-end;
        padding: 0;
    }

    .search-card {
        width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: calc(100dvh - 24px);
        padding: 28px 18px 24px;
    }

    .features-section {
        padding: 16px 0 40px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}