body {
    margin: 0;
    font-family: "Open Sans","Helvetica Neue",sans-serif;
    font-size: 14px;
}

.page-container {
    min-height: 100vh;
    max-width: 1500px;
    margin: auto;
    padding: 0 32px;
    display: flex;
    flex-direction: column;
}
.content-container {
    flex-grow: 1;
    display: flex;
    flex-direction: row;
}
.main-content {
    padding: 32px;
    flex-grow: 1;
}
.inner-content {
    border: 1px solid #c8c8c8;
    background-color: #fff;
    color: #333;
}

.page-header {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 64px;
    border-bottom: 1px solid #c8c8c8;
}
.page-header h1 {
    margin: 0;
    flex: 1;
    text-align: center;
}
.page-header .nds-logo,
.page-header .rub-logo,
.page-header .buw-logo {
    height: 56px;
    width: auto;
    max-width: 240px;
}
.page-header .rub-logo {
    margin-right: 12px;
}
.page-header .header-logos-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.page-header .header-logos-right {
    display: flex;
    align-items: center;
}

.sidebar {
    padding: 32px 16px;
}
.sidebar .ui-menu {
    width: 250px;
}
.sidebar .ui-menu .ui-menuitem-link {
    color: #000 !important;
    font-weight: bold !important;
    background: transparent !important;
}
.sidebar .ui-menu .ui-menuitem-link.active,
.sidebar .ui-menu .ui-menuitem.active > .ui-menuitem-link,
.sidebar .ui-menu .ui-menuitem-link[aria-current="page"],
.sidebar .ui-menu .ui-menuitem-link[aria-selected="true"],
.sidebar .ui-menu .ui-menuitem-link[class~="active"],
.sidebar .ui-menu .ui-menuitem-link[class*="active"],
.sidebar .ui-menu .ui-menuitem.active > .ui-menuitem-link[class*="active"] {
    color: #fff !important;
    background: #003560 !important;
    font-weight: bold !important;
}
.sidebar .ui-menu .ui-menuitem-link.active .ui-menuitem-icon,
.sidebar .ui-menu .ui-menuitem-link.active .ui-menuitem-text,
.sidebar .ui-menu .ui-menuitem.active > .ui-menuitem-link .ui-menuitem-icon,
.sidebar .ui-menu .ui-menuitem.active > .ui-menuitem-link .ui-menuitem-text {
    color: #fff !important;
}
.sidebar .ui-menu .ui-menuitem-link:hover, .sidebar .ui-menu .ui-menuitem-link:focus {
    background: #89ba17 !important;
    color: #fff !important;
}

.ui-tabs .ui-tabs-nav .ui-state-default {
    background: transparent !important;
    color: #003560 !important;
    font-weight: bold !important;
    transition: background 0.3s, color 0.3s;
    border-color: transparent;
}
.ui-tabs .ui-tabs-nav .ui-state-default:hover {
    background: #89ba17 !important;
    color: #fff !important;
    border-color: #7fad18 !important;
}
.ui-tabs .ui-tabs-nav .ui-state-active {
    background-color: #003560 !important;
    color: #fff !important;
    font-weight: bold !important;
    border-color: #003560 !important;
}

.main-content > .ui-tabs {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.main-content > .ui-tabs > .ui-tabs-panels {
    flex-grow: 1;
}
.inner-content, body .main-content > .ui-tabs > .ui-tabs-panels > .ui-tabs-panel:not(.ui-helper-hidden) {
    height: 100%;
    display: flex;
    padding: 1em;
    flex-direction: column;
}

.row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1em;
    font-weight: bold;
}
.col {
    display: flex;
    flex-direction: column;
    flex-basis: 20em;
    gap: 0.5em;
}
.grid {
    display: grid;
    row-gap: 1em;
    column-gap: 4em;
    align-items: center;
}
.grid-cols-2 {
    grid-template-columns: auto 1fr;
}
.col-span-full {
    grid-column: 1 / -1;
}
.grid-left-right {
    grid-template-columns: 1fr 1fr;
    align-items: center;
}
.grid-left-right :nth-child(2n) {
    justify-self: flex-end;
}

.center {
    margin-left: auto;
    margin-right: auto;
}
.text-center {
    text-align: center;
}

.section-header:not(:first-child) {
    margin-top: 2em;
}

.button {
    display: inline-block;
    margin: 0;
    padding: .5em 1em;
    background-color: #003560;
    color: #fff;
    border: 1px solid #003560;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, border 0.3s;
    font-weight: bold;
}
.button:disabled {
    color: #c8c8c8;
    background-color: #003560;
    opacity: 0.5;
    cursor: not-allowed;
}
.button:hover, .button:focus {
    background-color: #89ba17;
    border: 1px solid #7fad18;
    color: #fff;
}

