/* Factura Libre Portal Styles - Enhanced Version */

/* Main Layout */
body {
    font-family: 'Gotham Rounded', 'Gotham', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-weight: 700;
}

.main-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #370650, #4a0866, #5b0a7a);
    position: relative;
    overflow: hidden;
}

.main-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(0, 123, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='m36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.4;
}

.portal-container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.portal-content {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 60px;
    align-items: center;
}

/* Logo and Branding Section */
.brand-section {
    color: white;
    text-align: left;
}

.main-logo {
    width: 320px;
    height: auto;
    margin-bottom: 10px;
    filter: brightness(0) saturate(100%) invert(1);
    /* Esto convierte cualquier imagen a blanco */
}

.brand-title {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Gotham', sans-serif;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff, #e9ecef);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    font-family: 'Gotham Rounded', sans-serif;
    margin-bottom: 30px;
    color: #ffffff;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-features {
    list-style: none;
    padding: 20px;
    margin: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-features li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 1rem;
    font-family: 'Gotham Rounded', sans-serif;
}

.brand-features li i {
    color: #28a745;
    margin-right: 15px;
    font-size: 1.2rem;
}

/* Form Card */
.form-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-logo {
    width: 140px;
    height: auto;
    margin: 0 auto 30px auto;
    display: block;
}

