/* ==========================================================================
   RosettaHub registration forms
   The look of the RosettaHub console: its colours, type, radius and spacing
   (RosettaConsole/wwwroot/css/rh-tokens.css) and its sign-in page (login.css).
   The forms are PrimeFaces 10 on the bootstrap theme, so these rules override
   the theme. JSF prefixes component ids with the form's (j_idt6:rootPanel),
   so panels are matched on how their id ends.
   ========================================================================== */

/* Inter, self-hosted (fonts/inter, @fontsource/inter 5.3.0, SIL OFL 1.1). The stylesheet is
   served from /registration/javax.faces.resource/, so ../fonts is /registration/fonts */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/inter/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/inter/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/inter/inter-latin-600-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/inter/inter-latin-700-normal.woff2") format("woff2");
}

/* The console's light tokens */
:root {
    --rh-brand: #04488F;
    --rh-brand-hover: #033a75;
    --rh-brand-tint: rgba(4, 72, 143, .08);
    --rh-brand-ring: rgba(4, 72, 143, .22);
    --rh-on-brand: #ffffff;
    --rh-ink: #0f1b2d;
    --rh-ink-2: #334155;
    --rh-muted: #64748b;
    --rh-line: #e2e8f0;
    --rh-line-2: #cbd5e1;
    --rh-bg: #f6f8fb;
    --rh-surface: #ffffff;
    --rh-sunken: #f1f5f9;
    --rh-ok: #15803d;
    --rh-ok-bg: #dcfce7;
    --rh-warn: #b45309;
    --rh-warn-bg: #fef3c7;
    --rh-bad: #b91c1c;
    --rh-bad-bg: #fee2e2;
    --rh-bad-ring: rgba(185, 28, 28, .18);
    --rh-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --rh-radius-sm: 6px;
    --rh-radius: 8px;
    --rh-radius-lg: 12px;
    --rh-shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 3px rgba(15, 27, 45, .08);
    --rh-shadow-pop: 0 8px 24px rgba(15, 27, 45, .14);
    --rh-field-height: 48px;
    /* Space above every field's label, and between a label and its field */
    --rh-field-gap: 18px;
    --rh-label-gap: 6px;
}

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

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 40px 16px;
    background: var(--rh-bg);
    color: var(--rh-ink);
    font-family: var(--rh-font);
    font-size: 14px !important;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ui-widget,
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
    font-family: var(--rh-font) !important;
    font-size: 14px;
}

/* The pages centre with align="center"; the card sets its own alignment */
.ui-fuild {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    text-align: left;
}

a {
    color: var(--rh-brand);
    text-decoration: none;
}

a:hover {
    color: var(--rh-brand-hover);
    text-decoration: underline;
}

/* The theme colours links inside widgets dark grey */
.ui-widget a:not(.ui-button):not(.back-button),
.ui-widget-content a:not(.ui-button):not(.back-button) {
    color: var(--rh-brand);
}

:focus-visible {
    outline: 2px solid var(--rh-brand);
    outline-offset: 2px;
}

/* ---------- Language links, under the card ---------- */

.lang-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
    margin: 16px 0 0;
    font-size: 12.5px;
}

.lang-links a {
    color: var(--rh-muted) !important;
    text-decoration: none;
}

.lang-links a:hover {
    color: var(--rh-ink-2) !important;
    text-decoration: underline;
}

