.portal-auth-body {
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
}

.portal-auth {
    display: grid;
    font-family: var(--font-sans);
    min-height: 100vh;
    width: 100%;
}

.portal-auth-feedback {
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.875rem;
    line-height: 1.4;
    padding: 10px 12px;
}

.portal-auth-feedback.is-error {
    background: color-mix(in srgb, var(--destructive) 10%, transparent);
    border-color: color-mix(in srgb, var(--destructive) 28%, transparent);
    color: var(--destructive);
}

.portal-auth-feedback.is-success {
    background: color-mix(in srgb, var(--success) 10%, transparent);
    border-color: color-mix(in srgb, var(--success) 28%, transparent);
    color: var(--success);
}

.portal-auth .kt-btn.is-loading::before {
    animation: portal-auth-spin 0.7s linear infinite;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 999px;
    content: "";
    height: 14px;
    margin-right: 8px;
    width: 14px;
}

@keyframes portal-auth-spin {
    to { transform: rotate(360deg); }
}

.portal-auth :where(h1, h2, h3, p, label, a, button, input, small) {
    font-family: var(--font-sans) !important;
}

.portal-auth :where(button, input) {
    font-size: 0.875rem;
}

.portal-auth-form-column {
    align-items: center;
    display: flex;
    justify-content: center;
    min-width: 0;
    padding: 40px;
}

.portal-auth-card {
    max-width: 370px;
    position: relative;
    width: 100%;
    z-index: 4;
}

.portal-auth-card .kt-card-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding: 40px !important;
}

.portal-auth-card .kt-card-content > .text-center {
    margin-bottom: 10px !important;
    text-align: center !important;
}

.portal-auth-card--wide {
    max-width: 460px;
}

.portal-auth-name-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-auth-card .portal-auth-title {
    color: var(--mono);
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1;
    margin: 0 0 0.625rem;
}

.portal-auth-card .kt-input {
    min-height: 40px;
}

.portal-auth-card > form > .flex.flex-col.gap-1 {
    gap: 4px !important;
}

.portal-auth-card .kt-btn {
    min-height: 40px;
}

.portal-auth-brand-panel {
    background-image: url('/public/themes/jejex-next/media/images/2600x1600/1.png');
    background-position: top center;
    background-repeat: no-repeat;
    display: block;
    min-height: 320px;
}

.dark .portal-auth-brand-panel {
    background-image: url('/public/themes/jejex-next/media/images/2600x1600/1-dark.png');
}

.portal-auth-brand-link,
.portal-auth-mobile-brand {
    display: inline-flex;
    flex: 0 0 auto;
    width: fit-content;
}

.portal-auth-brand-content {
    align-items: flex-start;
    flex-direction: row;
}

.portal-auth .jejex-brand-mark {
    display: block;
    flex: 0 0 auto;
    height: 48px;
    width: 56px;
}

.portal-auth-mobile-brand {
    display: none !important;
}

.portal-auth-card .kt-form-label,
.portal-auth-card .kt-checkbox-label {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.25rem;
}

