:root {
    --auth-blue-50: #eff6ff;
    --auth-blue-100: #dbeafe;
    --auth-blue-200: #bfdbfe;
    --auth-blue-500: #3b82f6;
    --auth-blue-600: #2563eb;
    --auth-blue-700: #1d4ed8;
    --auth-blue-800: #1e40af;
    --auth-blue-900: #1e3a8a;
    --auth-cyan-500: #0ea5e9;
    --auth-primary: var(--auth-blue-600);
    --auth-primary-dark: var(--auth-blue-800);
    --auth-primary-light: var(--auth-blue-100);
}

.company-login-body {
    min-height: 100vh;
    background: linear-gradient(145deg, var(--auth-blue-50) 0%, #f0f9ff 45%, #e0f2fe 100%);
}

.company-login-body .btn-primary {
    background: linear-gradient(135deg, var(--auth-blue-600) 0%, var(--auth-blue-700) 100%);
    border-color: var(--auth-blue-700);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.company-login-body .btn-primary:hover,
.company-login-body .btn-primary:focus {
    background: linear-gradient(135deg, var(--auth-blue-700) 0%, var(--auth-blue-800) 100%);
    border-color: var(--auth-blue-800);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.company-login-body .btn-outline-primary {
    color: var(--auth-blue-600);
    border-color: var(--auth-blue-600);
}

.company-login-body .btn-outline-primary:hover {
    background: var(--auth-blue-600);
    border-color: var(--auth-blue-600);
    color: #fff;
}

.company-login-body .text-primary,
.company-login-body a.text-primary {
    color: var(--auth-blue-600) !important;
}

.company-login-body .text-primary:hover {
    color: var(--auth-blue-800) !important;
}

/* Neutral borders + blue focus — override theme green (#6fd943) on pre-login forms */
body.company-login-body .form-control,
body.company-login-body .form-select,
body.company-login-body .custom-select,
body.company-login-body .dataTable-input,
body.company-login-body .dataTable-selector,
body.auth-prelogin-body .form-control,
body.auth-prelogin-body .form-select,
body.auth-prelogin-body .custom-select,
body.auth-prelogin-body .dataTable-input,
body.auth-prelogin-body .dataTable-selector {
    border-color: #ced4da !important;
}

body.company-login-body .form-control:focus,
body.company-login-body .form-select:focus,
body.company-login-body .custom-select:focus,
body.company-login-body .dataTable-input:focus,
body.company-login-body .dataTable-selector:focus,
body.company-login-body .form-check-input:focus,
body.company-login-body[class*="theme-"] .form-control:focus,
body.company-login-body[class*="theme-"] .form-select:focus,
body.auth-prelogin-body .form-control:focus,
body.auth-prelogin-body .form-select:focus,
body.auth-prelogin-body .custom-select:focus,
body.auth-prelogin-body .dataTable-input:focus,
body.auth-prelogin-body .dataTable-selector:focus,
body.auth-prelogin-body .form-check-input:focus,
body.auth-prelogin-body[class*="theme-"] .form-control:focus,
body.auth-prelogin-body[class*="theme-"] .form-select:focus {
    border-color: var(--auth-blue-500) !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2) !important;
    outline: 0 !important;
}

body.company-login-body .form-control.is-valid,
body.company-login-body .was-validated .form-control:valid,
body.company-login-body .form-select.is-valid,
body.company-login-body .was-validated .form-select:valid,
body.auth-prelogin-body .form-control.is-valid,
body.auth-prelogin-body .was-validated .form-control:valid,
body.auth-prelogin-body .form-select.is-valid,
body.auth-prelogin-body .was-validated .form-select:valid {
    border-color: #ced4da !important;
    background-image: none !important;
    padding-right: 0.75rem;
}

body.company-login-body .form-control.is-valid:focus,
body.company-login-body .was-validated .form-control:valid:focus,
body.auth-prelogin-body .form-control.is-valid:focus,
body.auth-prelogin-body .was-validated .form-control:valid:focus {
    border-color: var(--auth-blue-500) !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2) !important;
}

body.company-login-body .input-group > .form-control:focus,
body.auth-prelogin-body .input-group > .form-control:focus {
    border-color: var(--auth-blue-500) !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2) !important;
    z-index: 3;
}

body.company-login-body .input-group:focus-within .input-group-text,
body.auth-prelogin-body .input-group:focus-within .input-group-text {
    border-color: var(--auth-blue-500) !important;
}

body.company-login-body .btn-primary:focus,
body.company-login-body .btn-primary:active:focus,
body.company-login-body .btn-outline-primary:focus,
body.auth-prelogin-body .btn-primary:focus,
body.auth-prelogin-body .btn-primary:active:focus,
body.auth-prelogin-body .btn-outline-primary:focus {
    border-color: var(--auth-blue-700) !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.3) !important;
}