/* Progress Wizard Styles */
.wizard-progress {
    margin-bottom: 40px;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 40px;
    padding: 0 10px;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 15%;
    right: 15%;
    height: 3px;
    background: linear-gradient(to right, #e9ecef 0%, #e9ecef 100%);
    border-radius: 2px;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background: white;
    padding: 8px;
    min-width: 80px;
    border-radius: 12px;
}

.step i {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f8f9fa;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.step span {
    font-size: 11px;
    color: #6c757d;
    text-align: center;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.2;
}

.step.active i {
    background: linear-gradient(135deg, #76288f, #8e34a3);
    color: white;
    border-color: #76288f;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(118, 40, 143, 0.3);
}

.step.active span {
    color: #76288f;
    font-weight: 700;
}

.step.completed i {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-color: #28a745;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.3);
}

.step.completed span {
    color: #28a745;
    font-weight: 700;
}

/* Form Styles */
.wizard-step {
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Gotham', sans-serif;
    color: #212529;
    margin-bottom: 8px;
    text-align: center;
}

.step-description {
    color: #6c757d;
    margin-bottom: 30px;
    text-align: center;
    font-size: 0.95rem;
    font-family: 'Gotham Rounded', sans-serif;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-family: 'Gotham', sans-serif;
    color: #495057;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #76288f;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff;
    color: #495057;
    box-sizing: border-box;
}

.form-control::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.form-control:focus {
    border-color: #76288f;
    box-shadow: 0 0 0 4px rgba(118, 40, 143, 0.1);
    outline: none;
    background-color: #ffffff;
}

.form-control:valid:not(:placeholder-shown) {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2328a745'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* Custom Select Styling */
.custom-select {
    position: relative;
}

.custom-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23495057'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 24px;
    padding-right: 48px;
    cursor: pointer;
}

.custom-select select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23212529'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

/* Button Styles */
.btn {
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Gotham', sans-serif;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #76288f, #8e34a3);
    color: white;
    border-color: #76288f;
    box-shadow: 0 4px 16px rgba(118, 40, 143, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5e1e70, #76288f);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(118, 40, 143, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(118, 40, 143, 0.3);
}

.btn-secondary {
    background: white;
    color: #6c757d;
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: #f8f9fa;
    color: #495057;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-block {
    width: 100%;
    display: block;
}

/* Loading Spinner */
.loading-container {
    text-align: center;
    padding: 60px 20px;
}

.modern-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    border: 4px solid #f3f3f4;
    border-top: 4px solid #76288f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-title {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Gotham', sans-serif;
    color: #212529;
    margin-bottom: 12px;
}

.loading-description {
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 1rem;
    font-family: 'Gotham Rounded', sans-serif;
}

.validation-status {
    margin-top: 30px;
    text-align: left;
}

.status-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
}

.status-item i {
    margin-right: 10px;
    width: 20px;
}

/* Logo Upload Styles */
.logo-upload {
    margin-bottom: 20px;
}

.upload-area {
    border: 2px dashed #e5e6e7;
    border-radius: 4px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.upload-area:hover {
    border-color: #1ab394;
    background-color: #f0fffe;
}

.upload-area i {
    font-size: 48px;
    color: #a7b1c2;
    margin-bottom: 15px;
}

.upload-area p {
    margin: 0;
    color: #676a6c;
    font-size: 14px;
}

.logo-preview {
    margin-top: 15px;
    text-align: center;
}

.logo-preview img {
    max-width: 200px;
    max-height: 100px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Success/Confirmation Styles */
.success-icon i {
    font-size: 72px;
    color: #1ab394;
    margin-bottom: 20px;
}

.registration-status {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f8f9;
    border-radius: 4px;
}

.status-progress {
    background-color: #e5e6e7;
    border-radius: 10px;
    height: 20px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(45deg, #1ab394, #18a085);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.status-text {
    margin: 0;
    font-size: 14px;
    color: #676a6c;
    font-weight: 500;
}

/* Alert Styles */
.alert {
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: #fcf8e3;
    border-color: #faebcc;
    color: #8a6d3b;
}

.alert-success {
    background-color: #dff0d8;
    border-color: #d6e9c6;
    color: #3c763d;
}

/* Checkbox Styles */
.i-checks {
    margin: 15px 0;
}

.i-checks label {
    display: flex;
    align-items: flex-start;
    font-size: 14px;
    color: #676a6c;
    cursor: pointer;
}

.i-checks input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .step-indicator {
        flex-wrap: wrap;
        gap: 10px;
    }

    .step {
        min-width: 60px;
    }

    .step span {
        font-size: 10px;
    }

    .step i {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .loginColumns {
        padding: 10px;
    }

    .ibox-content {
        padding: 20px;
    }

    .upload-area {
        padding: 20px;
    }
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.col-8 {
    flex: 0 0 calc(66.666667% - 10.67px);
}

.col-4 {
    flex: 0 0 calc(33.333333% - 5.33px);
}

@media (max-width: 768px) {
    .row {
        gap: 12px;
    }

    .col-8,
    .col-4 {
        flex: 1 1 100%;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-success { color: #28a745 !important; }
.text-muted { color: #6c757d; }
.font-bold { font-weight: 700; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }

/* Verification Code Input */
.verification-input {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5rem;
    font-family: 'Courier New', monospace;
}

/* Footer */
.footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Hide scrollbar but keep functionality */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Electronic Signature Info Section */
.electronic-signature-info {
    margin-top: 40px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 16px;
    border: 2px solid #e9ecef;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: fadeInScale 0.6s ease-out 0.3s both;
}

.electronic-signature-info .info-icon {
    margin-bottom: 15px;
}

.electronic-signature-info .info-icon i {
    font-size: 48px;
    color: #76288f;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.electronic-signature-info .info-title {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Gotham', sans-serif;
    color: #212529;
    margin-bottom: 12px;
    line-height: 1.3;
}

.electronic-signature-info .info-message {
    font-size: 0.95rem;
    font-family: 'Gotham Rounded', sans-serif;
    color: #495057;
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
}

/* Portal Access Section */
.portal-access-section {
    margin-top: 30px;
    animation: fadeInScale 0.6s ease-out 0.5s both;
}

.btn-portal {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #28a745;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.3);
    font-size: 1.1rem;
    padding: 16px 32px;
    position: relative;
    overflow: hidden;
}

.btn-portal:hover {
    background: linear-gradient(135deg, #218838, #1a9f78);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-portal:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

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

/* Success Container Improvements */
.success-container {
    padding: 20px;
}

.success-title {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Gotham', sans-serif;
    color: #212529;
    margin-bottom: 12px;
    text-align: center;
}

.success-message {
    font-size: 1.1rem;
    font-family: 'Gotham Rounded', sans-serif;
    color: #495057;
    text-align: center;
    margin-bottom: 8px;
}

.success-submessage {
    font-size: 0.95rem;
    font-family: 'Gotham Rounded', sans-serif;
    color: #6c757d;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 400;
}

/* Responsive adjustments for new elements */
@media (max-width: 768px) {
    .electronic-signature-info {
        padding: 20px;
        margin-top: 30px;
    }

    .electronic-signature-info .info-icon i {
        font-size: 40px;
    }

    .electronic-signature-info .info-title {
        font-size: 1.1rem;
    }

    .electronic-signature-info .info-message {
        font-size: 0.9rem;
    }

    .btn-portal {
        font-size: 1rem;
        padding: 14px 28px;
    }

    .success-title {
        font-size: 1.6rem;
    }

    .success-message {
        font-size: 1rem;
    }

    .success-submessage {
        font-size: 0.9rem;
    }

    .portal-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .brand-section {
        text-align: center;
    }

    .main-logo {
        width: 220px;
    }
}

/* International Phone Input Customization */
.iti {
    width: 100% !important;
    display: block !important;
    position: relative !important;
}

.iti__flag-container {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    right: auto !important;
    left: 0 !important;
    padding: 0 !important;
    z-index: 2 !important;
}

.iti__selected-flag {
    padding: 0 0 0 14px !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    background-color: transparent !important;
    border-right: 2px solid #76288f !important;
    transition: all 0.3s ease !important;
    border: none !important;
    outline: none !important;
}

.iti__selected-flag:hover {
    background-color: rgba(118, 40, 143, 0.05) !important;
}

.iti--allow-dropdown input.form-control,
.iti--allow-dropdown input[type="tel"] {
    padding-left: 95px !important;
}

.iti input.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #76288f;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff;
    color: #495057;
}

.iti input.form-control:focus {
    border-color: #76288f;
    box-shadow: 0 0 0 4px rgba(118, 40, 143, 0.1);
    outline: none;
}

.iti__country-list {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 2px solid #76288f;
    max-height: 250px;
    margin-top: 4px;
    background-color: #ffffff;
}

.iti__country {
    padding: 10px 14px;
    transition: background-color 0.2s ease;
}

.iti__country:hover {
    background-color: rgba(118, 40, 143, 0.1);
}

.iti__country.iti__highlight {
    background-color: rgba(118, 40, 143, 0.15);
}

.iti__country-name {
    margin-right: 10px;
    font-family: 'Gotham Rounded', sans-serif;
}

.iti__dial-code {
    color: #76288f;
    font-weight: 600;
    font-family: 'Gotham', sans-serif;
}

.iti__selected-dial-code {
    margin-left: 8px;
    color: #76288f;
    font-weight: 700;
    font-family: 'Gotham', sans-serif;
}

.iti__arrow {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #76288f;
    margin-left: 8px;
}

.iti__flag {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Phone input error state */
.iti.iti--error input.form-control {
    border-color: #dc3545;
}

.iti.iti--error input.form-control:focus {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

/* Phone input valid state */
.iti.iti--valid input.form-control {
    border-color: #28a745;
}

/* Responsive adjustments for phone input */
@media (max-width: 768px) {
    .iti__country-list {
        max-height: 200px;
        font-size: 14px;
    }

    .iti--allow-dropdown input.form-control,
    .iti--allow-dropdown input[type="tel"] {
        padding-left: 85px !important;
    }

    .iti__selected-flag {
        padding: 0 0 0 10px;
    }
}