.button-row {
    display: flex;
    align-items: baseline;
}
.button-row button {
    margin: 0;
    background-color: #003560;
    color: #fff;
    border: 1px solid #003560;
    border-left-width: 0;
    padding: .3em 0.75em;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s, color 0.3s, border 0.3s;
}
.button-row button:first-child {
    margin-left: 8px;
    border-left-width: 1px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}
.button-row button:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}
.button-row button:hover, .button-row button:focus {
    background-color: #89ba17;
    border-color: #7fad18;
    color: #fff;
}
.button-row button:active {
    background-color: #89ba17;
    border-color: #7fad18;
    color: #fff;
}
.button-row button.active {
    background-color: #003560;
    color: #fff;
}

input.io-field, textarea.io-field {
    border: 1px solid black;
    width: 100%;
    font-family: monospace;
    padding: 8px;
}

pre {
    white-space: pre-wrap;
    word-wrap: anywhere;
}

#spa-login.btn.btn-primary {
    background-color: #003560 !important;
    color: #fff !important;
    border: 1px solid #003560 !important;
    font-weight: bold;
    transition: background 0.3s, color 0.3s, border 0.3s;
}
#spa-login.btn.btn-primary:hover,
#spa-login.btn.btn-primary:focus {
    background-color: #89ba17 !important;
    color: #fff !important;
    border: 1px solid #7fad18 !important;
}

.danger-btn, .danger-btn.ui-button, .danger-btn.ui-state-default {
    background: #c82333 !important;
    border-color: #c82333 !important;
    color: #fff !important;
    font-weight: bold;
}
.danger-btn:hover, .danger-btn:focus {
    background: #a71d2a !important;
    border-color: #a71d2a !important;
    color: #fff !important;
}

.authorize-btn, .authorize-btn.ui-button, .authorize-btn.ui-state-default {
    background: #003560 !important;
    border-color: #003560 !important;
    color: #fff !important;
    font-weight: bold;
    transition: background 0.3s, color 0.3s, border 0.3s;
}
.authorize-btn:hover, .authorize-btn:focus {
    background: #89ba17 !important;
    border-color: #7fad18 !important;
    color: #fff !important;
}

input[type="radio"], input[type="radio"]:checked, input[type="radio"]:focus, input[type="radio"]:hover {
    accent-color: #003560 !important;
}

.secondary-button, .pi-sign-out {
    background: #f5f5f5 !important;
    border-color: #c8c8c8 !important;
    color: #6c757d !important;
    font-weight: bold;
}
.secondary-button:hover, .secondary-button:focus {
    background: #e0e0e0 !important;
    border-color: #7fad18 !important;
    color: #343a40 !important;
}

/* PrimeFaces info messages were rendering with the stock pale-green
   (#b7d8b7) PF theme tint. Re-tone with the design-system UNIGRÜN +
   RUB-blau palette so success acknowledgements (e.g. "mIdP URL saved")
   match the rest of the module. */
.ui-messages .ui-messages-info {
    background: #f0f6dd !important;
    border: 1px solid #89ba17 !important;
    color: #003560 !important;
}
.ui-messages .ui-messages-info .ui-icon,
.ui-messages .ui-messages-info .ui-messages-close {
    color: #89ba17 !important;
}

/* Inline pill used by the "Attacks using mIdP" tab to show whether a
   malicious-IdP URL is currently configured. Two variants: active
   (UNIGRÜN on white) and inactive (neutral grey). */
.midp-status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
}
.midp-status-pill.midp-status-active {
    background: #89ba17;
}
.midp-status-pill.midp-status-inactive {
    background: #6c757d;
}

/* Inline scope-tag next to a section header in the "Attacks using
   mIdP" tab — marks sections that ONLY work with a malicious IdP
   (ID Spoofing, Cross-Phase Attacks). Sized to sit next to a
   `.difficulty` pill as a sibling badge; RUB-blau instead of the
   yellow/red of difficulty levels to signal that this is scope
   metadata, not a difficulty hint. */
.midp-exclusive-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    background: #003560;
    color: #fff;
    font-size: 0.78em;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

/* Right-side cluster on a `.verifier-section h3` — groups multiple
   badges (scope tag + difficulty pill) so they hug the right edge
   together instead of getting spread by the h3's flex
   space-between. */
