/* ==========================================================================
   Portal CSS - Self-Service Portal
   Mobile-first, responsive. Uses --portal-primary and --portal-accent
   custom properties set by the layout template.
   ========================================================================== */

/* ---------- Page background ---------- */

body {
    background: #e2e6ed;
}

/* ---------- Skip link ---------- */

.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 0.5rem 1rem;
    background: var(--portal-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    z-index: 9999;
    border-radius: 0 0 0.375rem 0;
    transition: top 0.15s;
}
.skip-link:focus {
    top: 0;
}

/* ---------- Header (dark branded) ---------- */

.portal-header {
    background: var(--portal-header, #1e293b);
    border-bottom: none;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    min-height: 56px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

.portal-brand-logo {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.portal-brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.portal-nav {
    flex: 1;
}

.portal-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.125rem;
    flex-wrap: wrap;
}

.portal-nav-links li a {
    display: block;
    padding: 0.5rem 0.875rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: color 0.15s, background 0.15s;
}

.portal-nav-links li a:hover,
.portal-nav-links li a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.portal-lang-picker {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.portal-lang-picker a {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.portal-lang-picker a:hover,
.portal-lang-picker a.active {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
}

/* ---------- Banner ---------- */

.portal-banner {
    background: color-mix(in srgb, var(--portal-primary) 12%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--portal-primary) 25%, transparent);
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    padding: 0.5rem 1rem;
}

/* ---------- Main content area ---------- */

.portal-main {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2.5rem 3rem;
    overflow-x: hidden;
}

/* ---------- Footer ---------- */

.portal-footer {
    background: var(--portal-header, #1e293b);
    border-top: none;
    padding: 0.75rem 1rem;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
}

.portal-footer p {
    margin: 0;
}

/* ---------- Flash alert styles ---------- */

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-danger,
.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fef08a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ---------- Announcements strip above hero ---------- */
.portal-announcements-strip {
    margin: -2rem -2.5rem 0;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 2px solid #f59e0b;
    box-shadow: 0 2px 8px rgba(245,158,11,0.15);
}
.portal-announcements-strip__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 2.5rem;
    font-size: 0.825rem;
    color: #92400e;
}
.portal-announcements-strip__item + .portal-announcements-strip__item {
    border-top: 1px solid #fde68a;
}
.portal-announcements-strip__icon {
    flex-shrink: 0;
    display: flex;
}
.portal-announcements-strip__title {
    font-weight: 700;
    flex-shrink: 0;
}
.portal-announcements-strip__title::after {
    content: "|";
    margin: 0 0.5rem;
    font-weight: 300;
    opacity: 0.35;
}
.portal-announcements-strip__text {
    color: #a16207;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}
.portal-announcements-strip__date {
    margin-left: auto;
    font-size: 0.75rem;
    color: #b45309;
    white-space: nowrap;
}
.portal-announcements-strip__more {
    text-align: center;
    padding: 0.35rem 2.5rem;
    border-top: 1px solid #fde68a;
    font-size: 0.75rem;
}
.portal-announcements-strip__more a {
    color: #92400e;
    text-decoration: underline;
}
.portal-announcements-strip + .portal-hero {
    margin-top: 0;
}
/* Type variants */
.portal-announcements-strip--info {
    background: #eff6ff;
    border-bottom-color: #bfdbfe;
}
.portal-announcements-strip--info .portal-announcements-strip__item {
    color: #1e40af;
}
.portal-announcements-strip--info .portal-announcements-strip__item + .portal-announcements-strip__item,
.portal-announcements-strip--info .portal-announcements-strip__more {
    border-top-color: #bfdbfe;
}
.portal-announcements-strip--info .portal-announcements-strip__text { color: #3b82f6; }
.portal-announcements-strip--info .portal-announcements-strip__date { color: #2563eb; }
.portal-announcements-strip--info .portal-announcements-strip__more a { color: #1e40af; }

/* ---------- Hero section ---------- */

.portal-hero {
    margin: -2rem -2.5rem 2.5rem;
    padding: 2.5rem 2.5rem 5rem;
    background:
        linear-gradient(135deg,
            var(--portal-primary),
            color-mix(in srgb, var(--portal-primary) 65%, #1e293b));
    text-align: center;
    color: #fff;
    position: relative;
    overflow-x: hidden;
    overflow-y: visible;
}

/* Gradient-only hero: subtle radial texture */
.portal-hero:not(.portal-hero--image)::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(255,255,255,0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 20%, rgba(255,255,255,0.08) 0%, transparent 45%);
    pointer-events: none;
}

/* Image hero: background element + dark overlay for text contrast */
.portal-hero--image {
    background: #0f172a;
}

.portal-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.portal-hero--image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15,23,42,0.55), rgba(30,41,59,0.45));
    pointer-events: none;
    z-index: 1;
}

.portal-hero-logo {
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.portal-hero-logo img {
    height: 80px;
    width: auto;
    object-fit: contain;
    border-radius: 0.5rem;
}

.portal-hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    line-height: 1.2;
    position: relative;
    z-index: 2;
    letter-spacing: -0.01em;
}

.portal-hero-subtitle {
    font-size: 1.05rem;
    opacity: 0.85;
    margin: 0 auto 2rem;
    max-width: 520px;
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

.portal-hero-search {
    max-width: 560px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.portal-hero-search form {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.portal-hero-search .portal-search-input {
    flex: 1;
    background: #fff;
    border: none;
    color: #1e293b;
    font-size: 1rem;
    height: 52px;
    padding: 0.875rem 1.25rem;
    border-radius: 0.625rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    outline: none;
    transition: box-shadow 0.2s;
}

.portal-hero-search .portal-search-input:focus {
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    border-color: transparent;
}

.portal-hero-search .portal-search-input::placeholder {
    color: #94a3b8;
}

.portal-hero-search .portal-search-btn {
    background: #fff;
    border: none;
    color: var(--portal-primary, #4361ee);
    font-size: 1rem;
    font-weight: 700;
    padding: 0 1.75rem;
    height: 52px;
    border-radius: 0.625rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.portal-hero-search .portal-search-btn:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Hero action links (Submit Feedback, Check Status) */
.portal-hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 3;
}
.portal-hero-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.3);
    transition: background 0.15s, transform 0.1s;
}
.portal-hero-action:hover {
    background: rgba(255,255,255,0.28);
    color: #fff;
    transform: translateY(-1px);
}

/* ---------- Typeahead dropdown ---------- */

.portal-typeahead {
    position: relative;
    flex: 1;
}

.portal-typeahead-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 10;
    max-height: 320px;
    overflow-y: auto;
}

.portal-typeahead-dropdown.is-open {
    display: block;
}

.portal-typeahead-item {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}

.portal-typeahead-item:last-child {
    border-bottom: none;
}

.portal-typeahead-item:hover,
.portal-typeahead-item.is-active {
    background: #f1f5f9;
    color: #1e293b;
}

.portal-typeahead-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.portal-typeahead-item-cat {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.125rem;
}

.portal-typeahead-empty {
    padding: 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

/* ---------- Section spacing ---------- */

.portal-section {
    margin-bottom: 2.5rem;
}

/* ---------- Hub layout ---------- */

.portal-hub {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.portal-hub-main {
    flex: 1;
    min-width: 0;
}

.portal-sidebar {
    width: 340px;
    flex-shrink: 0;
}

/* ---------- Search ---------- */

.portal-search {
    margin-bottom: 2rem;
}

.portal-search form {
    display: flex;
    gap: 0.5rem;
}

.portal-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.15s;
    outline: none;
}

.portal-search-input:focus {
    border-color: var(--portal-primary);
}

.portal-search-btn {
    padding: 0.75rem 1.25rem;
    background: var(--portal-primary);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.portal-search-btn:hover {
    opacity: 0.9;
}

/* ---------- Category grid ---------- */

.portal-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.portal-category-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid var(--portal-primary);
    border-radius: 0.75rem;
    padding: 1.75rem 1.25rem;
    text-decoration: none;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, transform 0.2s;
}

.portal-category-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-3px);
    color: #1e293b;
}

.portal-category-icon {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.portal-category-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.portal-category-desc {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.45;
}

.portal-category-count {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: auto;
    padding-top: 0.25rem;
}

/* ---------- Action buttons ---------- */

.portal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.portal-action-btn {
    padding: 0.875rem 1.75rem;
    border-radius: 0.625rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

.portal-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.portal-action-primary {
    background: var(--portal-primary);
    color: #fff;
}

.portal-action-secondary {
    background: #fff;
    color: #334155;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ---------- Announcements ---------- */

.portal-announcements {
    margin-bottom: 1.5rem;
}

.portal-announcements h2 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* ---------- Service alerts status bar ---------- */

.portal-alerts-status {
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

/* Clear state - subtle green bar */
.portal-alerts-status--clear {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #166534;
    font-weight: 500;
}

.portal-alerts-status--clear svg {
    flex-shrink: 0;
    color: #16a34a;
}

/* Active alerts state - amber container */
.portal-alerts-status--active {
    background: #fffbeb;
    border: 1px solid #fde68a;
    overflow: hidden;
}

.portal-alerts-status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: #fef3c7;
    border-bottom: 1px solid #fde68a;
    color: #92400e;
}

.portal-alerts-status-header svg {
    flex-shrink: 0;
    color: #d97706;
}

.portal-alerts-status-header strong {
    font-size: 0.85rem;
    font-weight: 700;
}

.portal-alerts-status-list {
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.portal-service-alert {
    background: #fff;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #334155;
}

.portal-service-alert-title {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.125rem;
}

.portal-service-alert-desc {
    color: #78350f;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* ---------- Knowledge base styles ---------- */

.kb-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.kb-breadcrumb a {
    color: var(--portal-primary);
    text-decoration: none;
}

.kb-breadcrumb a:hover {
    text-decoration: underline;
}

.kb-breadcrumb-sep {
    color: #94a3b8;
}

.kb-article {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 760px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.kb-article h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.kb-article-meta {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.kb-article-body {
    color: #334155;
    line-height: 1.7;
    font-size: 0.95rem;
}

.kb-article-body h2,
.kb-article-body h3,
.kb-article-body h4 {
    color: #1e293b;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.kb-article-body h2 { font-size: 1.15rem; }
.kb-article-body h3 { font-size: 1rem; }
.kb-article-body h4 { font-size: 0.95rem; }

.kb-article-body p {
    margin-bottom: 1rem;
}

.kb-article-body ul,
.kb-article-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.kb-article-body li {
    margin-bottom: 0.25rem;
}

.kb-article-body a {
    color: var(--portal-primary);
}

.kb-article-body blockquote {
    border-left: 3px solid var(--portal-primary);
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    color: #475569;
    font-style: italic;
}

.kb-article-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.kb-article-body code {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.875em;
}

.kb-callout {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #1e40af;
}

.kb-image {
    margin: 1.25rem 0;
    text-align: center;
}

.kb-image img {
    max-width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.kb-image figcaption {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.35rem;
    font-style: italic;
}

.kb-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.kb-article-body figure {
    margin: 1.25rem 0;
    text-align: center;
}

.kb-article-body figure.image {
    display: inline-block;
}

.kb-article-body figcaption {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.35rem;
    font-style: italic;
}

.kb-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.kb-article-body th,
.kb-article-body td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.kb-article-body th {
    background: #f1f5f9;
    font-weight: 600;
    color: #1e293b;
}

.kb-article-body hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1.5rem 0;
}

/* ---------- KB article list (category/search) ---------- */

.kb-article-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kb-article-item {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.625rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    display: block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.kb-article-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border-color: var(--portal-primary);
}

.kb-article-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--portal-primary);
    margin-bottom: 0.25rem;
}

.kb-article-item-excerpt {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 0.35rem;
}

.kb-article-item-meta {
    font-size: 0.75rem;
    color: #64748b;
}

/* ---------- Search results ---------- */

.kb-search-header {
    margin-bottom: 1.5rem;
}

.kb-search-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.kb-search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.kb-no-results {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #64748b;
}

.kb-no-results p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* ---------- Related articles sidebar ---------- */

.kb-related {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.kb-related h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.kb-related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kb-related-list li {
    padding: 0.375rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.kb-related-list li:last-child {
    border-bottom: none;
}

.kb-related-list a {
    font-size: 0.85rem;
    color: var(--portal-primary);
    text-decoration: none;
    line-height: 1.4;
}

.kb-related-list a:hover {
    text-decoration: underline;
}

/* ---------- CTA blocks ---------- */

.kb-cta {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.kb-cta p {
    font-size: 0.875rem;
    color: #475569;
    margin-bottom: 0.75rem;
}

/* ---------- Section headings ---------- */

.portal-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

/* ---------- Sidebar widget ---------- */

.portal-sidebar-widget {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.portal-sidebar-widget h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* ---------- Recent articles list ---------- */

.portal-recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.portal-recent-list li {
    padding: 0.375rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.portal-recent-list li:last-child {
    border-bottom: none;
}

.portal-recent-list a {
    font-size: 0.85rem;
    color: var(--portal-primary);
    text-decoration: none;
    line-height: 1.4;
}

.portal-recent-list a:hover {
    text-decoration: underline;
}

/* ---------- Utility link ---------- */

.portal-link {
    color: var(--portal-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

.portal-link:hover {
    text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .portal-hub {
        flex-direction: column;
    }

    .portal-sidebar {
        width: 100%;
    }

    .portal-header {
        padding: 0 1rem;
        gap: 0.5rem;
    }

    .portal-nav-links {
        gap: 0;
    }

    .portal-categories {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }

    .portal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-action-btn {
        justify-content: center;
    }

    .kb-article {
        padding: 1.25rem;
    }

    .portal-announcements-strip {
        margin: -2rem -2.5rem 0;
    }
    .portal-announcements-strip__item {
        padding: 0.5rem 1.5rem;
    }

    .portal-hero {
        margin: -2rem -2.5rem 2rem;
        padding: 2rem 1.5rem 2rem;
    }

    .portal-hero-logo img {
        height: 64px;
    }

    .portal-hero-title {
        font-size: 1.75rem;
    }

    .portal-hero-subtitle {
        font-size: 0.95rem;
    }

    .portal-announcements-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .portal-brand-name {
        font-size: 0.875rem;
    }

    .portal-nav-links li a {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }

    .portal-categories {
        grid-template-columns: repeat(2, 1fr);
    }

    .portal-main {
        padding: 1rem 0.75rem 2rem;
    }

    .portal-announcements-strip {
        margin: -1rem -0.75rem 0;
    }
    .portal-announcements-strip__item {
        padding: 0.4rem 0.75rem;
        font-size: 0.775rem;
        flex-wrap: wrap;
    }
    .portal-announcements-strip__date {
        margin-left: 0;
        width: 100%;
    }

    .portal-hero {
        margin: -1rem -0.75rem 1.5rem;
        padding: 1.75rem 1rem 1.5rem;
    }

    .portal-hero-logo img {
        height: 56px;
    }

    .portal-hero-title {
        font-size: 1.5rem;
    }

    .portal-hero-search .portal-search-input {
        padding: 0.75rem 1rem;
        font-size: 16px;
    }

    .portal-hero-search .portal-search-btn {
        padding: 0.75rem 1rem;
    }

    .portal-category-card {
        padding: 1.25rem 1rem;
    }
}

/* ---------- Forms (feedback form, lookup, status reply) ---------- */

.portal-main label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: #1e293b;
}

.portal-main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.portal-main select,
.portal-main textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-main input:focus,
.portal-main select:focus,
.portal-main textarea:focus {
    outline: none;
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-primary) 15%, transparent);
}

.portal-main input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    color: #374151;
    background: #e5e7eb;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn:hover:not(:disabled) {
    background: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary {
    background: var(--portal-primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
    background: var(--portal-primary);
}

/* ---------- File Upload Area ---------- */

.file-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: var(--portal-primary);
    background: color-mix(in srgb, var(--portal-primary) 5%, transparent);
}

/* ---------- Form card (feedback form, centered content) ---------- */

.portal-form-card {
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    padding: 2rem;
}

.portal-form-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
}

/* ---------- Mobile form optimizations ---------- */

@media (max-width: 640px) {
    .portal-main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .portal-main select,
    .portal-main textarea {
        padding: 0.625rem 0.75rem;
        font-size: 16px;
    }

    .portal-main select {
        min-height: 44px;
    }

    .portal-main label {
        font-size: 0.9rem;
        margin-bottom: 0.35rem;
    }

    .btn {
        min-height: 44px;
        padding: 0.625rem 1rem;
        font-size: 0.95rem;
    }

    .portal-form-card {
        padding: 1.25rem;
    }
}
