.fi-modal.dark {
    background-color: #111418;
}

.fi-auth-layout {
    overflow-x: hidden;
}

/* Custom styles for threads table - Critical severity rows */
.fi-ta-table-row-critical, .danger-content:has(.danger-background) {
    background-color: rgba(239, 68, 68, 0.06) !important;
}

.dark .fi-ta-table-row-critical, .dark .danger-content:has(.danger-background) {
    background-color: rgba(96, 28, 28, 0.2) !important;
}

/* Ensure the background applies to all cells in the row */
.fi-ta-table-row-critical > td {
    background-color: inherit !important;
}

.thread-header-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0;
}

.thread-header-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.thread-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgb(17, 24, 39);
    margin: 0;
    line-height: 1.2;
}

.dark .thread-header-title {
    color: rgb(255, 255, 255);
}

.thread-header-updated {
    font-size: 0.875rem;
    color: rgb(107, 114, 128);
    margin: 0;
}

.dark .thread-header-updated {
    color: rgb(156, 163, 175);
}

.thread-header-buttons {
    font-weight: bolder;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
}

.fi-in-entry-label, .fi-fieldset > legend {
    font-weight: bold !important;
    font-size: 14px !important;
}

.w-full {
    width: 100% !important;
}

.fi-simple-page-content {
    padding-right: 1rem;
    padding-left: 1rem;
}

/* Center logo in header */
.fi-simple-header-logo-wrapper, .fi-simple-header-heading {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.fi-simple-header-heading {
    font-size: 32px;
    margin-top: 32px;
    margin-bottom: 32px;
}

/* Hide signin heading on OTP page */
.fi-simple-header-heading:has(+ * .otp-input-container),
body:has(.otp-input-container) .fi-simple-header-heading {
    display: none !important;
}

.fi-simple-header-logo-wrapper .fi-logo {
    height: 4rem !important;
    margin: 0;
}

.fi-simple-page-content {
    row-gap: unset;

    button {
        font-weight: 500;
    }
}

/* Registration section on login page */
.fi-login-register-section {
    padding-top: 2rem;
}

.dark .fi-login-register-section {
    border-top: unset;
}

.fi-login-register-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.fi-login-register-divider::before,
.fi-login-register-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--gray-900);
}

.dark .fi-login-register-divider::before,
.dark .fi-login-register-divider::after {
    background-color: var(--gray-700);
}

.fi-login-register-divider-text {
    padding: 0 1rem;
    color: var(--gray-900);
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
}

.dark .fi-login-register-divider-text {
    color: var(--gray-50);
}

/* Vulnerability cards styling */
.vulnerability-card {
    display: flex;
    gap: .5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(234, 179, 8, 0.5);
    background-color: rgba(234, 179, 8, 0.1);
    margin-bottom: 0.75rem;
}

.dark .vulnerability-card {
    background-color: #161b22;
}

.vulnerability-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.vulnerability-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: rgb(234, 179, 8);
}

.dark .vulnerability-icon svg {
    color: rgb(250, 204, 21);
}

.vulnerability-content {
    flex: 1;
    min-width: 0;
}

.vulnerability-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding-left: 4px;
    color: rgb(202, 138, 4);
}

.dark .vulnerability-badge {
    background-color: rgba(234, 179, 8, 0.3);
    color: rgb(253, 224, 71);
}

.vulnerability-description {
    font-size: 0.875rem;
    color: rgb(55, 65, 81);
    line-height: 1.625;
}

.dark .vulnerability-description {
    color: rgb(209, 213, 219);
}

.vulnerabilities-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.domain-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.domain-header-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.domain-header-label-icon {
    width: 1rem;
    height: 1rem;
    color: rgb(156, 163, 175);
}

.dark .domain-header-label-icon {
    color: rgb(209, 213, 219);
}

.domain-header-label-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgb(156, 163, 175);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark .domain-header-label-text {
    color: rgb(209, 213, 219);
}

.domain-header-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.domain-header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Style Actions component to appear in header bottom-right */
.domain-header-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: -3.5rem;
    margin-bottom: 1rem;
}

