/*
 * HR World Portal theme — Bootstrap 5.3 color + typography overrides.
 * Single source of truth for the portal color palette; matches the marketing
 * site's tokens (primary #0066FF, secondary #6B46C1, Inter + Poppins).
 */

:root {
    --hrw-primary:          #0066FF;
    --hrw-primary-hover:    #0052CC;
    --hrw-primary-rgb:      0, 102, 255;
    --hrw-secondary:        #6B46C1;
    --hrw-secondary-hover:  #553C9A;
    --hrw-secondary-rgb:    107, 70, 193;
    --hrw-body-bg:          #F9FAFB;
    --hrw-brand-gradient:   linear-gradient(135deg, #0066FF 0%, #6B46C1 100%);

    --hrw-sidebar-width:    260px;
    --hrw-topbar-height:    64px;

    /* Bootstrap variable overrides */
    --bs-primary:           var(--hrw-primary);
    --bs-primary-rgb:       var(--hrw-primary-rgb);
    --bs-link-color:        var(--hrw-primary);
    --bs-link-color-rgb:    var(--hrw-primary-rgb);
    --bs-link-hover-color:  var(--hrw-primary-hover);
    --bs-body-bg:           var(--hrw-body-bg);
    --bs-body-font-family:  'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-heading-font-family: 'Poppins', 'Inter', sans-serif;
}

body {
    font-family: var(--bs-body-font-family);
    background-color: var(--bs-body-bg);
}

h1, h2, h3, h4, h5, h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--bs-heading-font-family);
    font-weight: 700;
}

/* Buttons */
.btn-primary {
    --bs-btn-bg:           var(--hrw-primary);
    --bs-btn-border-color: var(--hrw-primary);
    --bs-btn-hover-bg:           var(--hrw-primary-hover);
    --bs-btn-hover-border-color: var(--hrw-primary-hover);
    --bs-btn-active-bg:           var(--hrw-primary-hover);
    --bs-btn-active-border-color: var(--hrw-primary-hover);
}

.btn-outline-primary {
    --bs-btn-color:        var(--hrw-primary);
    --bs-btn-border-color: var(--hrw-primary);
    --bs-btn-hover-bg:           var(--hrw-primary);
    --bs-btn-hover-border-color: var(--hrw-primary);
    --bs-btn-active-bg:           var(--hrw-primary-hover);
    --bs-btn-active-border-color: var(--hrw-primary-hover);
}

/* Form controls */
.form-control:focus,
.form-select:focus {
    border-color: var(--hrw-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--hrw-primary-rgb), 0.2);
}

