/**
 * Components Styles - Portal SAT iAudita
 *
 * Componentes reutilizables:
 * - Botones
 * - Cards
 * - Badges
 * - Alertas
 * - Formularios
 * - Spinners
 * - Tables
 *
 * @package iAudita\Portal
 * @version 0.2.0
 */

/* ========================================
   BOTONES
   ======================================== */

.btn-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    text-align: center;
    text-decoration: none;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.btn-custom:active {
    transform: translateY(0);
}

/* Primary Button */
.btn-primary-custom {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn-primary-custom:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-white);
}

/* Secondary Button (Outline) */
.btn-secondary-custom {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-secondary-custom:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Secondary Button en Hero Section (fondo oscuro) - solo dentro de hero-section__cta */
.hero-section .hero-section__cta .btn-secondary-custom {
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-section .hero-section__cta .btn-secondary-custom:hover {
    background-color: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
}

/* Success Button */
.btn-success-custom {
    background-color: var(--color-success);
    color: var(--color-white);
    border-color: var(--color-success);
}

.btn-success-custom:hover {
    background-color: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
    color: var(--color-white);
}

/* Large Button */
.btn-lg-custom {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: var(--font-size-lg);
}

/* Small Button */
.btn-sm-custom {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
}


/* ========================================
   CARDS
   ======================================== */

.card-service {
    /* Card limpio sobre fondo neutro */
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-2xl);
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
    transition: all var(--transition-base);
    height: auto;
    /* Cambiado de 100% a auto para evitar problemas de layout */
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Solo aplicar height: 100% cuando las cards están en un grid/row (donde necesitan estirarse) */
.row .card-service,
.services-grid .card-service {
    height: 100%;
}

.card-service:hover {
    box-shadow: 0 8px 24px 0 rgba(124, 58, 237, 0.15);
    border-color: var(--color-primary);
    transform: translateY(-4px);
    z-index: 2;
}

.card-service__icon {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-3xl);
    color: var(--color-white);
    margin-bottom: var(--spacing-lg);
    flex-shrink: 0;
}

.card-service__icon--primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
}

.card-service__icon--secondary {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-light));
}

.card-service__icon--accent {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
}

.card-service__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-dark);
    margin-bottom: var(--spacing-md);
}

.card-service__description {
    font-size: var(--font-size-sm);
    color: var(--color-gray-600);
    margin-bottom: var(--spacing-lg);
    flex-grow: 1;
}

.card-service__features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--spacing-lg) 0;
}

.card-service__features li {
    font-size: var(--font-size-sm);
    color: var(--color-gray-700);
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-lg);
    position: relative;
}

.card-service__features li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--color-accent);
}


/* ========================================
   BADGES
   ======================================== */

.badge-custom {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--border-radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: var(--bg-success);
    color: var(--text-success);
}

.badge-warning {
    background-color: var(--bg-warning);
    color: var(--text-warning);
}

.badge-danger {
    background-color: var(--bg-danger);
    color: var(--text-danger);
}

.badge-info {
    background-color: var(--bg-info);
    color: var(--text-info);
}

.badge-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}


/* ========================================
   ALERTAS
   ======================================== */

.alert-custom {
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    border-left: 4px solid;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.alert-custom__icon {
    font-size: var(--font-size-xl);
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-custom__content h4 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-xs);
}

.alert-custom__content p {
    font-size: var(--font-size-sm);
    margin: 0;
}

.alert-success {
    background-color: var(--bg-success);
    border-color: var(--color-success);
}

.alert-success .alert-custom__icon,
.alert-success h4 {
    color: var(--text-success);
}

.alert-warning {
    background-color: var(--bg-warning);
    border-color: var(--color-warning);
}

.alert-warning .alert-custom__icon,
.alert-warning h4 {
    color: var(--text-warning);
}

.alert-danger {
    background-color: var(--bg-danger);
    border-color: var(--color-danger);
}

.alert-danger .alert-custom__icon,
.alert-danger h4 {
    color: var(--text-danger);
}

.alert-info {
    background-color: var(--bg-info);
    border-color: var(--color-info);
}

.alert-info .alert-custom__icon,
.alert-info h4 {
    color: var(--text-info);
}


/* ========================================
   FORMULARIOS
   ======================================== */

.form-group-custom {
    margin-bottom: var(--spacing-lg);
}

.form-label-custom {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-dark);
    margin-bottom: var(--spacing-sm);
}

.form-label-custom.required::after {
    content: '*';
    color: var(--color-danger);
    margin-left: var(--spacing-xs);
}

.form-control-custom {
    width: 100%;
    padding: var(--spacing-md);
    font-size: var(--font-size-base);
    font-family: var(--font-primary);
    color: var(--color-dark);
    background-color: var(--color-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all var(--transition-base);
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-control-custom::placeholder {
    color: var(--color-gray-500);
}

.form-control-custom.error {
    border-color: var(--color-danger);
}

.form-control-custom.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error-message {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-danger);
    margin-top: var(--spacing-xs);
}

textarea.form-control-custom {
    min-height: 120px;
    resize: vertical;
}

.form-checkbox-custom {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.form-checkbox-custom input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-checkbox-custom label {
    font-size: var(--font-size-sm);
    color: var(--color-gray-700);
    cursor: pointer;
}


/* ========================================
   HERO SECTION
   ======================================== */

.hero-section {
    /* Dark Theme Hero (Unified) */
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--color-white);
    padding: var(--spacing-4xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--color-primary) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.1;
    pointer-events: none;
}

/* Utility for gradient text in dark backgrounds */
.gradient-text {
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.hero-section__content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-section__title {
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-extrabold);
    margin-bottom: var(--spacing-lg);
    line-height: 1.1;
    color: var(--color-white);
}

.hero-section__subtitle {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-normal);
    margin-bottom: var(--spacing-2xl);
    opacity: 0.95;
    line-height: 1.6;
}