.verifier-section h3 .header-badges {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Layout helpers for the mIdP form block. Spacing matches the rest of
   the tab content; kept here so the xhtml can stay markup-only. */
.midp-form-row {
    margin-bottom: 0.5rem;
}
.midp-form-row .midp-url-input {
    width: 32em;
}
.midp-form-row .midp-action-btn {
    margin-left: 0.5em;
}
.midp-status-block {
    margin-top: 1em;
}
.midp-test-result-block {
    margin-top: 0.5em;
}

/* Victim-bot panel feedback line. Mirrors the recruiting bot UX —
   neutral grey while the visit is pending, green on success, red on
   error / rate-limit. The aria-live="polite" attribute on the element
   makes screen readers announce state transitions. */
.victim-bot-result {
    margin-top: 0.5em;
    min-height: 1.2em;
    font-size: 14px;
    color: #666;
}
.victim-bot-result.ok {
    color: #2e7d32;
    font-weight: 600;
}
.victim-bot-result.err {
    color: #c62828;
    font-weight: 600;
}

/* Inline "this attack needs the bot" hint on attack-row links. The
   icon sits in the link's normal flow next to the difficulty badge —
   small, visually subordinate to the difficulty so it doesn't fight
   for attention, but enough that students notice the bot path exists. */
.bot-required {
    margin-left: 0.4em;
    font-size: 0.9em;
    opacity: 0.85;
    cursor: help;
}

/* "This task awards a CTF flag" badge. PrimeIcons-driven, matching the
   .icon-flag-red convention already used in the REST module's task
   descriptions for consistency across modules. Sits next to the
   difficulty pill (and the bot-required badge, if both apply). */
.has-flag {
    margin-left: 0.4em;
    font-size: 0.9em;
    cursor: help;
}
.icon-flag-red {
    color: #c62828;
}

/* CTF flag banner on success.xhtml. Same gradient pattern + monospace
   value as the SAML SP's authenticated/index.xhtml so a successful
   solve looks identical across both SSO modules.
   Real (green) = full solve; dummy (amber) = bot-style attack against
   yourself — technique demonstrated, real flag still needs sub=oemmes
   via the victim-bot. */
.ctf-flag-container {
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-width: 2px;
    border-style: solid;
}
.ctf-flag-container.ctf-flag-real {
    background: linear-gradient(135deg, #89ba17, #7fad18);
    border-color: #6d8f14;
}
.ctf-flag-container.ctf-flag-dummy {
    background: linear-gradient(135deg, #f0a040, #d68920);
    border-color: #b06f15;
}
.ctf-flag-container h3 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.ctf-flag-value {
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    background: rgba(0,0,0,0.2);
    padding: 10px 20px;
    border-radius: 4px;
    display: inline-block;
    margin: 10px 0;
    word-break: break-all;
}
.ctf-attack-info {
    color: #f8f9fa;
    font-size: 14px;
    margin-top: 10px;
}

/* Verifier-section card layout — one card per attack family. Each
   card groups its tasks (sometimes via a sub-heading), shows the
   difficulty range in the header, and lets the user reveal a
   per-attack hint via `💡 Hint?`. Pattern shared with SAML and
   xml-sec via identical class names. */
.section-description {
    margin-bottom: 20px;
    color: #666;
    font-size: 15px;
    line-height: 1.5;
}

.verifier-section {
    margin: 24px 0;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #003560;
    border-radius: 4px;
}
.verifier-section h3 {
    color: #003560;
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.verifier-section h4 {
    color: #003560;
    margin: 16px 0 8px 0;
    font-size: 15px;
    font-weight: 600;
}
.verifier-section .section-blurb {
    color: #666;
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.5;
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.task-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    margin: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    color: #003560;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    min-width: 240px;
    flex: 1;
}
.task-link:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #89ba17;
    color: #003560;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.task-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.task-link .task-link-label {
    text-align: left;
    flex: 1;
}

/* Difficulty pills — shared convention across modules (matches xml-sec
   /xml-sign-webapp/.../main.css). `easy/medium/hard/master` apply to a
   single task; `range` is for the section-header "Easy – Hard" badge. */
.difficulty {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.78em;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.difficulty.easy    { background: #d4edda; color: #155724; }
.difficulty.medium  { background: #fff3cd; color: #856404; }
.difficulty.hard    { background: #f8d7da; color: #721c24; }
.difficulty.master  { background: #6f42c1; color: #fff; }
.difficulty.range   { background: #e9ecef; color: #495057; font-weight: 500; }

/* Hint toggle, ported from json-sec. Click `💡 Hint?` to reveal the
   sokratisch-formulierten hint underneath. Closed by default. */
.hint-container {
    margin: 4px 0 12px 0;
}
.hint-toggle {
    cursor: pointer;
    color: #89ba17;
    font-size: 14px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    user-select: none;
}
.hint-toggle:hover {
    background-color: #f0f8e7;
}
.hint-content {
    display: none;
    margin-top: 8px;
    padding: 10px 14px;
    background-color: #ffffff;
    border-left: 3px solid #89ba17;
    border-radius: 3px;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
}

/* Em-dash separator between two .difficulty pills in a range
   (e.g. "Easy – Hard"). Plain text styled to match the section
   header colour so the two coloured pills do the heavy lifting. */
.range-dash {
    color: #495057;
    font-weight: 500;
    padding: 0 2px;
}
