/*
 * Bootstrap 3 look-and-feel compatibility layer.
 *
 * The auth-ui markup was written for Bootstrap 3. After upgrading the webjar to
 * a secure Bootstrap 5 release, this stylesheet restores the visual appearance
 * of the Bootstrap 3 classes that are still used in the templates (panels,
 * form-group, control-label, btn-block, pull-right, list-inline, bg-success)
 * as well as the Bootstrap 3 base typography, buttons and form controls, so the
 * pages keep looking the same. Load it right AFTER bootstrap.min.css.
 */

/* ------------------------------------------------------------------ *
 * Base typography (Bootstrap 3 defaults)
 * ------------------------------------------------------------------ */
body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.42857143;
    color: #333;
}

p {
    margin: 0 0 10px;
}

a {
    color: #337ab7;
    text-decoration: none;
    font-weight: bold;
}

a:hover,
a:focus {
    color: #23527c;
    text-decoration: underline;
}

hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
    color: inherit;
    background-color: transparent;
    opacity: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-weight: 500;
    line-height: 1.1;
    color: inherit;
    margin-top: 20px;
    margin-bottom: 10px;
}

h1 { font-size: 36px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 18px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; }

/* ------------------------------------------------------------------ *
 * Grid: keep the Bootstrap 3 gutter width (15px per side)
 * ------------------------------------------------------------------ */
.row {
    --bs-gutter-x: 30px;
}

/*
 * The .row class is used on some templates purely as a container that stacks
 * its children (login card, language selector) rather than as a real grid.
 * Bootstrap 5 turns .row into a flex row which would break that layout, so
 * restore the Bootstrap 3 block behaviour. Real grids (.row > .col-*) are left
 * untouched.
 *
 * IMPORTANT: only override "display" here. The horizontal margins of
 * .login-card are controlled by style.css (margin: 30px auto) which keeps the
 * card centered. Setting margins here would have higher specificity and break
 * that centering.
 */
.row.login-card {
    display: block;
}

/*
 * Bootstrap 5 adds gutter padding to every direct child of a .row via the
 * ".row > *" selector. For the login-card container (which is not a real grid)
 * that padding is unwanted, so remove it for its direct children. Real grids
 * (.row > .col-*) are not matched by this selector and keep their gutters.
 */
.row.login-card > * {
    padding-right: 0;
    padding-left: 0;
}

/*
 * Language selector: in Bootstrap 3 this is a ".row.nav" block containing a
 * right-floated ".list-inline" (the .row provided the float-clearing). Bootstrap
 * 5 turns .row/.nav into flex and underlines links, which broke the layout.
 * Reproduce the Bootstrap 3 behaviour explicitly: a block container that clears
 * its right-floated, single-line inline list, without link underline.
 */
#languageselector {
    display: block;
    text-align: right;
    margin-right: -15px;
    margin-left: -15px;
    margin-bottom: 5px;
}

#languageselector::after {
    display: block;
    clear: both;
    content: "";
}

#languageselector > ul {
    float: right;
    padding-left: 0;
    padding-right: 20px;
    margin: 0;
    list-style: none;
    font-size: 85%;
}

#languageselector > ul > li {
    display: inline-block;
    padding-right: 5px;
    padding-left: 5px;
}

#languageselector a {
    font-weight: 700;
    text-decoration: none;
}

#languageselector a:hover,
#languageselector a:focus {
    text-decoration: none;
}

/* ------------------------------------------------------------------ *
 * Panels (removed in Bootstrap 4/5)
 * ------------------------------------------------------------------ */
.panel {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}

.panel-default {
    border-color: #ddd;
}

.panel-body {
    padding: 15px;
}

.panel-body::after {
    display: table;
    clear: both;
    content: " ";
}

.panel-heading {
    padding: 10px 15px;
    border-bottom: 1px solid transparent;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    font-weight: bold;
}

.panel-default > .panel-heading {
    color: #333;
    background-color: #f5f5f5;
    border-color: #ddd;
}

.panel-title {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 16px;
    color: inherit;
}

.panel-footer {
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    border-bottom-right-radius: 3px;
    border-bottom-left-radius: 3px;
}

/* ------------------------------------------------------------------ *
 * Forms
 * ------------------------------------------------------------------ */
.form-group {
    margin-bottom: 15px;
}

label {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 5px;
    font-weight: 700;
}

.control-label {
    font-weight: 700;
}

.form-control {
    display: block;
    width: 100%;
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.form-control:focus {
    border-color: #66afe9;
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
}

/* Bootstrap 3 error highlighting used via th:errorclass / classappend */
.form-control.alert-danger,
input.alert-danger {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

/* ------------------------------------------------------------------ *
 * Buttons (Bootstrap 3 palette + block modifier)
 * ------------------------------------------------------------------ */
.btn {
    --bs-btn-font-size: 14px;
    --bs-btn-line-height: 1.42857143;
    --bs-btn-padding-y: 6px;
    --bs-btn-padding-x: 12px;
    --bs-btn-border-radius: 4px;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #337ab7;
    --bs-btn-border-color: #2e6da4;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #286090;
    --bs-btn-hover-border-color: #204d74;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #204d74;
    --bs-btn-active-border-color: #122b40;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #337ab7;
    --bs-btn-disabled-border-color: #2e6da4;
}

.btn-default {
    --bs-btn-color: #333;
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #ccc;
    --bs-btn-hover-color: #333;
    --bs-btn-hover-bg: #e6e6e6;
    --bs-btn-hover-border-color: #adadad;
    --bs-btn-active-color: #333;
    --bs-btn-active-bg: #e6e6e6;
    --bs-btn-active-border-color: #adadad;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-block + .btn-block {
    margin-top: 5px;
}

/* Submit buttons rendered as <input> should match block styling too */
input.btn-block {
    display: block;
    width: 100%;
}

/* ------------------------------------------------------------------ *
 * Helpers removed / changed in Bootstrap 5
 * ------------------------------------------------------------------ */
.pull-right {
    float: right !important;
}

.pull-left {
    float: left !important;
}

.list-inline {
    padding-left: 0;
    margin-left: -5px;
    list-style: none;
}

.list-inline > li {
    display: inline-block;
    padding-right: 5px;
    padding-left: 5px;
}

.small,
small {
    font-size: 85%;
}

.clearfix::after {
    display: table;
    clear: both;
    content: " ";
}

/* Contextual background used for the "logged out" hint (Bootstrap 3 colours) */
.bg-success {
    color: #3c763d !important;
    background-color: #dff0d8 !important;
}

/* ------------------------------------------------------------------ *
 * List group items rendered as links (Bootstrap 3 look)
 * ------------------------------------------------------------------ */
.list-group {
    padding-left: 0;
    margin-bottom: 20px;
}

a.list-group-item {
    color: #555;
    font-weight: bold;
}

a.list-group-item:hover,
a.list-group-item:focus {
    color: #555;
    text-decoration: none;
    background-color: #f5f5f5;
}
