* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #f3f4f6;
    min-height: 100vh;
    overflow-x: hidden;
}

.login-root {
    min-height: 100vh;
    display: flex;
    width: 100%;
    background: #f3f4f6;
}

.login-left {
    width: min(38%, 460px);
    min-height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(2rem, 3vw, 3rem) clamp(1.5rem, 3vw, 4rem);
}

.login-left-inner {
    width: 100%;
    max-width: 390px;
}

.brand-wrap {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

.brand-logo {
    display: block;
    width: auto;
    max-width: 220px;
    height: 42px;
    object-fit: contain;
    margin: 0 auto;
}

.login-heading {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a202c;
    line-height: 1.2;
    margin: 0 0 0.5rem;
    text-align: center;
}

.login-subheading {
    font-size: 0.875rem;
    color: #718096;
    margin: 0 0 2rem;
    line-height: 1.5;
    text-align: center;
}

.login-error,
.login-success {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.login-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
}

.login-success {
    background: #eefbf2;
    border: 1px solid rgba(4, 157, 77, 0.45);
    color: #064e3b;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group--last {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.375rem;
}

.form-input {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1a202c;
    background: #fafafa;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-input:focus {
    border-color: #1b1b1b;
    box-shadow: 0 0 0 3px rgba(27, 27, 27, 0.14);
    background: #f9fafb;
}

.form-input::placeholder {
    color: #cbd5e0;
}

.input-pw-wrap {
    position: relative;
}

.input-pw-wrap .form-input {
    padding-right: 2.75rem;
}

.pw-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.btn-auth0 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.8125rem 1.25rem;
    background: #1b1b1b;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
    box-shadow: 0 4px 14px rgba(27, 27, 27, 0.35);
}

.btn-auth0:hover {
    background: #000000;
    color: #6f6f6f;
    box-shadow: 0 6px 20px rgba(27, 27, 27, 0.45);
    transform: translateY(-1px);
}

.btn-auth0:active {
    transform: translateY(0);
}

.btn-auth0 .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-auth0.loading .spinner {
    display: block;
}

.btn-auth0-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6875rem 1.25rem;
    background: transparent;
    color: #4a5568;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-auth0-outline:hover {
    border-color: #1b1b1b;
    color: #6f6f6f;
    background: rgba(27, 27, 27, 0.06);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.login-divider span {
    white-space: nowrap;
    font-size: 0.75rem;
    color: #a0aec0;
}

.security-label {
    font-size: 0.6875rem;
    color: #a0aec0;
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 0.625rem;
}

.security-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.6875rem;
    color: #4a5568;
    font-weight: 500;
}

.badge-icon {
    color: #1b1b1b;
    flex-shrink: 0;
}

.support-link {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #718096;
    text-align: center;
}

.support-link a {
    color: #1b1b1b;
    font-weight: 600;
    text-decoration: none;
}

.support-link a:hover {
    text-decoration: underline;
}

.login-right {
    flex: 1;
    min-height: 100vh;
    background: linear-gradient(145deg, #1b1b1b 0%, #141414 55%, #0d0d0d 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: clamp(2rem, 3.5vw, 4rem) clamp(1.25rem, 4vw, 4.5rem);
    position: relative;
    overflow: hidden;
}

.login-right::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -120px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.login-right::after {
    content: "";
    position: absolute;
    left: -80px;
    bottom: -100px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.right-logo {
    width: 220px;
    margin: 1.5rem auto 2.5rem;
    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.13));
    transition: width 0.2s;
    position: relative;
    z-index: 1;
}

.right-logo--large {
    width: 320px;
    max-width: 90vw;
}

.right-logo--xlarge {
    width: 420px;
    max-width: 98vw;
}

.right-logo--xxlarge {
    width: 600px;
    max-width: 99vw;
}

.login-right .right-logo.right-logo--contabilidad {
    width: min(560px, 90%) !important;
    max-width: 100%;
}

.right-heading {
    font-size: 2.25rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.right-heading--provider {
    font-size: 1.95rem;
}

.right-subheading {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0 0 2.25rem;
    max-width: min(620px, 92vw);
    position: relative;
    z-index: 1;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: min(700px, 100%);
    position: relative;
    z-index: 1;
}

.modules-grid--provider {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
    max-width: min(520px, 100%);
}

.module-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-height: 124px;
    cursor: default;
    transition: background 0.18s ease, transform 0.15s ease, border-color 0.18s ease;
}

.module-card:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.module-card--provider {
    text-align: left;
    align-items: flex-start;
}