.company-login-wrapper {
    display: flex;
    min-height: 100vh;
}

.company-login-brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    background: linear-gradient(155deg, var(--auth-blue-700) 0%, var(--auth-blue-800) 40%, var(--auth-blue-900) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.company-login-brand::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -15%;
    width: 55%;
    height: 55%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

.company-login-brand::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 45%;
    height: 45%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.company-login-brand > * {
    position: relative;
    z-index: 1;
}

.company-login-logo img {
    max-height: 56px;
    width: auto;
    height: auto;
    margin-bottom: 2rem;
    /* Keep original NID logo colors (yellow) */
    filter: none;
    object-fit: contain;
}

/* Logo on legacy auth layout (customer/vendor login) */
body.auth-prelogin-body .auth-wrapper .navbar-brand img {
    max-height: 48px;
    width: auto;
    filter: none;
    object-fit: contain;
}

.company-login-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.company-login-card {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(30, 64, 175, 0.12);
    border: 1px solid var(--auth-blue-100);
    padding: 2rem;
}

.company-login-footer {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
}

.brand-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.brand-subtitle {
    opacity: 0.92;
    line-height: 1.65;
    margin-bottom: 2rem;
}

.role-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.role-info-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.role-info-list i {
    font-size: 1.25rem;
    margin-top: 0.15rem;
    opacity: 0.95;
    color: #93c5fd;
}

.login-role-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.login-role-tab {
    border: 2px solid var(--auth-blue-100);
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--auth-blue-50);
}

.login-role-tab:hover {
    border-color: var(--auth-blue-500);
    background: #fff;
}

.login-role-tab.active {
    border-color: var(--auth-blue-600);
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 0 0 1px var(--auth-blue-600);
}

.login-role-tab i {
    display: block;
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
    color: var(--auth-blue-600);
}

.login-role-tab .role-tab-label {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    color: #334155;
}

.login-role-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 1.25rem;
    min-height: 2.5rem;
}

.login-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--auth-blue-900);
    margin-bottom: 0.25rem;
}

.login-page-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.super-admin-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8rem;
}

.super-admin-link a {
    color: #64748b !important;
}

.super-admin-link a:hover {
    color: var(--auth-blue-600) !important;
}

/* Verify email */
.verify-email-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--auth-blue-100) 0%, #e0f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--auth-blue-200);
}

.verify-email-icon i {
    font-size: 2rem;
    color: var(--auth-blue-600);
}

.verify-email-address {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    background: var(--auth-blue-50);
    border-radius: 10px;
    border: 1px solid var(--auth-blue-100);
    font-weight: 600;
    color: var(--auth-blue-900);
    word-break: break-all;
}

.verify-email-steps {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--auth-blue-50);
    border-radius: 12px;
    border: 1px solid var(--auth-blue-100);
}

.verify-email-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #475569;
    padding: 0.35rem 0;
}

.verify-email-step-num {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--auth-blue-600), var(--auth-blue-700));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.verify-email-hint {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
}

/* Forgot / reset password */
.auth-forgot-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--auth-blue-100) 0%, #e0f2fe 100%);
    border: 2px solid var(--auth-blue-200);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-forgot-icon i {
    font-size: 1.75rem;
    color: var(--auth-blue-600);
}

.auth-info-box {
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    background: var(--auth-blue-50);
    border: 1px solid var(--auth-blue-100);
    border-radius: 12px;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.55;
}

.auth-info-box.alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: var(--auth-blue-600);
    text-decoration: none;
    margin-bottom: 1rem;
}

.auth-back-link:hover {
    color: var(--auth-blue-800);
}

.auth-divider {
    text-align: center;
    margin: 1.25rem 0;
    font-size: 0.75rem;
    color: #94a3b8;
}

.company-login-body .btn-outline-secondary {
    border-color: #cbd5e1;
    color: #475569;
}

.company-login-body .btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
}

@media (max-width: 991px) {
    .company-login-wrapper {
        flex-direction: column;
    }

    .company-login-brand {
        padding: 2rem 1.5rem;
    }

    .brand-info-desktop {
        display: none;
    }
}

.register-type-tabs {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 480px) {
    .login-role-tabs {
        grid-template-columns: 1fr;
    }

    .register-type-tabs {
        grid-template-columns: 1fr;
    }

    .company-login-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
}

/* Image captcha */
.image-captcha-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
}

.image-captcha-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.image-captcha-img {
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    display: block;
    max-width: 100%;
    height: auto;
}

.image-captcha-refresh {
    padding: 0.4rem 0.55rem;
    line-height: 1;
}

.image-captcha-input {
    min-width: 140px;
    flex: 1;
}

.image-captcha-text {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.company-login-body .image-captcha-text:focus,
body.auth-prelogin-body .image-captcha-text:focus {
    border-color: var(--auth-blue-500) !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2) !important;
}