.lang-links a[aria-current] {
    color: var(--rh-ink) !important;
    font-weight: 600;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Card ---------- */

[id$="rootPanel"].ui-panel {
    width: 100%;
    margin: 0;
    padding: 0;
    background: var(--rh-surface) !important;
    border: 1px solid var(--rh-line) !important;
    border-radius: var(--rh-radius-lg) !important;
    box-shadow: var(--rh-shadow);
    /* Not overflow: hidden, which would clip the (i) tooltips */
}

/* Header: the logo, centred */
[id$="rootPanel"] > .ui-panel-titlebar {
    padding: 32px 32px 4px !important;
    background: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    text-align: center;
}

[id$="rootPanel"] > .ui-panel-titlebar table {
    width: 100%;
    border-collapse: collapse;
}

[id$="rootPanel"] > .ui-panel-titlebar td {
    padding: 0 !important;
    text-align: center !important;
}

[id$="rootPanel"] > .ui-panel-titlebar img {
    display: inline-block;
    height: 40px !important;
    width: auto;
}

[id$="rootPanel"] > .ui-panel-content {
    padding: 8px 32px 32px !important;
    background: none !important;
    border: 0 !important;
}

/* Panels inside the card are only groupings: no frame of their own */
[id$="rootPanel"] .ui-panel .ui-panel,
[id$="rootPanel"] > .ui-panel-content .ui-panel {
    margin: 0;
    background: none !important;
    border: 0 !important;
    box-shadow: none;
}

[id$="rootPanel"] > .ui-panel-content .ui-panel > .ui-panel-content {
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
}

/* ---------- Title ---------- */

[id$="registrationTitle"],
[id$="regMsg"] {
    margin: 20px 0 24px;
    text-align: center;
}

[id$="registrationTitle"] img {
    display: block;
    height: 56px !important;
    width: auto;
    margin: 0 auto 14px;
}

.titleLabel,
[id$="registrationTitle"] .ui-outputlabel,
[id$="regMsg"] .ui-outputlabel {
    display: block;
    margin: 0 !important;
    color: var(--rh-ink) !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    letter-spacing: -.01em;
    line-height: 1.3;
    text-align: center !important;
    text-wrap: balance;
}

/* A title with its (i): side by side, centred; the bubble opens below, towards the card's centre */
.title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.title-row .titleLabel,
.title-row .ui-outputlabel {
    width: auto !important;
}

.title-row .rh-info::after {
    left: auto;
    right: -10px;
    top: calc(100% + 8px);
    bottom: auto;
}

/* What the form is for, under the title */
.title-sub {
    display: block;
    max-width: 360px;
    margin: 6px auto 0;
    color: var(--rh-muted);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    text-wrap: balance;
}

/* ---------- Layout grids ---------- */

/* One-column panel grids render as tables: stack them. Some set grid column classes
   (ui-grid-col-3), which float the cells and collapse the grid */
table.ui-panelgrid,
table.ui-panelgrid > tbody,
table.ui-panelgrid > tbody > tr,
table.ui-panelgrid > tbody > tr > td {
    display: block;
    float: none !important;
    width: 100% !important;
}

.ui-panelgrid,
.ui-panelgrid > tbody > tr,
.ui-panelgrid > tbody > tr > td,
.ui-panelgrid .ui-panelgrid-cell {
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
}

[id$="personalPanel"],
[id$="allowedRegistrationTypesPanel"],
[id$="cpocPanel"] {
    display: block;
    width: 100%;
    text-align: left;
}

/* ---------- Sections and help lines ---------- */

/* A group of fields: a small heading over a hairline */
.form-section {
    display: block;
    margin: 28px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--rh-line);
    color: var(--rh-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    line-height: 1.4;
    text-transform: uppercase;
}

/* The first one sits under the title, with no rule */
[id$="personalPanel"] > .form-section:first-child {
    margin-top: 24px;
    padding-top: 0;
    border-top: 0;
}

/* What a field is for, under it */
.field-hint {
    display: block;
    margin: 6px 0 0;
    color: var(--rh-muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}

.form-section + .field-hint {
    margin-top: 8px;
}

[id$="userTypesPanel"] .form-section + table {
    margin-top: 14px !important;
}

/* A label and the (i) that explains its field */
.label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: var(--rh-field-gap) 0 var(--rh-label-gap);
}

.label-row label,
.label-row .ui-outputlabel {
    width: auto;
    margin: 0;
}

/* Beside a check box (h:panelGrid columns="2"), not in the form's own grid */
table:not(.ui-panelgrid) .label-row {
    margin: 0;
}

/* (i): the explanation shows in a bubble on hover, tap or keyboard focus */
.rh-info {
    position: relative;
    flex: 0 0 auto;
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 11v6M12 7.5v.01'/%3E%3C/svg%3E") no-repeat center / 16px;
    cursor: help;
}

.rh-info:hover,
.rh-info:focus {
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304488F' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 11v6M12 7.5v.01'/%3E%3C/svg%3E");
}

.rh-info:focus-visible {
    box-shadow: 0 0 0 3px var(--rh-brand-ring);
}

.rh-info::after {
    content: attr(data-tip);
    position: absolute;
    left: -10px;
    bottom: calc(100% + 8px);
    z-index: 20;
    width: max-content;
    max-width: min(280px, 72vw);
    padding: 8px 10px;
    background: var(--rh-ink);
    border-radius: var(--rh-radius-sm);
    box-shadow: var(--rh-shadow-pop);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.45;
    text-align: left;
    text-transform: none;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s;
}

.rh-info:hover::after,
.rh-info:focus::after {
    opacity: 1;
    visibility: visible;
}

.repeat-field + .repeat-field {
    margin-top: 8px;
}

/* ---------- Labels ---------- */

label,
.ui-outputlabel {
    display: block;
    width: 100%;
    margin: var(--rh-field-gap) 0 var(--rh-label-gap);
    color: var(--rh-ink-2);
    font-size: 14px !important;
    font-weight: 500;
    text-align: left;
}

.ui-outputlabel-rfi {
    margin-left: 2px;
    color: var(--rh-bad);
}

/* ---------- Text fields ---------- */

.ui-inputfield.ui-inputtext,
input.ui-inputtext,
input.ui-password,
.ui-password input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
select {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: var(--rh-field-height);
    margin: 0 !important;
    padding: 0 14px !important;
    background: var(--rh-surface) !important;
    border: 1px solid var(--rh-line-2) !important;
    border-radius: var(--rh-radius) !important;
    box-shadow: none !important;
    color: var(--rh-ink) !important;
    font-size: 16px !important;
    transition: border-color .2s, box-shadow .2s;
}

.ui-inputfield::placeholder,
input::placeholder {
    color: var(--rh-muted);
    opacity: 1;
}

.ui-inputfield:hover:not(.ui-state-focus):not(:focus),
input.ui-inputtext:hover:not(:focus) {
    border-color: var(--rh-muted) !important;
}

.ui-inputfield.ui-state-focus,
.ui-inputfield:focus,
input.ui-inputtext:focus,
select:focus {
    outline: none;
    border-color: var(--rh-brand) !important;
    box-shadow: 0 0 0 3px var(--rh-brand-ring) !important;
}

/* A field the server turned down */
.ui-inputfield.ui-state-error,
.ui-selectonemenu.ui-state-error,
.ui-selectmanymenu.ui-state-error {
    border-color: var(--rh-bad) !important;
}

.ui-inputfield.ui-state-error:focus,
.ui-inputfield.ui-state-error.ui-state-focus {
    box-shadow: 0 0 0 3px var(--rh-bad-ring) !important;
}

.ui-state-disabled,
.ui-inputfield:disabled {
    background: var(--rh-sunken) !important;
    color: var(--rh-muted) !important;
    cursor: not-allowed;
    opacity: 1 !important;
}

.ui-password {
    display: block;
    width: 100% !important;
}

/* ---------- Dropdowns ---------- */

.ui-selectonemenu {
    position: relative;
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    height: var(--rh-field-height);
    background: var(--rh-surface) !important;
    border: 1px solid var(--rh-line-2) !important;
    border-radius: var(--rh-radius) !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}

.ui-selectonemenu:hover:not(.ui-state-focus) {
    border-color: var(--rh-muted) !important;
}

.ui-selectonemenu.ui-state-focus {
    border-color: var(--rh-brand) !important;
    box-shadow: 0 0 0 3px var(--rh-brand-ring) !important;
}

/* The field shows the focus; its label, arrow and hidden focus input keep no frame of their own.
   The theme also outlines every focused widget (ui-state-focus): the brand ring replaces it */
.ui-state-focus,
.ui-selectonemenu:focus-visible,
.ui-selectonemenu *:focus,
.ui-selectonemenu *:focus-visible {
    outline: none !important;
}

.ui-selectonemenu .ui-selectonemenu-label,
.ui-selectonemenu .ui-selectonemenu-trigger,
.ui-selectonemenu.ui-state-focus .ui-selectonemenu-label,
.ui-selectonemenu.ui-state-focus .ui-selectonemenu-trigger {
    outline: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* PrimeFaces sizes the label in pixels; it fills the field instead */
.ui-selectonemenu .ui-selectonemenu-label {
    display: block;
    width: 100% !important;
    height: 100%;
    margin: 0;
    padding: 0 40px 0 14px !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--rh-ink) !important;
    font-size: 16px !important;
    line-height: calc(var(--rh-field-height) - 2px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.ui-selectonemenu .ui-selectonemenu-trigger {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px !important;
    height: 100%;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* A chevron in place of the theme's sprite */
.ui-selectonemenu .ui-selectonemenu-trigger .ui-icon {
    width: 100%;
    height: 100%;
    margin: 0;
    position: static;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center !important;
    text-indent: -9999px;
}

/* The open list, appended to the page body */
.ui-selectonemenu-panel {
    margin-top: 4px;
    padding: 4px;
    background: var(--rh-surface) !important;
    border: 1px solid var(--rh-line) !important;
    border-radius: var(--rh-radius) !important;
    box-shadow: var(--rh-shadow-pop) !important;
}

/* The search box at the top of a long list (Country) */
.ui-selectonemenu-panel .ui-selectonemenu-filter-container {
    position: relative;
    margin: 0 0 4px;
    padding: 4px !important;
    border-bottom: 1px solid var(--rh-line);
}

.ui-selectonemenu-panel .ui-selectonemenu-filter-container .ui-inputfield {
    height: 38px;
    padding: 0 12px 0 34px !important;
    font-size: 14px !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center / 15px, var(--rh-surface) !important;
}

.ui-selectonemenu-panel .ui-selectonemenu-filter-container .ui-icon {
    display: none;
}

.ui-selectonemenu-panel .ui-selectonemenu-items-wrapper {
    max-height: 280px !important;
}

.ui-selectonemenu-panel .ui-selectonemenu-item,
.ui-selectlistbox-item {
    margin: 0;
    padding: 8px 12px !important;
    background: none !important;
    border: 0 !important;
    border-radius: var(--rh-radius-sm) !important;
    color: var(--rh-ink) !important;
    font-size: 14px;
    cursor: pointer;
}

.ui-selectonemenu-panel .ui-selectonemenu-item.ui-state-hover,
.ui-selectonemenu-panel .ui-selectonemenu-item:hover,
.ui-selectlistbox-item.ui-state-hover,
.ui-selectlistbox-item:hover {
    background: var(--rh-sunken) !important;
}

.ui-selectonemenu-panel .ui-selectonemenu-item.ui-state-highlight,
.ui-selectlistbox-item.ui-state-highlight {
    background: var(--rh-brand-tint) !important;
    color: var(--rh-brand) !important;
    font-weight: 500;
}

/* Multiple choice list */
.ui-selectmanymenu {
    display: block;
    width: 100% !important;
    padding: 4px !important;
    background: var(--rh-surface) !important;
    border: 1px solid var(--rh-line-2) !important;
    border-radius: var(--rh-radius) !important;
    box-shadow: none !important;
}

.ui-selectmanymenu.ui-state-focus {
    border-color: var(--rh-brand) !important;
    box-shadow: 0 0 0 3px var(--rh-brand-ring) !important;
}

.ui-selectmanymenu .ui-selectlistbox-listcontainer {
    max-height: 200px !important;
    height: auto !important;
    overflow-y: auto;
}

.ui-selectmanymenu .ui-selectlistbox-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* With a check box per region: the box beside its name, and the box alone shows the choice */
.ui-selectmanymenu .ui-selectlistbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ui-selectmanymenu .ui-selectlistbox-item .ui-chkbox {
    flex: 0 0 auto;
    margin: 0;
}

.ui-selectmanymenu:has(.ui-chkbox) .ui-selectlistbox-item.ui-state-highlight {
    background: none !important;
    color: var(--rh-ink) !important;
    font-weight: 400;
}

.ui-selectmanymenu:has(.ui-chkbox) .ui-selectlistbox-item.ui-state-highlight:hover {
    background: var(--rh-sunken) !important;
}

/* ---------- Check boxes ---------- */

.ui-chkbox {
    display: inline-block;
    width: 18px !important;
    height: 18px !important;
    vertical-align: middle;
}

.ui-chkbox .ui-chkbox-box {
    width: 18px !important;
    height: 18px !important;
    background: var(--rh-surface) !important;
    border: 1px solid var(--rh-line-2) !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    cursor: pointer;
}

.ui-chkbox .ui-chkbox-box.ui-state-hover {
    border-color: var(--rh-muted) !important;
}

.ui-chkbox .ui-chkbox-box.ui-state-focus {
    box-shadow: 0 0 0 3px var(--rh-brand-ring) !important;
}

.ui-chkbox .ui-chkbox-box.ui-state-active {
    background: var(--rh-brand) !important;
    border-color: var(--rh-brand) !important;
}

.ui-chkbox .ui-chkbox-icon {
    width: 100%;
    height: 100%;
    margin: 0;
    background: none !important;
}

.ui-chkbox .ui-chkbox-box.ui-state-active .ui-chkbox-icon {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center / 12px !important;
}

/* A check box and its label, side by side (h:panelGrid columns="2") */
table:not(.ui-panelgrid):has(> tbody > tr > td > .ui-selectbooleancheckbox) {
    width: auto !important;
    margin-top: 18px;
    border-collapse: collapse;
}

table:not(.ui-panelgrid):has(> tbody > tr > td > .ui-selectbooleancheckbox) td {
    padding: 0 12px 0 0 !important;
    vertical-align: middle;
}

table:not(.ui-panelgrid):has(> tbody > tr > td > .ui-selectbooleancheckbox) label,
table:not(.ui-panelgrid):has(> tbody > tr > td > .ui-selectbooleancheckbox) .ui-outputlabel {
    margin: 0;
    color: var(--rh-ink);
    font-weight: 400;
    cursor: pointer;
}

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

.ui-button,
button.ui-button,
.ui-commandbutton {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100% !important;
    height: var(--rh-field-height);
    margin: 24px 0 0 !important;
    padding: 0 20px !important;
    background: var(--rh-brand) !important;
    border: 0 !important;
    border-radius: var(--rh-radius) !important;
    box-shadow: none !important;
    color: var(--rh-on-brand) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-shadow: none !important;
    text-transform: none !important;
    cursor: pointer;
    transition: background-color .2s;
}

.ui-button.ui-state-hover,
.ui-button:hover {
    background: var(--rh-brand-hover) !important;
}

.ui-button.ui-state-active,
.ui-button:active {
    background: var(--rh-brand-hover) !important;
}

.ui-button.ui-state-focus,
.ui-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--rh-brand-ring) !important;
}

.ui-button.ui-state-disabled,
.ui-button:disabled {
    background: var(--rh-brand) !important;
    color: var(--rh-on-brand) !important;
    opacity: .55 !important;
    cursor: not-allowed;
}

.ui-button .ui-button-text {
    padding: 0 !important;
    color: inherit !important;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.2;
}

/* An icon beside the text, in line rather than pinned to the left edge */
.ui-button .ui-button-icon-left,
.ui-button .ui-button-icon-right {
    position: static !important;
    margin: 0 !important;
    color: inherit;
    background: none !important;
    text-indent: 0;
}

/* A second action beside the main one (Generate Password): outlined, as in the console */
.ui-button[id$="generatePwdBtn"],
.ui-button.rh-secondary {
    margin-top: 12px !important;
    background: var(--rh-surface) !important;
    border: 1px solid var(--rh-line-2) !important;
    color: var(--rh-brand) !important;
}

.ui-button[id$="generatePwdBtn"].ui-state-hover,
.ui-button[id$="generatePwdBtn"]:hover,
.ui-button.rh-secondary:hover {
    background: var(--rh-sunken) !important;
}

/* The password Generate Password made */
.generated-password {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--rh-ok-bg);
    border: 1px solid var(--rh-ok);
    border-radius: var(--rh-radius);
    color: var(--rh-ink);
    font-size: 14px;
    line-height: 1.6;
}

.generated-password code {
    padding: 2px 8px;
    background: var(--rh-surface);
    border: 1px solid var(--rh-line);
    border-radius: var(--rh-radius-sm);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
}

.generated-password .hint {
    margin-left: 6px;
    color: var(--rh-muted);
}

/* ---------- Dialogs ---------- */

.ui-dialog {
    padding: 0 !important;
    background: var(--rh-surface) !important;
    border: 1px solid var(--rh-line) !important;
    border-radius: var(--rh-radius-lg) !important;
    box-shadow: var(--rh-shadow-pop) !important;
    color: var(--rh-ink);
}

.ui-dialog .ui-dialog-titlebar {
    padding: 16px 20px 8px !important;
    background: none !important;
    border: 0 !important;
    color: var(--rh-ink) !important;
    font-size: 16px;
    font-weight: 600;
}

.ui-dialog .ui-dialog-content {
    padding: 4px 20px 16px !important;
    color: var(--rh-ink-2);
    font-size: 14px;
    line-height: 1.6;
}

.ui-dialog .ui-dialog-footer {
    padding: 0 20px 20px !important;
    background: none !important;
    border: 0 !important;
    text-align: right;
}

.ui-dialog .ui-dialog-footer .ui-button {
    width: auto !important;
    margin: 0 !important;
}

.ui-widget-overlay {
    background: rgba(15, 27, 45, .45) !important;
    opacity: 1 !important;
}

/* ---------- Messages ---------- */

.ui-messages {
    margin: 0 0 8px;
    width: 100% !important;
    text-align: left;
}

.ui-messages > div {
    position: relative;
    margin: 16px 0 0;
    padding: 12px 40px 12px 16px;
    border: 1px solid transparent;
    border-radius: var(--rh-radius) !important;
    font-size: 14px;
    line-height: 1.45;
}

.ui-messages ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.ui-messages li span {
    margin: 0 !important;
}

.ui-messages li + li {
    margin-top: 4px;
}

.ui-messages-error,
.ui-messages-fatal {
    background: var(--rh-bad-bg) !important;
    border-color: var(--rh-bad) !important;
    color: var(--rh-bad) !important;
}

.ui-messages-warn {
    background: var(--rh-warn-bg) !important;
    border-color: var(--rh-warn) !important;
    color: var(--rh-warn) !important;
}

.ui-messages-info {
    background: var(--rh-brand-tint) !important;
    border-color: var(--rh-brand) !important;
    color: var(--rh-brand) !important;
}

.ui-messages-error-summary,
.ui-messages-fatal-summary,
.ui-messages-warn-summary,
.ui-messages-info-summary {
    font-weight: 600;
}

.ui-messages-error-detail,
.ui-messages-fatal-detail,
.ui-messages-warn-detail,
.ui-messages-info-detail {
    margin-left: 4px;
}

.ui-messages-error-icon,
.ui-messages-fatal-icon,
.ui-messages-warn-icon,
.ui-messages-info-icon {
    display: none !important;
}

/* The close cross, top right */
.ui-messages-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    opacity: .7;
}

