/* assets/styles/libre_deuda.css */

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

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Page Layout */
.app-layout {
    width: 100%;
    max-width: 540px;
    padding: 20px;
    box-sizing: border-box;
}

/* Workflow Container */
.workflow-container {
    width: 100%;
}

.workflow-container.modal-open .workflow-card {
    transform: none !important;
    pointer-events: none !important;
}

/* Main Card */
.workflow-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.4s ease-out;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.workflow-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.08), 0 12px 15px -5px rgba(0, 0, 0, 0.03);
}

/* Header */
.workflow-header {
    padding: 32px 32px 24px 32px;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.logo-icon {
    font-size: 1.4rem;
}

.logo-text {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.workflow-title {
    margin: 0 0 8px 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.workflow-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* Content Area */
.workflow-content {
    padding: 32px;
}

/* Form Styles */
.workflow-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-main);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.form-error-msg {
    color: var(--color-error);
    font-size: 0.82rem;
    margin-top: 4px;
    font-weight: 500;
}

.form-error-msg ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.form-input.is-invalid {
    border-color: var(--color-error) !important;
    background-color: var(--color-error-bg) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12) !important;
}

.form-general-error {
    background-color: var(--color-error-bg);
    border: 1px solid var(--color-error-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-error);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 12px;
    animation: slideDown 0.3s ease-out;
}

.form-general-error .error-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--color-error);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-payment {
    background: linear-gradient(135deg, #009ee3 0%, #007eb5 100%);
    color: #ffffff;
    font-weight: 700;
}

.btn-payment:hover {
    background: linear-gradient(135deg, #00aae4 0%, #008cc0 100%);
    box-shadow: 0 4px 12px rgba(0, 158, 227, 0.25);
}

/* Status Views (Multi-step result screens) */
.status-view {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.status-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 1.8rem;
    box-shadow: var(--shadow-md);
}

.status-title {
    margin: 0 0 12px 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
}

.status-message {
    margin: 0 0 24px 0;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    max-width: 360px;
}

/* Success styling */
.status-success .status-icon-wrapper {
    background-color: var(--color-success-bg);
    color: var(--color-success);
    border: 2px solid var(--color-success-border);
}

/* Error styling */
.status-error .status-icon-wrapper {
    background-color: var(--color-error-bg);
    color: var(--color-error);
    border: 2px solid var(--color-error-border);
}

/* Completed styling */
.status-completed .status-icon-wrapper {
    background-color: #fef3c7;
    color: #d97706;
    border: 2px solid #fde68a;
}

.debt-table-wrapper {
    padding: 12px;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.debt-box {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 28px;
    background-color: #fafbfc;
}

.debt-summary {
    padding: 16px 20px;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.debt-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.debt-amount {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-error);
}


.debt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.debt-table th {
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.debt-table td {
    padding: 10px 12px;
    color: var(--color-text-main);
    border-bottom: 1px solid #f3f4f6;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.debt-table tr:last-child td {
    border-bottom: none;
}

.text-right {
    text-align: right !important;
}

.font-mono {
    font-family: monospace;
    font-size: 0.9em;
}

.font-semibold {
    font-weight: 600;
}

/* Info Cards */
.info-card {
    background-color: var(--color-primary-light);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 28px;
    text-align: left;
}

.info-text {
    margin: 0;
    font-size: 0.88rem;
    color: #1e40af;
    line-height: 1.5;
}

/* Success Details */
.success-details-card {
    background-color: #f9fafb;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 28px;
    width: 100%;
    box-sizing: border-box;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.detail-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--color-text-main);
    font-weight: 500;
}

/* Actions Group */
.action-buttons-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8,0,1,1);
    }
    50% {
        transform: translateY(-8px);
        animation-timing-function: cubic-bezier(0,0,0.2,1);
    }
}

/* Split Layout Container */
.workflow-main-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 180px 24px 60px 24px; /* Space for floating header */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.workflow-grid-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    align-items: start;
    width: 100%;
    min-width: 0;
}

.workflow-column {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

.workflow-column:has(.modal-open) {
    z-index: 10000;
}

.workflow-column .app-layout {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

/* Sidebar Styles */
.workflow-info-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.info-sidebar-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
}

.info-sidebar-card.highlight {
    background-color: #f0f7ff;
    border-color: #bfdbfe;
    display: flex;
    gap: 20px;
    align-items: start;
}

.info-sidebar-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-sidebar-icon svg {
    width: 22px;
    height: 22px;
}

.info-sidebar-content {
    display: flex;
    flex-direction: column;
}

.info-sidebar-content h4 {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e3b8b;
    line-height: 1.3;
}

.info-sidebar-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #1e40af;
    line-height: 1.5;
}

.info-sidebar-content .link-highlight {
    color: #2563eb;
    font-weight: 700;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.info-sidebar-content .link-highlight:hover {
    color: #1d4ed8;
}

.info-sidebar-card h4 {
    margin: 0 0 24px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-spse-dark);
    letter-spacing: -0.01em;
}

/* Step-by-Step list */
.step-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step-list li {
    display: flex;
    gap: 16px;
    align-items: start;
}

.step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #eff6ff;
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step-text strong {
    font-size: 0.95rem;
    color: var(--color-spse-dark);
    font-weight: 700;
}

.step-text p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* Full Width FAQ Section Styles */
.workflow-faq-section {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
}

.workflow-faq-section h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-spse-dark);
    margin: 0 0 16px 0;
    text-align: left;
    letter-spacing: -0.02em;
}