.domain-header-actions-right {
    float: right;
    justify-content: flex-end !important;
    margin-left: auto !important;
}

.domain-header-actions .fi-ac-action {
    margin-left: auto;
}

.domain-header-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Password field styling */
.password-field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.password-field-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(55, 65, 81);
    margin-bottom: 0.25rem;
}

.dark .password-field-label {
    color: rgb(209, 213, 219);
}

.password-label-icon {
    width: 1rem;
    height: 1rem;
    color: rgb(107, 114, 128);
}

.dark .password-label-icon {
    color: rgb(156, 163, 175);
}

.password-not-found {
    color: rgb(107, 114, 128);
    font-size: 0.875rem;
    font-style: italic;
}

.dark .password-not-found {
    color: rgb(156, 163, 175);
}

.password-field-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: rgb(249, 250, 251);
    border: 1px solid rgb(229, 231, 235);
    border-radius: 0.375rem;
    min-height: 2.5rem;
}

.dark .password-field-content {
    background-color: rgb(31, 41, 55);
    border-color: rgb(55, 65, 81);
}

.password-masked,
.password-visible {
    font-size: 0.875rem;
    color: rgb(17, 24, 39);
    flex: 1;
    min-width: 0;
}

.dark .password-masked,
.dark .password-visible {
    color: rgb(243, 244, 246);
}

.password-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    color: rgb(107, 114, 128);
    background-color: transparent;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
}

.password-toggle-btn:hover {
    color: rgb(55, 65, 81);
    background-color: rgb(243, 244, 246);
}

.dark .password-toggle-btn {
    color: rgb(156, 163, 175);
}

.dark .password-toggle-btn:hover {
    color: rgb(209, 213, 219);
    background-color: rgb(55, 65, 81);
}

.password-eye-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* External Attack Monitoring modal close button */
.external-attack-monitoring-modal-close-btn {
    margin-top: .5rem;
    margin-right: .5rem;
}

/* Toggle filter styling - applies to both relevant_to_me and under_control */
.threats-table .fi-sc-component:has([id="tableFiltersForm.relevant_to_me"]),
.leaks-table .fi-sc-component:has([id="tableFiltersForm.status"]),
.threats-table .fi-sc-component:has([id="tableFiltersForm.under_control"]) {
    align-items: flex-end;
    display: grid;
}

.threats-table [id="tableFiltersForm.relevant_to_me"],
.threats-table [id="tableFiltersForm.under_control"] {
    border: 1px solid #ef4444;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: rgb(228 48 117 / 12%);
}

.dark .threats-table [id="tableFiltersForm.relevant_to_me"]
{
    background-color: rgb(35 22 27);
}

.threats-table [id="tableFiltersForm.under_control"] {
    border: 1px solid var(--success-400);
    background-color: var(--success-100);
}

.dark .threats-table [id="tableFiltersForm.under_control"] {
    border: 1px solid var(--success-500);
    background-color: rgb(68, 81, 24);
}

/* Ensure the inner grid container also has the border styling */
.threats-table [id="tableFiltersForm.relevant_to_me"] > .fi-sc.fi-grid,
.threats-table [id="tableFiltersForm.under_control"] > .fi-sc.fi-grid {
    border: none !important;
    padding: 0 !important;
    gap: 0.75rem !important;
}