.ui-messages-close:hover {
    opacity: 1;
}

.ui-messages-close .ui-icon {
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") no-repeat center / 14px !important;
}

/* ---------- reCAPTCHA ---------- */

#recaptchaContainer {
    display: flex;
    justify-content: center;
    margin: 24px 0 0 !important;
}

.ui-captcha,
.ui-captcha > div {
    margin: 0 auto;
}

/* ---------- Welcome page: the two ways to join ---------- */

[id$="regPanelZero"] .buttonClass {
    padding: 0;
}

[id$="regPanelZero"] .buttonClass + .buttonClass {
    margin-top: 12px;
}

.p-grid {
    display: flex !important;
    align-items: center;
    gap: 16px;
    margin: 0 !important;
}

.p-grid .p-col {
    flex: 0 0 auto;
    padding: 0 !important;
}

.p-grid .p-col:last-child {
    flex: 1 1 auto;
}

.p-grid img {
    display: block;
    width: 40px;
    height: 40px !important;
}

.p-grid .ui-button {
    margin: 0 !important;
}

/* The two ways to join, as cards: icon, title, who it is for, and an arrow */
a.join-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--rh-surface);
    border: 1px solid var(--rh-line);
    border-radius: var(--rh-radius-lg);
    color: var(--rh-ink) !important;
    text-align: left;
    text-decoration: none;
    transition: border-color .2s, background-color .2s;
}