.faq-divider {
    width: 60px;
    height: 3px;
    background-color: #2563eb;
    border-radius: 2px;
    margin-bottom: 36px;
}

/* FAQ Accordion Styling */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.faq-accordion-item {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    background-color: #ffffff;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-accordion-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.faq-accordion-item.active {
    border-color: #bfdbfe;
    background-color: #fafbfd;
}

.faq-accordion-trigger {
    width: 100%;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    outline: none;
}

.faq-accordion-trigger span {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-spse-dark);
    line-height: 1.4;
    transition: color 0.2s ease;
}

.faq-accordion-item.active .faq-accordion-trigger span {
    color: #1e40af;
}

.faq-accordion-trigger .faq-icon {
    width: 18px;
    height: 18px;
    color: #64748b;
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.faq-accordion-item.active .faq-icon {
    transform: rotate(180deg);
    color: #2563eb;
}

.faq-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.faq-accordion-item.active .faq-accordion-content {
    max-height: 250px; /* Expands smoothly to fit text */
    opacity: 1;
}

.faq-accordion-inner {
    padding: 0 24px 20px 24px;
}

.faq-accordion-inner p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.faq-accordion-inner p strong {
    color: #1e3a8a;
}

/* Responsive Styles */
@media (max-width: 968px) {
    .workflow-grid-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .workflow-faq-section {
        padding: 36px 24px;
    }
    .faq-accordion-trigger {
        padding: 16px 20px;
    }
    .faq-accordion-trigger span {
        font-size: 0.95rem;
    }
    .faq-accordion-inner {
        padding: 0 20px 16px 20px;
    }
    .faq-accordion-inner p {
        font-size: 0.88rem;
    }
}

@media (max-width: 850px) {
    .workflow-main-container {
        padding-top: 110px;
    }
}

@media (max-width: 640px) {
    .workflow-main-container {
        padding-top: 110px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .workflow-header {
        padding: 24px 20px 18px 20px;
    }
    .workflow-content {
        padding: 20px;
    }
    .workflow-faq-section {
        padding: 24px 16px;
    }
    .debt-table th, .debt-table td {
        padding: 8px 6px;
    }
    .debt-summary {
        padding: 12px 14px;
    }
    .info-sidebar-card {
        padding: 20px;
    }
}

@media (max-width: 500px) {
    .debt-table-wrapper {
        padding: 0;
        max-height: 280px;
    }
    .debt-table, 
    .debt-table tbody, 
    .debt-table tr, 
    .debt-table td {
        display: block;
    }
    .debt-table thead {
        display: none;
    }
    .debt-table tr {
        padding: 12px 100px 12px 16px;
        border-bottom: 1px solid #e2e8f0;
        position: relative;
        text-align: left;
    }
    .debt-table tr:last-child {
        border-bottom: none;
    }
    .debt-table td {
        padding: 2px 0;
        border: none;
        text-align: left;
        width: 100%;
        box-sizing: border-box;
    }
    .debt-table td.text-right {
        text-align: right !important;
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: auto;
        font-size: 0.95rem;
    }
    .debt-table td.font-mono {
        color: var(--color-text-muted);
        font-size: 0.8rem;
        margin-top: 2px;
    }
}


/* Modal Estilo Premium */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header-alert {
    padding: 28px 24px 18px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(180deg, #fef3c7 0%, #ffffff 100%);
    border-bottom: 1px solid var(--color-border);
}

.modal-icon-alert {
    width: 56px;
    height: 56px;
    background: #fef3c7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d97706;
    margin-bottom: 14px;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.15);
}

.modal-title-alert {
    font-size: 1.35rem;
    font-weight: 700;
    color: #92400e;
    margin: 0;
    letter-spacing: -0.01em;
}

.modal-body-alert {
    padding: 24px;
    color: var(--color-text-main);
    line-height: 1.6;
    font-size: 0.95rem;
    overflow-y: auto;
}

.modal-body-alert p {
    margin: 0 0 16px 0;
}

.modal-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

.modal-details-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    margin-bottom: 0;
    border-bottom: 1px dashed var(--color-border);
    gap: 12px;
}

.modal-details-item:last-child {
    border-bottom: none;
}

.modal-details-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.modal-details-success .modal-details-item {
    border-bottom-color: #dcfce7;
}

.modal-details-label {
    font-weight: 500;
    flex-shrink: 0;
}
.modal-details-success .modal-details-label {
    color: #166534;
}

.modal-details-val {
    font-weight: 700;
    color: var(--color-text-main);
    word-break: normal;
    overflow-wrap: anywhere;
    text-align: right;
}
.modal-details-success .modal-details-val {
    color: #14532d;
}

.modal-details-success .modal-details-val.highlight {
    color: #047857;
    font-weight: 800;
}

@media (max-width: 576px) {
    .modal-details-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0;
    }
    .modal-details-val {
        text-align: left;
        width: 100%;
    }
    
    .modal-overlay {
        padding: 0;
    }
    
    .modal-content {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
        display: flex;
        flex-direction: column;
    }
    
    .modal-body-alert {
        flex: 1; /* Allow the body to grow and push the footer to the bottom */
    }
    
    .modal-footer-alert {
        padding: 20px 24px 24px 24px;
    }
}

.modal-footer-alert {
    padding: 18px 24px 24px 24px;
    display: flex;
    gap: 12px;
    background-color: #fafbfc;
    border-top: 1px solid var(--color-border);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScaleUp {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Spinner Animation for loading states */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner-icon {
    animation: spin 0.8s linear infinite;
}

.btn-loading {
    pointer-events: none !important;
    opacity: 0.85 !important;
}