/* Auth page layout (signed-out: centered card on a soft gradient) */
.hrw-auth-body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at top, rgba(var(--hrw-primary-rgb), 0.06), transparent 50%),
        radial-gradient(ellipse at bottom, rgba(var(--hrw-secondary-rgb), 0.06), transparent 50%),
        var(--hrw-body-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.hrw-auth-logo {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.hrw-auth-logo img {
    height: 56px;
    width: auto;
}

.hrw-auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    padding: 2rem;
}

.hrw-auth-card h1,
.hrw-auth-card h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.hrw-auth-subhead {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.hrw-auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

.hrw-auth-footer a {
    color: var(--hrw-primary);
    text-decoration: none;
    font-weight: 600;
}

.hrw-auth-footer a:hover {
    text-decoration: underline;
}

/* Password strength indicator */
.hrw-strength {
    margin-top: 0.5rem;
}

.hrw-strength-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.hrw-strength-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.2s ease, background-color 0.2s ease;
    background: #94a3b8;
}

.hrw-strength-label {
    font-size: 0.8rem;
    color: #64748b;
}

.hrw-strength-0 .hrw-strength-bar-fill { width: 20%;  background: #ef4444; }
.hrw-strength-1 .hrw-strength-bar-fill { width: 40%;  background: #f59e0b; }
.hrw-strength-2 .hrw-strength-bar-fill { width: 60%;  background: #eab308; }
.hrw-strength-3 .hrw-strength-bar-fill { width: 80%;  background: #22c55e; }
.hrw-strength-4 .hrw-strength-bar-fill { width: 100%; background: #16a34a; }

.hrw-policy-hint {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: #64748b;
}

/* Field-level errors + alerts */
.hrw-alert {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.hrw-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.hrw-alert-ok {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.hrw-brand-gradient {
    background: var(--hrw-brand-gradient);
}

.hrw-brand-gradient-text {
    background: var(--hrw-brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =========================================================
 * Authenticated portal shell (topbar + sidebar + main)
 * ========================================================= */
.hrw-portal-body {
    min-height: 100vh;
    background: var(--hrw-body-bg);
    margin: 0;
}

.hrw-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--hrw-topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
}

.hrw-topbar-logo img {
    height: 40px;
    width: auto;
    display: block;
}

.hrw-topbar-spacer {
    flex: 1;
}

.hrw-company-switch {
    max-width: 280px;
}

.hrw-company-switch .dropdown-toggle {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    padding: 0.45rem 0.85rem;
    font-weight: 600;
}

.hrw-company-switch .dropdown-toggle:hover,
.hrw-company-switch .dropdown-toggle:focus {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}

.hrw-avatar-btn {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    color: #0f172a;
    font-weight: 600;
}

.hrw-avatar-btn:hover {
    background: #f1f5f9;
}

.hrw-avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--hrw-brand-gradient);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: -0.02em;
}

.hrw-shell {
    display: flex;
    min-height: calc(100vh - var(--hrw-topbar-height));
}

.hrw-sidebar {
    width: var(--hrw-sidebar-width);
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 1rem 0 0 0;
}

.hrw-nav {
    list-style: none;
    padding: 0 0.5rem;
    margin: 0;
    flex: 1;
}

.hrw-nav li + li { margin-top: 2px; }

.hrw-nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.85rem;
    color: #475569;
    text-decoration: none;
    border-radius: 0.4rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.hrw-nav-link i {
    width: 1.2rem;
    text-align: center;
    font-size: 0.95rem;
    color: #94a3b8;
}

.hrw-nav-link:hover {
    background: #f1f5f9;
    color: var(--hrw-primary);
}

.hrw-nav-link:hover i {
    color: var(--hrw-primary);
}

.hrw-nav-link.active {
    background: rgba(var(--hrw-primary-rgb), 0.1);
    color: var(--hrw-primary);
    font-weight: 600;
}

.hrw-nav-link.active i {
    color: var(--hrw-primary);
}

.hrw-nav-link.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    pointer-events: none;
}

.hrw-nav-link.disabled i { color: #e2e8f0; }

.hrw-nav-coming {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 7px;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 999px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.hrw-sidebar-user {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.hrw-sidebar-user .hrw-avatar-circle { width: 36px; height: 36px; font-size: 0.85rem; }

.hrw-sidebar-user-meta { line-height: 1.2; min-width: 0; }

.hrw-sidebar-user-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrw-sidebar-user-role {
    font-size: 0.75rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrw-main {
    flex: 1;
    padding: 1.5rem 2rem 3rem;
    min-width: 0;
}

.hrw-main h1 { font-size: 1.75rem; margin-bottom: 0.25rem; }
.hrw-main .page-sub { color: #64748b; margin-bottom: 1.5rem; }

.hrw-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.hrw-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #0f172a;
}

.hrw-empty {
    color: #94a3b8;
    font-size: 0.95rem;
    padding: 0.75rem 0;
}

.hrw-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.hrw-company-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-top: 1px solid #f1f5f9;
}

.hrw-company-row:first-child { border-top: none; }

.hrw-company-row-name { font-weight: 600; color: #0f172a; }
.hrw-company-row-meta { color: #64748b; font-size: 0.85rem; }
.hrw-company-row-badge { margin-left: auto; }

/* Mobile: collapse sidebar into an offcanvas */
@media (max-width: 767.98px) {
    .hrw-sidebar.offcanvas-md {
        border-right: none;
    }
    .hrw-main { padding: 1rem; }
    .hrw-topbar { padding: 0 0.75rem; gap: 0.5rem; }
    .hrw-company-switch { max-width: 160px; }
    .hrw-company-switch .dropdown-toggle {
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