a.join-option + a.join-option {
    margin-top: 12px;
}

a.join-option:hover {
    background: var(--rh-brand-tint);
    border-color: var(--rh-brand);
    text-decoration: none;
}

a.join-option:focus-visible {
    outline: none;
    border-color: var(--rh-brand);
    box-shadow: 0 0 0 3px var(--rh-brand-ring);
}

a.join-option img {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
}

.join-option-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.join-option-title {
    color: var(--rh-ink);
    font-size: 16px;
    font-weight: 600;
}

.join-option-desc {
    color: var(--rh-muted);
    font-size: 13.5px;
    line-height: 1.45;
}

.join-option-chevron {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304488F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") no-repeat center / 16px;
}

/* ---------- Done, error and information pages ---------- */

[id$="regPanelZero"] {
    color: var(--rh-ink);
    font-size: 15px;
    line-height: 1.55;
    text-align: center !important;
}

[id$="regPanelZero"] > tbody > tr > td + td,
[id$="regPanelZero"] > tbody > tr + tr > td {
    padding-top: 12px !important;
}

/* ---------- Status pages: done, reset and reminder ---------- */

.success-container,
.error-container {
    padding: 8px 0 0;
    text-align: center;
}

.success-icon,
.error-icon,
.reminder-icon {
    margin: 12px 0 16px;
    font-size: 40px;
    line-height: 1;
    text-align: center;
}