.module-card--provider .module-icon {
    margin-bottom: 0.35rem;
}

.provider-badge {
    margin-bottom: 1rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    font-weight: 700;
}

.module-icon {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 0.125rem;
}

.module-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(100%);
}

.module-name {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.module-desc {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.right-footer {
    font-size: 0.75rem;
    color: #ffffff;
    margin-top: 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1200px) {
    .login-left {
        width: min(42%, 430px);
    }

    .modules-grid {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
        max-width: 620px;
    }
}

@media (max-width: 992px) {
    .login-root {
        flex-direction: column;
    }

    .login-left {
        width: 100%;
        min-height: auto;
        padding: 2.5rem 1.5rem;
    }

    .login-left-inner {
        max-width: 520px;
    }

    .login-right {
        min-height: auto;
        padding: 3rem 1.5rem 4rem;
    }

    .login-right .right-logo.right-logo--contabilidad {
        width: min(520px, 92vw) !important;
        margin-bottom: 2rem;
    }

    .right-heading {
        font-size: 1.75rem;
    }

    .right-heading--provider {
        font-size: 1.6rem;
    }

    .modules-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        max-width: 560px;
    }

    .modules-grid--provider {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        max-width: 520px;
    }

    .right-footer {
        margin-top: 1.5rem;
    }
}

@media (max-width: 768px) {
    .login-left {
        padding: 2rem 1rem;
    }

    .login-right {
        padding: 2.25rem 1rem 3rem;
    }

    .login-heading {
        font-size: 1.5rem;
    }

    .right-subheading {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }

    .modules-grid {
        max-width: 460px;
    }
}

@media (max-width: 560px) {
    .security-row {
        flex-wrap: wrap;
        gap: 0.65rem;
    }

    .modules-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .modules-grid--provider {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .login-right .right-logo.right-logo--contabilidad {
        width: min(460px, 96vw) !important;
    }
}

/* ── MODAL CANALES DE ATENCIÓN (SOPORTE) ─────────────────────────── */
.modal-soporte-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999999 !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeInModal 0.2s ease-out;
}

.modal-soporte-backdrop.open {
    display: flex !important;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUpModal {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}

.modal-soporte-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 36px 32px 32px 32px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.04);
    position: relative;
    box-sizing: border-box;
    animation: scaleUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-soporte-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease;
}

.modal-soporte-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.modal-soporte-header {
    text-align: center;
    margin-bottom: 26px;
}

.modal-soporte-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
}

.modal-soporte-logo {
    height: 58px;
    max-width: 320px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
}

.modal-soporte-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.modal-soporte-subtitle {
    font-size: 0.92rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.modal-soporte-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-soporte-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #ffffff;
    border: 1.5px solid #eef2f6;
    border-radius: 18px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.modal-soporte-item:hover {
    border-color: #1b1b1b;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(27, 27, 27, 0.12);
}

.modal-soporte-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(27, 27, 27, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.modal-soporte-item:hover .modal-soporte-icon-box {
    background: #1b1b1b;
}

.modal-soporte-item:hover .modal-soporte-icon-box svg {
    stroke: #ffffff;
}

.modal-soporte-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.modal-soporte-item-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.modal-soporte-item-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE STYLES FOR AUTH & LOGIN MODULES
   ========================================================================== */
@media (max-width: 900px) {
    .login-root {
        flex-direction: column;
        min-height: 100vh;
    }

    .login-left {
        width: 100%;
        min-height: auto;
        padding: 2.25rem 1.25rem;
    }

    .login-left-inner {
        max-width: 100%;
    }

    .brand-wrap {
        margin-bottom: 1.5rem;
    }

    .brand-logo {
        max-width: 210px;
        height: 50px;
    }

    .login-heading {
        font-size: 1.45rem;
    }

    .login-subheading {
        font-size: 0.82rem;
        margin-bottom: 1.5rem;
    }

    .login-right {
        width: 100%;
        min-height: auto;
        padding: 2.5rem 1.25rem;
    }

    .right-logo {
        max-width: 240px;
        margin-bottom: 1.5rem;
    }

    .right-heading {
        font-size: 1.3rem;
    }

    .right-subheading {
        font-size: 0.85rem;
        max-width: 100%;
    }

    .modules-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .security-row {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .modal-soporte-card,
    .modal-card {
        width: 94vw !important;
        max-width: 94vw !important;
        padding: 18px !important;
        margin: 16px auto !important;
    }
}