.hero-section__cta {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}


/* ========================================
   PRIVACY POLICY STYLES
   ======================================== */

.privacy-section {
    margin-bottom: var(--spacing-3xl);
}

.privacy-section__title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-dark);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 3px solid var(--color-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.privacy-section__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--color-white);
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    flex-shrink: 0;
}

.privacy-subsection__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-dark);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
}

.privacy-list {
    list-style: none;
    padding-left: 0;
}

.privacy-list li {
    padding-left: var(--spacing-xl);
    margin-bottom: var(--spacing-sm);
    position: relative;
}

.privacy-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
}

.privacy-section--highlight {
    background-color: var(--color-gray-50);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    border-left: 4px solid var(--color-primary);
}

.privacy-section p {
    line-height: 1.8;
    margin-bottom: var(--spacing-md);
}

.privacy-section strong {
    color: var(--color-dark);
    font-weight: var(--font-weight-semibold);
}

.privacy-section .lead {
    font-size: var(--font-size-lg);
    line-height: 1.7;
    color: var(--color-gray-700);
}


/* ========================================
   ACCORDION (Para FAQ)
   ======================================== */

.accordion-custom {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.accordion-custom__header {
    padding: var(--spacing-lg);
    background-color: var(--color-white);
    border: none;
    width: 100%;
    text-align: left;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-base);
}

.accordion-custom__header:hover {
    background-color: var(--color-gray-100);
}

.accordion-custom__header.active {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.accordion-custom__icon {
    transition: transform var(--transition-base);
}

.accordion-custom__header.active .accordion-custom__icon {
    transform: rotate(180deg);
}

.accordion-custom__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.accordion-custom__content.active {
    max-height: 1000px;
}

.accordion-custom__body {
    padding: var(--spacing-lg);
    background-color: var(--color-gray-50);
    color: var(--color-gray-700);
    font-size: var(--font-size-sm);
    line-height: 1.7;
}


/* ========================================
   SPINNERS Y LOADERS
   ======================================== */

.spinner-grow-custom {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    animation: spinner-grow 0.75s linear infinite;
}

.spinner-grow-primary {
    background-color: var(--color-primary);
}

.spinner-grow-success {
    background-color: var(--color-success);
}

.spinner-grow-warning {
    background-color: var(--color-warning);
}

@keyframes spinner-grow {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}


/* ========================================
   TABLES
   ======================================== */

.table-custom {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table-custom thead {
    background-color: var(--color-gray-100);
    border-bottom: 2px solid var(--color-gray-300);
}

.table-custom thead th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--color-dark);
}

.table-custom thead th.text-end {
    text-align: right;
}

.table-custom tbody tr {
    border-bottom: 1px solid var(--color-gray-200);
    transition: background-color var(--transition-fast);
}

.table-custom tbody tr:hover {
    background-color: var(--color-gray-50);
}

.table-custom tbody td {
    padding: var(--spacing-md);
    color: var(--color-gray-700);
}

.table-custom tbody td.text-end {
    text-align: right;
}


/* ========================================
   BACKDROP/BLUR UTILITIES
   ======================================== */

.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bg-opacity-10 {
    opacity: 0.1;
}

.bg-opacity-25 {
    background-color: rgba(255, 255, 255, 0.25);
}


/* ========================================
   CODE/MONOSPACE
   ======================================== */

code {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.875rem;
    padding: 0.125rem 0.375rem;
    border-radius: var(--border-radius-sm);
    background-color: var(--color-gray-100);
    color: var(--color-primary);
}

.font-monospace {
    font-family: 'Courier New', 'Consolas', monospace;
}


/* ========================================
   POSITION & Z-INDEX UTILITIES
   ======================================== */

.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
}

.z-1 {
    z-index: 1;
}

.z-2 {
    z-index: 2;
}


/* ========================================
   OVERFLOW UTILITIES
   ======================================== */

.overflow-hidden {
    overflow: hidden;
}


/* ========================================
   DISPLAY UTILITIES
   ======================================== */

.d-none {
    display: none;
}

.d-lg-block {
    display: none;
}

@media (min-width: 992px) {
    .d-lg-block {
        display: block;
    }
}


/* ========================================
   BORDER UTILITIES
   ======================================== */

.border-bottom {
    border-bottom: 1px solid var(--color-gray-300);
}

.border-top {
    border-top: 1px solid var(--color-gray-300);
}

.border-start {
    border-left: 1px solid var(--color-gray-300);
}

.border-4 {
    border-width: 4px !important;
}

.border-primary {
    border-color: var(--color-primary) !important;
}

.border-danger {
    border-color: var(--color-danger) !important;
}

.border-warning {
    border-color: var(--color-warning) !important;
}

.border-success {
    border-color: var(--color-success) !important;
}


/* ========================================
   ROUNDED UTILITIES
   ======================================== */

.rounded {
    border-radius: var(--border-radius) !important;
}

.rounded-3 {
    border-radius: var(--border-radius-lg) !important;
}

.rounded-4 {
    border-radius: var(--border-radius-xl) !important;
}

.rounded-pill {
    border-radius: var(--border-radius-full) !important;
}

.rounded-circle {
    border-radius: 50% !important;
}