.success-icon {
    color: var(--rh-ok);
}

.error-icon {
    color: var(--rh-bad);
}

.reminder-icon {
    color: var(--rh-brand);
}

.reminder-icon + [id$="registrationTitle"] {
    margin-top: 0;
}

.success-title,
.error-title {
    margin: 0 0 16px;
    color: var(--rh-ink);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    text-wrap: balance;
}

.success-message {
    max-width: 400px;
    margin: 0 auto 24px;
    color: var(--rh-ink-2);
    font-size: 15px;
    line-height: 1.55;
}

.email-info,
.error-message,
.info-text {
    max-width: 400px;
    margin: 0 auto 20px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: var(--rh-radius);
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
}

.email-info {
    background: var(--rh-ok-bg);
    border-color: var(--rh-ok);
    color: var(--rh-ok);
}

.error-message {
    background: var(--rh-bad-bg);
    border-color: var(--rh-bad);
    color: var(--rh-bad);
}

.info-text {
    max-width: none;
    margin: 0 0 4px;
    background: var(--rh-brand-tint);
    color: var(--rh-ink-2);
}

.email-info i,
.error-message i,
.info-text i {
    margin-right: 8px !important;
}

.info-text i {
    color: var(--rh-brand);
}

.tips-section {
    max-width: 400px;
    margin: 24px auto 0;
    padding: 16px;
    background: var(--rh-sunken);
    border-radius: var(--rh-radius);
    color: var(--rh-ink-2);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

.tips-section h4 {
    margin: 0 0 8px;
    color: var(--rh-ink);
    font-size: 14px;
    font-weight: 600;
}

.tips-section h4 i {
    margin-right: 6px;
    color: var(--rh-warn);
}

.tips-section ul {
    margin: 0;
    padding-left: 18px;
}

.tips-section li + li {
    margin-top: 4px;
}

/* Check your email: the envelope in brand blue */
.success-icon.mail {
    color: var(--rh-brand);
}

.success-message strong {
    color: var(--rh-ink);
    font-weight: 600;
    word-break: break-all;
}

/* What happens next, as numbered steps */
.next-steps {
    max-width: 400px;
    margin: 0 auto 20px;
    padding: 16px;
    background: var(--rh-brand-tint);
    border-radius: var(--rh-radius);
    color: var(--rh-ink-2);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

.next-steps h4 {
    margin: 0 0 10px;
    color: var(--rh-ink);
    font-size: 14px;
    font-weight: 600;
}

.next-steps ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.next-steps li {
    position: relative;
    padding-left: 32px;
    counter-increment: step;
}

.next-steps li + li {
    margin-top: 10px;
}

.next-steps li::before {
    content: counter(step);
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--rh-brand);
    color: var(--rh-on-brand);
    font-size: 12px;
    font-weight: 600;
    line-height: 22px;
    text-align: center;
}

/* A secondary way out, under the main content */
.quiet-link {
    margin-top: 20px;
    font-size: 14px;
    text-align: center;
}

/* Back to the sign-in page: the console's primary button */
a.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--rh-field-height);
    padding: 0 24px;
    background: var(--rh-brand);
    border-radius: var(--rh-radius);
    color: var(--rh-on-brand) !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s;
}

