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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: #000;
    min-height: 100vh;
    overflow-x: hidden;
}

.main-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 4rem;
    flex-wrap: wrap;
}

/* Sección de imagen */
.image-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0e12;
    z-index: 0;
    overflow: hidden;
}

#auth-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    z-index: 1;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.8) 100%);
    z-index: 2;
    pointer-events: none;
}

.image-content {
    z-index: 2;
    text-align: center;
    max-width: 500px;
    padding: 2rem;
    animation: slideInLeft 0.8s ease-out;
}

.image-content h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: #fff;
}

.container-3d-wrapper {
    perspective: 1200px;
    display: inline-block;
    width: 60px;
    height: 48px;
    vertical-align: middle;
    transform: scale(1.6);
    transform-origin: center center;
    margin-left: 0; /* Reiniciado para usar el gap */
    margin-bottom: 5px;
}

.container-3d {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-15deg) rotateY(25deg);
}

.container-3d .face {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1d9bf0;
    /* Efecto corrugado de contenedor de carga */
    background: repeating-linear-gradient(90deg, rgba(29, 155, 240, 0.1), rgba(29, 155, 240, 0.1) 4px, rgba(0, 0, 0, 0.6) 4px, rgba(0, 0, 0, 0.6) 8px);
    box-shadow: inset 0 0 10px rgba(29, 155, 240, 0.3);
}

.container-3d .front, .container-3d .back { width: 60px; height: 48px; }
.container-3d .right, .container-3d .left { width: 32px; height: 48px; }
.container-3d .top, .container-3d .bottom { width: 60px; height: 32px; background: #0a0e12; border: 2px solid #1d9bf0; }

.container-3d .front  { transform: translate(-50%, -50%) translateZ(16px); }
.container-3d .back   { transform: translate(-50%, -50%) rotateY(180deg) translateZ(16px); }
.container-3d .right  { transform: translate(-50%, -50%) rotateY(90deg) translateZ(30px); }
.container-3d .left   { transform: translate(-50%, -50%) rotateY(-90deg) translateZ(30px); }
.container-3d .top    { transform: translate(-50%, -50%) rotateX(90deg) translateZ(24px); }
.container-3d .bottom { transform: translate(-50%, -50%) rotateX(-90deg) translateZ(24px); }

.ia-text {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 8px #1d9bf0;
}

.image-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
}

.features-list {
    text-align: left;
}

.features-list .feature {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.features-list .feature i {
    color: #1d9bf0;
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.brand-column {
    flex: 0 1 450px;
    min-width: 320px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 0;
}

.main-logo {
    animation: float 6s ease-in-out infinite;
    border-radius: 16px;
    max-height: 180px !important;
    background-color: transparent;
}

.company-logo-wrapper {
    width: 180px;
    height: 180px;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.15);
    margin: 0 auto;
    animation: float 6s ease-in-out infinite;
    padding: 15px; /* Crea un marco interior blanco para el logo */
}

.company-custom-logo {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ajusta el logo rectangular completo dentro del círculo sin recortar */
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.form-column {
    flex: 0 1 480px; /* Tamaño máximo idéntico al login */
    min-width: 320px;
    z-index: 10;
    display: flex;
    justify-content: center;
}

.glass-card {
    background: rgba(15, 20, 25, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2.5rem 2.5rem;
    width: 100%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    max-height: 90vh;
    overflow-y: auto;
}

.glass-card::-webkit-scrollbar {
    width: 8px;
}
.glass-card::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2); 
    border-radius: 8px;
}
.glass-card::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1); 
    border-radius: 8px;
}

/* Sección del formulario (mantener soporte a legado) */
.form-section {
    position: relative;
    z-index: 10;
}

.brand-title {
    font-size: 4rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Separación pedida */
    line-height: 1;
}

.brand-subtitle {
    font-size: 1.25rem;
    color: #8899a6;
    margin-top: 1rem;
}

