/* public portal unified header styles */
.pkg-auth-header-strip {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
}

body.has-portal-header {
    padding-top: 76px !important;
}

.portal-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    height: 64px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    width: 100%;
}

.portal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
}

.portal-logo {
    max-height: 38px;
    width: auto;
    object-fit: contain;
}

.portal-company-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.portal-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Auth Nav buttons */
.portal-header-right .pkg-auth-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid var(--pkg-primary, #6366f1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.portal-header-right .pkg-auth-nav-btn.signin {
    background: #fff;
    color: var(--pkg-primary, #6366f1);
}
.portal-header-right .pkg-auth-nav-btn.signin:hover {
    background: var(--pkg-primary, #6366f1);
    color: #fff;
}

.portal-header-right .pkg-auth-nav-btn.signup {
    background: var(--pkg-success-gradient, linear-gradient(135deg, #10b981 0%, #059669 100%));
    color: #fff;
    border-color: transparent;
}
.portal-header-right .pkg-auth-nav-btn.signup:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

/* User avatar and dropdown */
.portal-avatar-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50px;
    transition: background-color 0.2s;
}

.portal-avatar-menu:hover {
    background-color: #f1f5f9;
}

.portal-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--pkg-primary, #6366f1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.portal-avatar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    width: 180px;
    display: none;
    flex-direction: column;
    padding: 6px;
    z-index: 10002;
}

.portal-avatar-dropdown::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}

.portal-avatar-menu:hover .portal-avatar-dropdown {
    display: flex;
}

.portal-dropdown-item {
    padding: 10px 14px;
    color: #334155;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    transition: background-color 0.2s, color 0.2s;
}

.portal-dropdown-item:hover {
    background-color: #f1f5f9;
    color: var(--pkg-primary, #6366f1);
}

.portal-dropdown-item i {
    font-size: 1rem;
    color: #64748b;
}

@media (max-width: 768px) {
    .portal-header {
        padding: 0 16px;
    }
    .portal-company-name,
    .portal-header-divider,
    .portal-page-title {
        display: none !important; /* Hide details on small mobile screens */
    }
}

/* Dynamically theme header buttons, modal headers, and submit buttons using active theme variables */
.portal-header-right .pkg-auth-nav-btn.signup {
    background: linear-gradient(135deg, var(--pkg-primary, #6366f1) 0%, var(--pkg-primary-dark, #4f46e5) 100%) !important;
}

.pkg-auth-modal-header {
    background: linear-gradient(135deg, var(--pkg-primary, #6366f1) 0%, var(--pkg-primary-dark, #4f46e5) 100%) !important;
}

.pkg-auth-submit-btn {
    background: linear-gradient(135deg, var(--pkg-primary, #6366f1) 0%, var(--pkg-primary-dark, #4f46e5) 100%) !important;
}

.pkg-auth-submit-btn:hover {
    opacity: 0.95;
    box-shadow: 0 4px 12px rgba(237, 84, 6, 0.2);
}

.pkg-auth-modal-footer a {
    color: var(--pkg-primary, #6366f1) !important;
}

.pkg-auth-input:focus {
    border-color: var(--pkg-primary, #6366f1) !important;
    box-shadow: 0 0 0 3px rgba(237, 84, 6, 0.15) !important;
}

/* Support Button in Header */
.portal-header-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #334155;
}

.portal-header-support-btn:hover {
    border-color: var(--pkg-primary, #6366f1);
    color: var(--pkg-primary, #6366f1);
    background: #fdf4ff; /* subtle tint */
}

/* Support Modal */
.portal-support-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.portal-support-modal-overlay.show {
    display: flex;
}

.portal-support-modal-box {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: supportPopIn 0.2s ease;
}

@keyframes supportPopIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.portal-support-header {
    background: linear-gradient(135deg, var(--pkg-primary, #6366f1) 0%, var(--pkg-primary-dark, #4f46e5) 100%);
    padding: 20px 24px;
    color: #fff;
    position: relative;
}

.portal-support-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
}

.portal-support-header p {
    margin: 4px 0 0 0;
    font-size: 0.82rem;
    opacity: 0.9;
}

.portal-support-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.portal-support-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

.portal-support-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-decoration: none !important;
    transition: background-color 0.2s, border-color 0.2s;
}

.portal-support-item:hover {
    background-color: #f8fafc;
    border-color: var(--pkg-primary, #6366f1);
}

.portal-support-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #475569;
}

.portal-support-item:hover .portal-support-item-icon {
    background: #eff6ff;
    color: var(--pkg-primary, #6366f1);
}

.portal-support-item-details h4 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portal-support-item-details p {
    margin: 2px 0 0 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
}

/* Auth Modal Styles */
.pkg-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.pkg-auth-modal {
    background: #fff;
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: authModalFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authModalFade {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.pkg-auth-modal-header {
    background: var(--pkg-success-gradient, var(--pkg-primary, #6366f1));
    padding: 24px;
    position: relative;
    color: #fff;
}
.pkg-auth-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
}
.pkg-auth-modal-header p {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.pkg-auth-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.pkg-auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.pkg-auth-modal-body {
    padding: 28px 24px;
}

.pkg-auth-modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pkg-auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pkg-auth-input-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pkg-auth-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}
.pkg-auth-input:focus {
    border-color: var(--pkg-primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.pkg-auth-row-dual {
    display: flex;
    gap: 12px;
}

.pkg-auth-submit-btn {
    background: var(--pkg-success-gradient, var(--pkg-primary, #6366f1));
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pkg-auth-submit-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.pkg-auth-modal-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.88rem;
    color: #64748b;
}
.pkg-auth-modal-footer a {
    color: var(--pkg-primary, #6366f1);
    text-decoration: none;
    font-weight: 700;
}
.pkg-auth-modal-footer a:hover {
    text-decoration: underline;
}