a.back-button:hover {
    background: var(--rh-brand-hover);
    text-decoration: none;
}

a.back-button i {
    margin: 0 !important;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 520px) {
    body {
        padding: 16px 12px;
    }

    [id$="rootPanel"] > .ui-panel-titlebar {
        padding: 24px 20px 0 !important;
    }

    [id$="rootPanel"] > .ui-panel-content {
        padding: 8px 20px 24px !important;
    }

    .titleLabel,
    [id$="registrationTitle"] .ui-outputlabel {
        font-size: 20px !important;
    }
}

/* reCAPTCHA is 304px wide: scaled down to fit the narrowest phones */
@media (max-width: 360px) {
    #recaptchaContainer > div {
        transform: scale(.88);
        transform-origin: center top;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

/* ---------- Two short related fields on one row (first / last name, title / phone) ---------- */

.form-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
}

.form-pair > div {
    min-width: 0;
}

@media (max-width: 420px) {
    .form-pair {
        grid-template-columns: 1fr;
    }
}

/* ---------- Advanced settings: closed until opened ---------- */

.form-advanced {
    display: block;
    margin: 28px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--rh-line);
    text-align: left;
}

.form-advanced > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    max-width: 100%;
    color: var(--rh-brand);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.form-advanced > summary::-webkit-details-marker {
    display: none;
}