.portal-auth-card .text-secondary-foreground {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.portal-auth-remember {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

.portal-auth-remember .kt-checkbox {
    appearance: none;
    background-color: var(--background);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
    border: 1px solid var(--input);
    border-radius: 0.25rem;
    flex: 0 0 auto;
    height: 18px;
    margin: 0;
    opacity: 1;
    position: static;
    width: 18px;
}

.portal-auth-remember .kt-checkbox:checked {
    background-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.25' d='m3.25 8.25 3 3 6.5-6.5'/%3E%3C/svg%3E");
    border-color: var(--primary);
}

.portal-auth-remember .kt-checkbox:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
    outline-offset: 2px;
}

.portal-auth-captcha {
    max-width: 100%;
    overflow: hidden;
}

.portal-auth label.error {
    color: var(--destructive);
    display: block;
    font-size: 0.75rem;
    line-height: 1.25rem;
    margin-top: 0.25rem;
}

.portal-auth input.error,
.portal-auth .kt-input:has(input.error) {
    border-color: var(--destructive);
}

.portal-auth .button-loading-annimation {
    pointer-events: none;
}

.portal-auth .portal-password-eye {
    color: var(--muted-foreground);
    display: inline-block !important;
    font-size: 1rem;
    transition: color 150ms ease;
}

.portal-auth [data-kt-toggle-password-initialized].active .portal-password-eye,
.portal-auth [data-kt-toggle-password].active .portal-password-eye {
    color: var(--primary);
}

@media (max-width: 1023px) {
    .portal-auth {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 100px minmax(0, 1fr);
    }

    .portal-auth-brand-panel {
        background-image: url('/public/themes/jejex-next/media/images/2600x1200/bg-14.png');
        background-position: calc(100% + 128px) center;
        background-size: 700px auto;
        border-bottom: 1px solid var(--border);
        grid-column: 1;
        grid-row: 1;
        min-height: 100px;
    }

    .portal-auth-brand-content {
        padding: 24px !important;
    }

    .dark .portal-auth-brand-panel {
        background-image: url('/public/themes/jejex-next/media/images/2600x1200/bg-14-dark.png');
    }

    .portal-auth-form-column {
        align-items: flex-start;
        grid-column: 1;
        grid-row: 2;
        justify-content: center;
        min-height: 0;
        padding: 64px 32px 40px;
    }

}

@media (min-width: 1024px) {
    .portal-auth {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .portal-auth-form-column {
        grid-column: 1;
        grid-row: 1;
    }

    .portal-auth-brand-panel {
        border: 1px solid var(--border);
        border-radius: 0.75rem;
        display: block;
        grid-column: 2;
        grid-row: 1;
        margin: 20px;
        min-height: calc(100vh - 40px);
    }

}

@media (min-width: 1280px) {
    .portal-auth-brand-panel {
        background-size: cover;
    }
}

@media (max-width: 479px) {
    .portal-auth {
        grid-template-rows: 90px minmax(0, 1fr);
    }

    .portal-auth-brand-panel {
        min-height: 90px;
    }

    .portal-auth-brand-content {
        padding: 20px !important;
    }

    .portal-auth-form-column {
        padding: 32px 20px 28px;
    }

    .portal-auth-card .kt-card-content {
        padding: 28px 24px !important;
    }

    .portal-auth-name-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.portal-relogin-overlay {
    align-items: center;
    background: rgba(15, 23, 42, 0.58);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 10000;
}

.portal-relogin-overlay.is-open {
    display: flex;
}

.portal-relogin-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    color: #111827;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    max-width: 420px;
    overflow: hidden;
    width: 100%;
}

.portal-relogin-form {
    margin: 0;
}

.portal-relogin-header {
    align-items: flex-start;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 16px;
    padding: 24px;
}

.portal-relogin-brand .small-logo {
    display: none !important;
}

.portal-relogin-brand .default-logo {
    display: inline-flex !important;
}

.portal-relogin-header h2 {
    color: #111827;
    font-family: inherit;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.25;
    margin: 0 0 6px;
}

.portal-relogin-header p {
    color: #6b7280;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.portal-relogin-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
}

.portal-relogin-field {
    color: #111827;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    font-size: 14px;
    gap: 6px;
    margin: 0;
}

.portal-relogin-field .kt-input {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    color: #111827;
    font-family: inherit;
    font-size: 14px;
    height: 40px;
    padding: 0 12px;
    width: 100%;
}

.portal-relogin-field .kt-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    outline: none;
}

.portal-relogin-footer {
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px;
}

.portal-relogin-submit {
    align-items: center;
    background: #2f80ed;
    border: 1px solid #2f80ed;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    justify-content: center;
    min-height: 40px;
    min-width: 120px;
    padding: 0 18px;
}

.portal-relogin-submit:hover,
.portal-relogin-submit:focus-visible {
    background: #2563eb;
    border-color: #2563eb;
}
