/*
 * MENDELU IdP theme stylesheet
 *
 * WHO EDITS THIS FILE: visual / brand collaborator (HTML/CSS/JS)
 * Deployed to: /opt/shibboleth-idp/edit-webapp/css/mendelu.css
 * Wired via messages key: idp.css = /css/mendelu.css
 * After CSS or image change: Ansible rebuilds idp.war and restarts Jetty.
 *
 * Markers:
 *   VISUAL:…  — change freely for look & feel
 *   KEEP:…    — required by IdP HTML structure; do not remove selectors
 *
 * Background image path is relative to this CSS file in the WAR:
 *   edit-webapp/images/background.png  →  url("../images/background.png")
 */

/* === VISUAL: design tokens (brand colours, spacing) ===================== */
:root {
    --mendelu-primary: #79be15;       /* VISUAL: primary action / links */
    --mendelu-primary-hover: #65a110; /* VISUAL: primary hover */
    --mendelu-text: #151515;          /* VISUAL: body text */
    --mendelu-border: #8a8d90;        /* VISUAL: input border */
    --mendelu-border-soft: #d2d2d2;   /* VISUAL: dividers */
    --mendelu-card-bg: #ffffff;       /* VISUAL: login card background */
    --mendelu-error-bg: #fff0f3;      /* VISUAL: error banner background */
    --mendelu-error-fg: #b50024;      /* VISUAL: error banner text */
    --mendelu-success-bg: #dcf9e7;    /* VISUAL: success banner background */
    --mendelu-success-fg: #1c7d40;    /* VISUAL: success banner text */
    --mendelu-font: "RedHatDisplay", "Open Sans", Helvetica, Arial, sans-serif;
    /* VISUAL: if you ship webfonts, add @font-face above and keep font-src in Jetty CSP in sync */
}

/* === VISUAL: page background ============================================ */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--mendelu-font);
    /* VISUAL: replace background.png or change to a solid colour */
    background: url("../images/background.png") no-repeat center center fixed;
    background-size: cover;
    -webkit-font-smoothing: antialiased;
    color: var(--mendelu-text);
}

/* KEEP: outer shell used by login / logout / error views */
.wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    padding: 5px;
    /* VISUAL: overall scale of the card composition */
    transform: scale(0.9);
    transform-origin: center;
}

/* === VISUAL: login card ================================================= */
.container {
    background-color: var(--mendelu-card-bg);
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 500px;
    padding: 30px 40px 40px 40px;
    box-sizing: border-box;
}

.container > img {
    display: block;
    max-width: 225px;
    height: auto;
    margin: 0 auto 1em auto;
}

/* KEEP: header logo (institution) */
header {
    text-align: center;
    margin: 0 0 2em 0;
}

header img,
.main-logo {
    width: 15rem;
    height: auto;
    display: block;
    margin: 0 auto;
}

legend,
.login-title {
    display: block;
    width: 100%;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--mendelu-text);
    margin-bottom: 20px;
    border: none;
    text-align: left;
}

/* KEEP: form controls */
.form-element-wrapper {
    margin-bottom: 0.8em;
    position: relative;
}

.form-element-wrapper label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--mendelu-text);
    margin-bottom: 8px;
}

.form-field,
input[type="text"],
input[type="password"] {
    width: 100%;
    height: 36px;
    padding: 6px 12px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--mendelu-text);
    background-color: #fff;
    border: 1px solid var(--mendelu-border);
    border-bottom: 2px solid var(--mendelu-text);
    border-radius: 3px;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out;
}

.form-field:focus,
input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--mendelu-primary);
    border-bottom-color: var(--mendelu-primary);
    outline: none;
}

.form-element-wrapper input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}

.form-element-wrapper input[type="checkbox"] + label {
    display: inline;
    font-weight: 400;
    font-size: 14px;
}

.form-element-wrapper:has(.form-button),
.grid {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
}

.form-button,
button[type="submit"] {
    width: 30%;
    min-width: 160px;
    max-width: 100%;
    white-space: nowrap;
    height: 40px;
    background-color: var(--mendelu-primary);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.form-button.secondary,
button.button--secondary {
    width: auto;
    min-width: 100px;
    background-color: #6c757d;
}

.form-button:hover,
button[type="submit"]:hover {
    background-color: var(--mendelu-primary-hover);
}

.content {
    display: flex;
    flex-direction: column;
}

.column.one > img,
.service-logo {
    display: block;
    margin: 20px auto;
    max-width: 110px;
    height: auto;
}

.column.one p,
section p {
    margin: 0.5em 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--mendelu-text);
    text-align: left;
}

.column.two {
    margin-top: 25px;
    border-top: 1px solid var(--mendelu-border-soft);
    padding-top: 15px;
}

.list-help,
section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
}

.list-help-item a,
section ul a {
    color: var(--mendelu-primary);
    text-decoration: none;
    font-size: 14px;
}

.list-help-item a:hover,
section ul a:hover {
    text-decoration: underline;
}

.item-marker {
    display: none;
}

/* === VISUAL: footer (on photo background) =============================== */
footer,
.footer {
    margin-top: 1em;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    font-size: 13px;
    text-align: center;
}

/* KEEP: IdP 5 stock class names also used by logout / error */
main.main {
    clear: both;
    margin: 0 auto;
    width: 100%;
    max-width: 500px;
    background-color: var(--mendelu-card-bg);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 30px 40px 40px 40px;
    box-sizing: border-box;
}

.output-message {
    font-size: 14px;
    font-style: italic;
    display: block;
    padding: 4%;
    margin-bottom: 20px;
    border-radius: 4px;
}

.output-message.output--error {
    background-color: var(--mendelu-error-bg);
    color: var(--mendelu-error-fg);
}

.output-message.output--success {
    background-color: var(--mendelu-success-bg);
    color: var(--mendelu-success-fg);
}

.grid:before,
.grid:after {
    content: " ";
    display: table;
}

.grid:after {
    clear: both;
}

.grid > .grid-item {
    margin-bottom: 18px;
    min-height: 1px;
    width: 100%;
}

/* VISUAL: password visibility control (button, not emoji in HTML) */
.password-toggle {
    position: absolute;
    right: 8px;
    bottom: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: var(--mendelu-border);
    padding: 4px 8px;
}

.password-toggle:hover {
    color: var(--mendelu-text);
}