/* A chevron that turns when open */
.form-advanced > summary::before {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .15s ease;
}

.form-advanced[open] > summary::before {
    transform: rotate(45deg);
}

.form-advanced > summary:hover {
    color: var(--rh-brand-hover);
}

.form-advanced > summary:focus-visible {
    outline: 2px solid var(--rh-brand-ring);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Its first section heading sits under the summary, with no second rule */
[id$="advancedContent"] > [id$="userTypesPanel"] > .form-section:first-child {
    margin-top: 18px;
    padding-top: 0;
    border-top: 0;
}

@media (prefers-reduced-motion: reduce) {
    .form-advanced > summary::before {
        transition: none;
    }
}

/* ---------- Other clouds: a switch each, then its regions ---------- */

.cloud-choice {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--rh-line);
    border-radius: var(--rh-radius);
    background: var(--rh-surface);
}

.cloud-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cloud-switch label,
.cloud-switch .ui-outputlabel {
    width: auto;
    margin: 0;
    font-weight: 600;
}

.cloud-regions {
    margin-top: 4px;
}

/* A cloud's switch: a plain checkbox drawn as a switch (sent with the form, no widget script) */
input.rh-switch {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: none;
    width: 40px;
    height: 22px;
    margin: 0;
    border-radius: 11px;
    background: var(--rh-line);
    cursor: pointer;
    transition: background .15s;
}

input.rh-switch::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    transition: transform .15s;
}

input.rh-switch:checked {
    background: var(--rh-brand);
}

input.rh-switch:checked::before {
    transform: translateX(18px);
}

input.rh-switch:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--rh-brand-ring);
}

@media (prefers-reduced-motion: reduce) {
    input.rh-switch,
    input.rh-switch::before {
        transition: none;
    }
}