.logo-icon {
    color: #1d9bf0;
    background: rgba(29, 155, 240, 0.1);
    padding: 1rem;
    border-radius: 50%;
}

.form-wrapper {
    max-width: 500px;
    margin: 0 auto;
    animation: slideInRight 0.8s ease-out;
}

.header-section {
    text-align: center;
    margin-bottom: 2rem;
}

.header-section i {
    font-size: 2.5rem;
    color: #1d9bf0;
    margin-bottom: 1rem;
}

.header-section h2 {
    color: #e7e9ea;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header-section p {
    color: #71767b;
    font-size: 1rem;
}

.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #16181c;
    border: 2px solid #536471;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #71767b;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.3s;
}

.progress-step.active {
    background: #1d9bf0;
    border-color: #1d9bf0;
    color: #000;
}

.progress-step.completed {
    background: #00ba7c;
    border-color: #00ba7c;
    color: #fff;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -32px;
    transform: translateY(-50%);
    width: 24px;
    height: 2px;
    background: #536471;
    transition: all 0.3s;
}

.progress-step.completed:not(:last-child)::after {
    background: #00ba7c;
}

.progress-step+.progress-step {
    margin-left: 50px;
}

.form-section-content {
    background: rgba(22, 24, 28, 0.5);
    border: 1px solid #2f3336;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header i {
    color: #1d9bf0;
    font-size: 1.3rem;
    margin-right: 0.75rem;
}

.section-header h3 {
    color: #e7e9ea;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    flex: 1;
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.3rem;
    color: #e7e9ea;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-label.required::after {
    content: '*';
    color: #f4212e;
    margin-left: 0.25rem;
}

.form-control,
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: #16181c;
    border: 1px solid #333639;
    color: #e7e9ea;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: #1d9bf0;
    box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.2);
    background: #000;
    color: #e7e9ea;
}

.form-control::placeholder {
    color: #71767b;
}

.form-control.is-valid {
    border-color: #00ba7c;
}

.form-control.is-invalid {
    border-color: #f4212e;
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #71767b;
    cursor: pointer;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #e7e9ea;
}

.file-upload-area {
    border: 2px dashed #536471;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(22, 24, 28, 0.3);
}

.file-upload-area:hover {
    border-color: #1d9bf0;
    background: rgba(29, 155, 240, 0.05);
}

.file-upload-area.dragover {
    border-color: #1d9bf0;
    background: rgba(29, 155, 240, 0.1);
    transform: scale(1.02);
}

.file-upload-icon {
    font-size: 2.5rem;
    color: #1d9bf0;
    margin-bottom: 1rem;
}

.file-upload-text {
    color: #e7e9ea;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.file-upload-subtext {
    color: #71767b;
    font-size: 0.9rem;
}

.file-info {
    display: none;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(0, 186, 124, 0.1);
    border: 1px solid rgba(0, 186, 124, 0.3);
    border-radius: 6px;
    color: #00ba7c;
}

.file-info.show {
    display: flex;
    align-items: center;
}

.file-info i {
    margin-right: 0.5rem;
}

