:root {
    --bg: #081324;
    --bg-soft: #0d1f37;
    --surface: rgba(14, 32, 55, 0.88);
    --surface-strong: #0f2948;
    --line: rgba(255, 255, 255, 0.14);
    --text: #eef4ff;
    --text-muted: #b7c7de;
    --accent: #f40d26;
    --accent-dark: #bf0f29;
    --ok: #2fce7b;
    --shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.portal-body {
    font-family: "Work Sans", "Roboto", "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at -10% -10%, #1d3b64 0%, transparent 60%),
        radial-gradient(1000px 500px at 110% 10%, #132d50 0%, transparent 60%),
        linear-gradient(160deg, #07101e 0%, #0a1a30 46%, #101b2f 100%);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.portal-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(10px);
    background: rgba(5, 12, 24, 0.85);
    border-bottom: 1px solid var(--line);
}

.portal-header-inner {
    width: min(1200px, 92vw);
    margin: 0 auto;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.portal-brand img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.portal-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.portal-links a {
    font-size: 0.95rem;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 9px 14px;
    transition: 0.2s ease;
}

.portal-links a:hover {
    color: var(--text);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.portal-links a.is-active {
    color: #fff;
    border-color: rgba(244, 13, 38, 0.55);
    background: linear-gradient(180deg, rgba(244, 13, 38, 0.22), rgba(191, 15, 41, 0.22));
}

.portal-page {
    width: min(1200px, 92vw);
    margin: 28px auto 48px;
}

.portal-hero {
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        linear-gradient(120deg, rgba(244, 13, 38, 0.18), rgba(15, 41, 72, 0.4)),
        var(--surface);
    padding: clamp(22px, 4vw, 44px);
    box-shadow: var(--shadow);
}

.portal-eyebrow {
    color: #f9a3ad;
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    font-weight: 700;
    text-transform: uppercase;
}

.portal-hero h1 {
    margin: 10px 0 14px;
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.portal-hero p {
    margin: 0;
    max-width: 72ch;
    color: var(--text-muted);
    line-height: 1.6;
}

.portal-main-grid {
    display: grid;
    gap: 18px;
    margin-top: 18px;
    grid-template-columns: 1.4fr 1fr;
}

.portal-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    padding: clamp(18px, 2vw, 26px);
    box-shadow: var(--shadow);
}

.portal-card h2,
.portal-card h3 {
    margin: 0 0 12px;
    line-height: 1.2;
}

.portal-card p {
    margin: 0 0 10px;
    color: var(--text-muted);
    line-height: 1.6;
}

.portal-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.portal-list li {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 14px;
}

.portal-list strong {
    display: block;
    margin-bottom: 4px;
}

.portal-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.portal-kpi {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.portal-kpi .num {
    font-weight: 700;
    font-size: 1.35rem;
    color: #fff;
}

.portal-kpi .label {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.portal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.2s ease;
}

.portal-btn.primary {
    color: #fff;
    background: linear-gradient(180deg, var(--accent), var(--accent-dark));
}

.portal-btn.primary:hover {
    filter: brightness(1.06);
}

.portal-btn.ghost {
    color: var(--text);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.portal-btn.ghost:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.portal-form {
    display: grid;
    gap: 12px;
}

.portal-form .row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.portal-form label {
    display: block;
    font-size: 0.9rem;
    color: #d9e4f4;
    margin-bottom: 6px;
}

.portal-form input,
.portal-form select,
.portal-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    background: rgba(4, 12, 24, 0.55);
    color: var(--text);
    outline: none;
}

.portal-form textarea {
    min-height: 120px;
    resize: vertical;
}

.portal-form input:focus,
.portal-form select:focus,
.portal-form textarea:focus {
    border-color: rgba(244, 13, 38, 0.68);
    box-shadow: 0 0 0 3px rgba(244, 13, 38, 0.16);
}

.portal-field {
    position: relative;
}

.portal-field .toggle-password {
    position: absolute;
    top: 32px;
    right: 10px;
    border: 0;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
}

.form-feedback {
    display: none;
    margin-top: 4px;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
}

.form-feedback.ok {
    display: block;
    color: #d6fbe8;
    border: 1px solid rgba(47, 206, 123, 0.45);
    background: rgba(47, 206, 123, 0.1);
}

.form-feedback.error {
    display: block;
    color: #ffe2e5;
    border: 1px solid rgba(244, 13, 38, 0.55);
    background: rgba(244, 13, 38, 0.14);
}

.portal-accordion {
    display: grid;
    gap: 8px;
}

.portal-accordion-item {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.portal-accordion-trigger {
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    border: 0;
    padding: 12px 14px;
    font-weight: 600;
    cursor: pointer;
}

.portal-accordion-panel {
    display: none;
    padding: 0 14px 12px;
    color: var(--text-muted);
}

.portal-accordion-item.open .portal-accordion-panel {
    display: block;
}

.portal-footer {
    width: min(1200px, 92vw);
    margin: 20px auto 28px;
    color: var(--text-muted);
    border-top: 1px solid var(--line);
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.88rem;
}

.portal-footer-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-footer-links a {
    color: #d5e2f5;
}

/* Keep ASK square logo readable in shared navbar/footer blocks on portal pages. */
.navbar .navbar-logo img {
    width: clamp(220px, 62vw, 340px) !important;
    height: clamp(64px, 18vw, 106px) !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: 50% 40% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block;
}

.footer .footer-logo img {
    width: clamp(180px, 50vw, 270px) !important;
    height: clamp(58px, 16vw, 90px) !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: 50% 41% !important;
    display: block;
}

@media (max-width: 980px) {
    .portal-main-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 700px) {
    .portal-header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 0;
    }

    .portal-links a {
        font-size: 0.88rem;
        padding: 8px 11px;
    }

    .portal-form .row-2 {
        grid-template-columns: 1fr;
    }

    .portal-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