/* Style the field wrapper to ensure proper layout */
.threats-table [id="tableFiltersForm.relevant_to_me"] .fi-fo-field,
.threats-table [id="tableFiltersForm.under_control"] .fi-fo-field {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

/* Label text styling */
.threats-table [id="tableFiltersForm.relevant_to_me"] .fi-fo-field-label-content,
.threats-table [id="tableFiltersForm.under_control"] .fi-fo-field-label-content {
    font-weight: 600 !important;
}

.fi-auth-layout.media-left .fi-auth-content-section,
.fi-auth-layout.media-right .fi-auth-content-section {
    background: linear-gradient(180deg, #f0f7f4 0, #8DC63F 219%);
}

.dark .fi-auth-layout.media-left .fi-auth-content-section,
.dark .fi-auth-layout.media-right .fi-auth-content-section {
    background: linear-gradient(184deg, #101722 0, rgb(10 32 25) 71%)
}

.login-overlay-text {
    position: absolute;
    bottom: 5%;
    color: white;
    font-size: 42px;
}

span.fi-badge.\32 xl {
    font-size: 16px;
}

/* OTP Input Styling */
.otp-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.otp-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(55, 65, 81);
    text-align: center;
    margin-bottom: 0.5rem;
}

.dark .otp-label {
    color: rgb(209, 213, 219);
}

.otp-input-wrapper {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.otp-resend-code {
    margin-bottom: .5rem;
    color: var(--gray-400);
    margin-left: auto;
    padding-right: 0.75rem;
    font-size: 14px;
    cursor: pointer;
}

.otp-input {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: rgb(17, 24, 39);
    background-color: rgb(255, 255, 255);
    border: 1.5px solid rgb(229, 231, 235);
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    outline: none;
}

.dark .otp-input {
    background-color: rgb(31, 41, 55);
    border-color: rgb(55, 65, 81);
    color: rgb(243, 244, 246);
}

.otp-input:focus {
    border-color: rgb(8, 73, 41);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(8, 73, 41, 0.1);
    background-color: rgb(255, 255, 255);
}

.dark .otp-input:focus {
    border-color: rgb(95, 131, 57);
    box-shadow: 0 0 0 3px rgba(95, 131, 57, 0.2);
    background-color: rgb(31, 41, 55);
}

.otp-input:not(:placeholder-shown) {
    background-color: rgb(255, 255, 255);
    border-color: rgb(8, 73, 41);
}

.dark .otp-input:not(:placeholder-shown) {
    background-color: rgb(31, 41, 55);
    border-color: rgb(95, 131, 57);
}

/* Remove number input arrows */
.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp-input[type=number] {
    -moz-appearance: textfield;
}

.otp-error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: rgb(254, 242, 242);
    border: 1px solid rgb(239, 68, 68);
    border-radius: 0.5rem;
    color: rgb(185, 28, 28);
    font-size: 0.875rem;
}

.dark .otp-error-message {
    background-color: rgb(31, 41, 55);
    border-color: rgb(220, 38, 38);
    color: rgb(248, 113, 113);
}

.otp-error-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: rgb(239, 68, 68);
}

/* Resend code link */
.otp-resend-wrapper {
    text-align: right;
}

.otp-resend-code {
    color: rgb(59, 130, 246);
    text-decoration: none;
    font-size: 0.875rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.otp-resend-code:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.otp-resend-code.otp-resend-disabled {
    color: rgb(107, 114, 128);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

.dark .otp-resend-code {
    color: rgb(96, 165, 250);
}

.dark .otp-resend-code.otp-resend-disabled {
    color: rgb(156, 163, 175);
}

/* Loading overlay for OTP verification */
.otp-fieldset .relative {
    position: relative;
}

.otp-fieldset .relative > div[wire\\:loading] {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 0.5rem;
}

.dark .otp-fieldset .relative > div[wire\\:loading] {
    background-color: rgba(17, 24, 39, 0.8);
}

.dark .otp-error-icon {
    color: rgb(248, 113, 113);
}

/* Disabled button styling */
.fi-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* Responsive adjustments */
@media (max-width: 1111px) {
    .otp-input {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.25rem;
    }

    .otp-input-wrapper {
        gap: 0.5rem;
    }

    .otp-resend-code {
        padding-right: 0.5rem;
    }
}

@media (max-width: 425px) {
    .otp-input {
        width: 2.4rem;
        height: 2.4rem;
        font-size: 1.15rem;
    }

    .otp-input-wrapper {
        gap: 0.4rem;
    }

    .otp-resend-code {
        padding-right: 0.4rem;
    }
}

.heading-text {
    font-size: 18px;
    font-weight: 800;
}

.mt-2 {
    margin-top: 2rem;
}

.mt-4 {
    margin-top: 4rem;
}