.password-requirements {
    background: rgba(29, 155, 240, 0.05);
    border: 1px solid rgba(29, 155, 240, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.password-requirements h6 {
    color: #1d9bf0;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.password-requirements ul {
    margin: 0;
    padding-left: 1.2rem;
    color: #e7e9ea;
    font-size: 0.85rem;
}

.password-requirements li {
    margin-bottom: 0.25rem;
    opacity: 0.8;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    width: 100%;
    padding: 12px 24px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary:hover:not(:disabled) {
    background: #1a8cd8;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: #e7e9ea;
    border: 1px solid #536471;
    border-radius: 50px;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.btn-secondary:hover {
    background: rgba(231, 233, 234, 0.1);
    border-color: #71767b;
}

.login-link {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #2f3336;
}

.login-link p {
    color: #71767b;
    margin-bottom: 0.5rem;
}

.login-link a {
    color: #1d9bf0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.login-link a:hover {
    color: #1a8cd8;
    text-decoration: underline;
}

.alert {
    background: #1a1d23;
    border: 1px solid #fd4d4d;
    border-radius: 6px;
    color: #f4212e;
    padding: 12px 16px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(0, 186, 124, 0.1);
    border-color: #00ba7c;
    color: #00ba7c;
}

.form-text {
    color: #71767b;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}
/* Responsive */
@media (max-width: 768px) {
    .glass-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .form-wrapper {
        max-width: 100%;
    }

    .header-section {
        margin-bottom: 1.5rem;
    }

    .header-section h2 {
        font-size: 1.75rem;
    }

    .progress-step {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }

    .progress-step+.progress-step {
        margin-left: 35px;
    }

    .progress-step:not(:last-child)::after {
        right: -22px;
        width: 12px;
    }

    .form-section-content {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .section-header h3 {
        font-size: 1.2rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-control,
    .form-select {
        padding: 14px;
        font-size: 16px;
    }

    .password-toggle {
        right: 14px;
    }

    .file-upload-area {
        padding: 1.5rem;
    }

    .file-upload-icon {
        font-size: 2rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 14px 24px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 1rem 0.75rem;
        width: 100%;
    }

    .file-upload-icon {
        font-size: 1.8rem;
        margin-bottom: 0.75rem;
    }

    .file-upload-text {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    .file-upload-subtext {
        font-size: 0.8rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .login-link {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    .login-link p {
        font-size: 0.9rem;
    }

    .alert {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .image-content {
        padding: 1rem;
    }

    .image-content h1 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .image-content p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        line-height: 1.4;
    }

    .features-list .feature {
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    .glass-card {
        padding: 0.75rem 0.5rem;
    }

    .header-section h2 {
        font-size: 1.4rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .image-section {
        background-size: cover;
        background-position: center;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .file-upload-area:hover {
        border-color: #536471;
        background: rgba(22, 24, 28, 0.3);
    }

    .file-upload-area:active {
        border-color: #1d9bf0;
        background: rgba(29, 155, 240, 0.05);
    }

    .btn-primary:hover {
        background: #1d9bf0;
        transform: none;
    }

    .btn-primary:active {
        background: #1a8cd8;
    }

    .btn-secondary:hover {
        background: transparent;
        border-color: #536471;
    }

    .btn-secondary:active {
        background: rgba(231, 233, 234, 0.1);
    }

    .password-toggle:hover {
        color: #71767b;
    }

    .password-toggle:active {
        color: #e7e9ea;
    }
}

/* Print styles */
@media print {
    .image-section {
        display: none;
    }

    .form-section {
        background: white;
        color: black;
    }

    .form-section-content {
        border: 1px solid #ccc;
        background: white;
    }
}

/* Reduce motion for users with vestibular disorders */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .file-upload-area.dragover {
        transform: none;
    }
}

/* ═════════════════════════════════════════════════════════════════
   RUC CONSULTATION RESULTS (PREMIUM LOOK)
   ═════════════════════════════════════════════════════════════════ */
#rucResult {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fadeInDownRuc 0.4s ease-out;
}

.ruc-result {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-top: 0.75rem;
    display: none;
    line-height: 1.5;
    border: 1px solid transparent;
}

.ruc-result-success {
    display: block;
    background: rgba(0, 186, 124, 0.1);
    border-color: rgba(0, 186, 124, 0.2);
    color: #00ba7c;
}

.ruc-result-error {
    display: block !important;
    background: rgba(244, 33, 46, 0.1) !important;
    border-color: rgba(244, 33, 46, 0.2) !important;
    color: #f4212e !important;
    font-weight: 600;
}

.ruc-company {
    display: block;
    font-weight: 700;
    margin-bottom: 2px;
}

.ruc-address {
    font-size: 0.8rem;
    opacity: 0.8;
}

.ruc-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 5px;
}

.ruc-status-activo { background: #00ba7c; color: #000; }
.ruc-status-baja { background: #f4212e; color: #fff; }

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