/**
 * @file components.css
 * @description Componentes UI reutilizables de SecretarIA Legal
 *
 * Este archivo contiene todos los componentes UI compartidos entre las páginas
 * de la aplicación para mantener consistencia visual y facilitar el mantenimiento.
 *
 * Categorías de componentes:
 * 1. Base Reset y Typography
 * 2. Layout Components (Header, Footer, Containers)
 * 3. Form Components (Inputs, Labels, Selects)
 * 4. Button Components (Primary, CTA, WhatsApp)
 * 5. Content Sections
 * 6. Auth Components (Auth Gate Banner)
 *
 * @version 2.0.0
 * @date 2024-11
 * @dependencies design-system.css (debe cargarse antes)
 */

/* ========================================
   1. BASE RESET Y TYPOGRAPHY
   ======================================== */

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   2. LAYOUT COMPONENTS
   ======================================== */

/* Header / Navigation */
.page-header {
    background: var(--dark-bg-gradient);
    padding: 20px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Logo */
.logo-link {
    text-decoration: none;
}

.logo {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--light-text-color);
    letter-spacing: -1px;
}

.logo .ia {
    color: var(--accent-color);
    font-weight: 600;
}

/* Main Container */
.main-container {
    width: 100%;
    max-width: 650px;
    margin: 40px auto;
    padding: 0 15px;
    flex-grow: 1;
}

/* Calculator Wrapper */
.calculator-wrapper {
    background-color: var(--container-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* Footer */
footer {
    margin-top: auto;
    padding: 25px 20px;
    font-size: 0.9em;
    color: var(--light-text-color);
    text-align: center;
    width: 100%;
    background-color: #08214a;
}

footer a {
    color: var(--light-text-color);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--accent-color);
}

/* ========================================
   3. FORM COMPONENTS
   ======================================== */

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 1em;
}

input[type="date"],
input[type="number"],
input[type="text"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1em;
    font-family: 'Poppins', sans-serif;
    background-color: var(--container-bg);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="date"]:focus,
input[type="number"]:focus,
input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

input[type="date"]:disabled,
input[type="number"]:disabled,
input[type="text"]:disabled,
select:disabled,
textarea:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========================================
   4. BUTTON COMPONENTS
   ======================================== */

/* Primary Calculate Button */
.calculate-button {
    background-color: var(--secondary-color);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: 'Poppins', sans-serif;
}

.calculate-button:hover {
    background-color: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.calculate-button:active {
    transform: translateY(0);
}

.calculate-button:disabled {
    background-color: #90a4ae;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* CTA Button (Call to Action) */
.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 15px 35px;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: 2px solid transparent;
    font-family: 'Poppins', sans-serif;
}

.cta-button:hover,
.cta-button:focus {
    background-color: #ffb300;
    color: #08336d;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.cta-button:active {
    transform: translateY(-1px);
}

/* WhatsApp Share Button */
.whatsapp-share-button {
    background-color: #25D366;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
}

.whatsapp-share-button:hover {
    background-color: #1da851;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.whatsapp-share-button:active {
    transform: translateY(0);
}

.whatsapp-share-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Secondary Button Variant */
.button-secondary {
    background-color: var(--button-bg);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.button-secondary:hover {
    background-color: var(--button-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.button-secondary:disabled {
    background-color: #90a4ae;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

/* ========================================
   5. CONTENT SECTIONS
   ======================================== */

.content-section {
    background-color: transparent;
    padding: 30px 0;
    margin: 20px auto 30px auto;
    box-shadow: none;
    text-align: center;
}

.final-pitch {
    text-align: center;
    font-size: 1.1em;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* ========================================
   6. AUTH COMPONENTS
   ======================================== */

/* Auth Gate Banner - Shown when user is not authenticated */
.auth-gate-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(13, 71, 161, 0.08);
    border: 1px solid rgba(13, 71, 161, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    color: var(--primary-color);
}

.auth-gate-banner .auth-gate-text {
    flex: 1;
    font-weight: 600;
    font-size: 0.95em;
}

.auth-gate-banner .auth-gate-subtext {
    display: block;
    font-weight: 500;
    color: var(--primary-color);
    opacity: 0.8;
    margin-top: 4px;
    font-size: 0.9em;
}

.auth-gate-banner button {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
    white-space: nowrap;
}

.auth-gate-banner button:hover {
    background-color: #ffb300;
    transform: scale(1.05);
}

.auth-gate-banner button:active {
    transform: scale(0.98);
}

.auth-gate-banner.hidden {
    display: none;
}

/* ========================================
   7. RESPONSIVE DESIGN
   ======================================== */

/* Tablets */
@media (max-width: 768px) {
    .logo {
        font-size: 2em;
    }

    .main-container {
        max-width: 100%;
        margin: 30px auto;
    }

    .calculator-wrapper {
        padding: 25px;
    }

    .calculate-button {
        font-size: 1.1em;
        padding: 14px 35px;
    }
}

/* Mobile Landscape */
@media (max-width: 600px) {
    .logo {
        font-size: 1.8em;
    }

    .page-header {
        padding: 15px;
    }

    .calculator-wrapper {
        padding: 20px;
    }

    .calculate-button {
        font-size: 1em;
        padding: 12px 30px;
    }

    .cta-button {
        padding: 12px 28px;
        font-size: 1em;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .logo {
        font-size: 1.6em;
    }

    .main-container {
        margin: 20px auto;
        padding: 0 10px;
    }

    .calculator-wrapper {
        padding: 18px;
        border-radius: 12px;
    }

    input[type="date"],
    input[type="number"],
    input[type="text"],
    select,
    textarea {
        font-size: 1em;
        padding: 10px;
    }

    .auth-gate-banner {
        flex-direction: column;
        text-align: center;
    }

    .auth-gate-banner button {
        width: 100%;
    }
}
