/* ═══════════════════════════════════════════════════════
 Wywiad przed wizytą — motyw logowania (przeniesiony z medbot.medsi.pl, «MedNote — Keycloak Theme v5»)                                                *
 Standalone — no default login.css loaded
 ═══════════════════════════════════════════════════════ */

@import url('/czcionki/czcionki.css');   /* czcionki z naszego serwera (Caddy), nie z Google Fonts */

:root {
    --sage-50: #f6f7f4;
    --sage-100: #e8ebe3;
    --sage-200: #d3d9c9;
    --sage-300: #b4bfa4;
    --sage-400: #96a67f;
    --sage-500: #7a8d63;
    --sage-600: #5f704c;
    --sage-700: #4b583d;
    --sage-800: #3e4834;
    --sage-900: #353d2e;
    --sage-950: #1a2016;
    --medical-50: #f0f7f4;
    --medical-100: #dbeee5;
    --medical-200: #b9ddce;
    --medical-400: #59a78d;
    --medical-500: #3a8b72;
    --medical-600: #2b705c;
    --medical-700: #245a4b;
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    background: var(--sage-50) !important;
    background-image: none !important;
    color: var(--sage-900) !important;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    align-items: safe center;
    padding: 40px 16px;
    -webkit-font-smoothing: antialiased;
}

/* Kill PatternFly / Keycloak default backgrounds */
html,
body,
.login-pf,
.login-pf body,
.login-pf-page,
.pf-c-login,
.pf-c-background-image,
div[class*="pf-c-background"],
#kc-login-page-container {
    background: var(--sage-50) !important;
    background-image: none !important;
    background-color: var(--sage-50) !important;
}

/* Hide PF background image container entirely */
.pf-c-background-image,
.pf-c-background-image::before,
.pf-c-background-image::after,
.pf-c-background-image svg,
.pf-c-background-image__filter,
.login-pf .container::before,
.login-pf .container::after {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

/* PF login wrapper */
.pf-c-login {
    min-height: 100vh !important;
    background: var(--sage-50) !important;
    background-image: none !important;
}

.pf-c-login__main {
    background: transparent !important;
    box-shadow: none !important;
    max-width: 460px !important;
    margin: 0 auto !important;
}

.pf-c-login__main-body {
    background: transparent !important;
    padding: 0 !important;
}

/* Background blobs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::before {
    top: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: rgba(219, 238, 229, 0.35);
    filter: blur(100px);
}

body::after {
    bottom: -15%;
    left: -10%;
    width: 45vw;
    height: 45vw;
    background: rgba(232, 235, 227, 0.4);
    filter: blur(80px);
}

/* ══════════════════════════════
 L ayout — single centered column                                            *
 ══════════════════════════════ */
#kc-header,
#kc-content,
#kc-form,
#kc-form-wrapper,
#kc-info,
.login-pf-page,
.card-pf,
.container-fluid,
.row,
[class*="col-"] {
    display: block;
    width: 100%;
    max-width: 100%;
    float: none;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

/* Center wrapper */
#kc-container,
#kc-container-wrapper,
.login-pf {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ══════════════════════════════
 H eader                                                                     *
 ══════════════════════════════ */
#kc-header {
    text-align: center;
    margin-bottom: 32px;
}

#kc-header-wrapper {
    font-family: 'DM Serif Display', serif !important;
    font-size: 1.25rem !important;
    color: var(--sage-900) !important;
    text-shadow: none !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.5s ease both;
}

/* Stethoscope icon */
#kc-header-wrapper::before {
    content: '';
    display: inline-block;
    width: 32px;
    height: 32px;
    background: var(--medical-600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.8 2.3A.3.3 0 1 0 5 2H4a2 2 0 0 0-2 2v5a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6V4a2 2 0 0 0-2-2h-1a.2.2 0 1 0 .3.3'/%3E%3Cpath d='M8 15v1a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6v-4'/%3E%3Cpath d='M22 10 A2 2 0 0 0 20 8'/%3E%3Cpath d='M22 10 A2 2 0 0 1 20 12'/%3E%3C/svg%3E") no-repeat center;
    border-radius: 8px;
    flex-shrink: 0;
}

/* ══════════════════════════════
 T he Card                                                                   *
 ══════════════════════════════ */
#kc-form-wrapper {
    background: white !important;
    border: 1px solid rgba(211, 217, 201, 0.45) !important;
    border-radius: 20px !important;
    box-shadow: 0 1px 2px rgba(53, 61, 46, 0.03), 0 8px 40px rgba(53, 61, 46, 0.06) !important;
    padding: 40px !important;
    animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

/* ══════════════════════════════
 P age title                                                                 *
 ══════════════════════════════ */
#kc-page-title,
h1#kc-page-title,
.pf-c-title,
.pf-c-login__main-header .pf-c-title {
    font-family: 'DM Serif Display', serif !important;
    font-size: 1.5rem !important;
    font-weight: 400 !important;
    color: var(--sage-950) !important;
    text-align: center;
    margin-bottom: 28px !important;
    line-height: 1.3;
}

/* "Required fields" hint */
.subtitle,
span.subtitle {
    display: block;
    text-align: right;
    font-size: 0.6875rem;
    color: var(--sage-400);
    margin-bottom: 8px;
}

/* ══════════════════════════════
 L abels                                                                     *
 ══════════════════════════════ */
label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sage-600);
    margin-bottom: 6px;
}

/* ══════════════════════════════
 I nputs                                                                     *
 ══════════════════════════════ */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea,
.pf-c-form-control {
    display: block;
    width: 100% !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.9375rem !important;
    background: var(--sage-50) !important;
    border: 1.5px solid var(--sage-200) !important;
    border-radius: 10px !important;
    padding: 11px 14px !important;
    color: var(--sage-900) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    height: auto !important;
    line-height: 1.5 !important;
}


input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
.pf-c-form-control:hover {
    border-color: var(--sage-300) !important;
    background: white !important;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
.pf-c-form-control:focus {
    border-color: var(--medical-400) !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(43, 112, 92, 0.1) !important;
}

input::placeholder {
    color: var(--sage-400);
    font-weight: 300;
}

#password {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

#password-confirm {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* ══════════════════════════════
 F orm groups                                                                *
 ══════════════════════════════ */
.form-group {
    margin-bottom: 16px;
}

/* ══════════════════════════════
 C heckbox                                                                   *
 ══════════════════════════════ */
input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--medical-600);
    cursor: pointer;
    vertical-align: middle;
    margin-right: 6px;
}

.checkbox label {
    display: inline-flex;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--sage-500);
    font-weight: 400;
    cursor: pointer;
}

/* Options row (remember me + forgot password) */
#kc-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

#kc-form-options .col-md-6,
#kc-form-options .col-xs-6,
#kc-form-options [class*="col-"] {
    width: auto;
    flex: none;
}

/* ══════════════════════════════
 B uttons                                                                    *
 ══════════════════════════════ */
#kc-form-buttons {
    margin-top: 24px;
}

input[type="submit"],
button[type="submit"],
.btn-primary,
.pf-c-button.pf-m-primary,
#kc-login,
#kc-form-buttons input[type="submit"],
#kc-form-buttons .btn-primary {
    display: block;
    width: 100% !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    background: var(--medical-600) !important;
    background-color: var(--medical-600) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 24px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 4px rgba(43, 112, 92, 0.15) !important;
    line-height: 1.5 !important;
    text-align: center;
}

input[type="submit"]:hover,
button[type="submit"]:hover,
.btn-primary:hover,
.pf-c-button.pf-m-primary:hover,
#kc-login:hover {
    background: var(--medical-700) !important;
    background-color: var(--medical-700) !important;
    box-shadow: 0 4px 16px rgba(43, 112, 92, 0.25) !important;
}

input[type="submit"]:active,
button[type="submit"]:active,
.pf-c-button.pf-m-primary:active {
    transform: scale(0.985);
}

input[type="submit"]:focus,
button[type="submit"]:focus,
.pf-c-button.pf-m-primary:focus {
    background: var(--medical-600) !important;
    outline: 2px solid var(--medical-400) !important;
    outline-offset: 2px !important;
}

.btn-default {
    display: inline-block;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    background: white;
    color: var(--sage-600);
    border: 1.5px solid var(--sage-200);
    border-radius: 12px;
    padding: 10px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-default:hover {
    background: var(--sage-50);
    border-color: var(--sage-300);
}

/* ══════════════════════════════
 T erms and conditions                                                       *
 ══════════════════════════════ */
#kc-terms-text {
    width: min(640px, calc(100vw - 48px));
    margin-left: 50%;
    transform: translateX(-50%);
    max-height: 45vh;
    overflow-y: auto;
    background: var(--sage-50);
    border: 1.5px solid var(--sage-200);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--sage-800);
}

#kc-terms-text h2,
#kc-terms-text h3 {
    font-family: 'DM Serif Display', serif;
    color: var(--sage-950);
    margin: 16px 0 8px;
    font-weight: 400;
}

#kc-terms-text h2:first-child,
#kc-terms-text h3:first-child {
    margin-top: 0;
}

#kc-terms-text p {
    margin-bottom: 8px;
}

#kc-terms-text ol {
    padding-left: 20px;
    margin-bottom: 8px;
}

#kc-terms-text li {
    margin-bottom: 4px;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-actions #kc-decline {
    background: white !important;
    background-color: white !important;
    color: var(--sage-600) !important;
    border: 1.5px solid var(--sage-200) !important;
    box-shadow: none !important;
}

.form-actions #kc-decline:hover {
    background: var(--sage-50) !important;
    background-color: var(--sage-50) !important;
    border-color: var(--sage-300) !important;
}

/* ══════════════════════════════
 L inks                                                                      *
 ══════════════════════════════ */
a {
    color: var(--medical-600);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--medical-700);
    text-decoration: underline;
}

/* ══════════════════════════════
 R egistration & info links                                                  *
 ══════════════════════════════ */
#kc-registration {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--sage-100);
}

#kc-registration span {
    font-size: 0.8125rem;
    color: var(--sage-400);
}

#kc-info {
    text-align: center;
    margin-top: 20px;
}

#kc-info-wrapper {
    font-size: 0.8125rem;
    color: var(--sage-400);
}

/* Back to login on register page */
#kc-form-options a {
    font-size: 0.8125rem;
}

/* ══════════════════════════════
 S ocial / Identity Providers                                                *
 ══════════════════════════════ */
#kc-social-providers {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--sage-100);
}

#kc-social-providers ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#kc-social-providers li {
    margin: 0;
}

#kc-social-providers a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1.5px solid var(--sage-200);
    border-radius: 10px;
    background: white;
    color: var(--sage-700);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

#kc-social-providers a:hover {
    background: var(--sage-50);
    border-color: var(--sage-300);
}

/* ══════════════════════════════
 A lerts                                                                     *
 ══════════════════════════════ */
.alert {
    border-radius: 10px;
    padding: 11px 14px;
    margin-bottom: 20px;
    font-size: 0.8125rem;
    border: 1px solid;
}

.alert-error,
.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.alert-success {
    background: var(--medical-50);
    border-color: var(--medical-200);
    color: var(--medical-700);
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: var(--sage-800);
}

.alert-info {
    background: var(--medical-50);
    border-color: var(--medical-200);
    color: var(--medical-700);
}

/* ══════════════════════════════
 R equired asterisk                                                          *
 ══════════════════════════════ */
.required {
    color: #dc2626;
}

/* ══════════════════════════════
 P assword toggle (if present)                                               *
 ══════════════════════════════ */
.pf-c-input-group,
.input-group {
    display: flex;
}

.pf-c-input-group input,
.input-group input {
    border-right: none;
    border-radius: 10px 0 0 10px;
    flex: 1;
}

.pf-c-button.pf-m-control,
.input-group-addon {
    border-radius: 0 10px 10px 0;
    border: 1.5px solid var(--sage-200);
    border-left: none;
    background: var(--sage-50);
    color: var(--sage-400);
    padding: 0 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.pf-c-button.pf-m-control:hover,
.input-group-addon:hover {
    background: var(--sage-100);
    color: var(--sage-600);
}

/* ══════════════════════════════
 A ttempted username (re-auth)                                               *
 ══════════════════════════════ */
.kc-attempted-username-wrapper {
    background: var(--sage-50);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kc-attempted-username {
    font-weight: 600;
    color: var(--sage-800);
    font-size: 0.8125rem;
}

#reset-login {
    margin-left: auto;
    font-size: 0.75rem;
}

/* ══════════════════════════════
 L ocale selector                                                            *
 ══════════════════════════════ */
#kc-locale {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10;
}

#kc-locale-dropdown>a,
#kc-locale .dropdown-toggle {
    font-size: 0.75rem;
    color: var(--sage-500);
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid var(--sage-200);
    background: white;
    cursor: pointer;
    text-decoration: none;
}

#kc-locale .dropdown-menu {
    position: absolute;
    right: 0;
    border-radius: 10px;
    border: 1px solid var(--sage-200);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: white;
    overflow: hidden;
    list-style: none;
    min-width: 120px;
}

#kc-locale .dropdown-menu li a {
    display: block;
    padding: 8px 14px;
    font-size: 0.8125rem;
    color: var(--sage-600);
}

#kc-locale .dropdown-menu li a:hover {
    background: var(--medical-50);
    color: var(--medical-700);
    text-decoration: none;
}

/* ══════════════════════════════
 O TP / TOTP                                                                 *
 ══════════════════════════════ */
#kc-totp-login input[type="text"] {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.25em;
    text-align: center;
}

/* ══════════════════════════════
 U tilities used by KC templates                                             *
 ══════════════════════════════ */
.hidden {
    display: none;
}

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

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.pull-right {
    float: right;
}

.pull-left {
    float: left;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ══════════════════════════════
 A nimation                                                                  *
 ══════════════════════════════ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ══════════════════════════════
 R esponsive                                                                 *
 ══════════════════════════════ */
@media (max-width: 520px) {
    body {
        padding: 24px 12px;
    }

    #kc-form-wrapper {
        padding: 28px 20px 24px;
        border-radius: 16px;
    }
}

/* ══════════════════════════════
 R egister form card                                                          *
 ══════════════════════════════ */
#kc-register-form {
    background: white !important;
    border: 1px solid rgba(211, 217, 201, 0.45) !important;
    border-radius: 20px !important;
    box-shadow: 0 1px 2px rgba(53, 61, 46, 0.03), 0 8px 40px rgba(53, 61, 46, 0.06) !important;
    padding: 40px !important;
    animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

/* ══════════════════════════════
 L abel + required asterisk inline                                            *
 ══════════════════════════════ */
.form-group [class*="col-"]:has(label) {
    display: flex !important;
    align-items: center !important;
    gap: 4px;
    margin-bottom: 6px;
    color: #dc2626;
}

.form-group [class*="col-"]:has(label) label {
    display: inline !important;
    margin-bottom: 0 !important;
    color: var(--sage-600);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--sage-50);
}

::-webkit-scrollbar-thumb {
    background: var(--sage-300);
    border-radius: 3px;
}
/* ══════════════════════════════
 Wywiad: lista języków rozwija się dopiero po najechaniu / fokusie (26.11)
 Motyw nie ładuje login.css Keycloaka (to on chował listę), a Keycloak 26 renderuje ją jako
 #kc-locale-dropdown > button + ul.pf-c-dropdown__menu — bez tego lista stała otwarta. Animacja jak menu konta stron.
 ══════════════════════════════ */
#kc-locale.pf-c-dropdown { position: fixed !important; top: 16px; right: 16px; z-index: 10; }
#kc-locale-dropdown { position: relative; }
#kc-current-locale-link {
    font: 500 0.75rem 'DM Sans', sans-serif;
    color: var(--sage-600);
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--sage-200);
    background: rgba(255, 255, 255, .8);
    cursor: pointer;
    transition: border-color .2s, color .2s, background-color .2s;
}
#kc-current-locale-link:hover, #kc-locale-dropdown:focus-within #kc-current-locale-link { border-color: var(--medical-300); color: var(--medical-700); background: #fff; }
#kc-locale .pf-c-dropdown__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 170px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 14px;
    border: 1px solid rgba(211, 217, 201, .6);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 20px 25px -5px rgba(53, 61, 46, .06), 0 8px 10px -6px rgba(53, 61, 46, .05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.96);
    transform-origin: top right;
    transition: opacity .15s cubic-bezier(.22, 1, .36, 1), transform .15s cubic-bezier(.22, 1, .36, 1), visibility 0s .15s;
}
#kc-locale-dropdown:hover .pf-c-dropdown__menu,
#kc-locale-dropdown:focus-within .pf-c-dropdown__menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .15s cubic-bezier(.22, 1, .36, 1), transform .15s cubic-bezier(.22, 1, .36, 1);
}
#kc-locale .pf-c-dropdown__menu-item {
    display: block;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8125rem;
    color: var(--sage-700);
    text-decoration: none;
    transition: background-color .15s, color .15s;
}
#kc-locale .pf-c-dropdown__menu-item:hover { background: var(--medical-50); color: var(--medical-700); text-decoration: none; }

/* wejście karty logowania — jak motion.div na stronach (opacity 0, y 14 → 0) */
/* karta: sama przezroczystość — transform na przodku zamieniłby `position: fixed` listy języków w pozycję względem karty */
@keyframes wywiad-wjazd { from { opacity: 0; transform: translateY(14px); } }
@keyframes wywiad-pojaw { from { opacity: 0; } }
#kc-header-wrapper, #kc-page-title, #kc-content-wrapper { animation: wywiad-wjazd .6s cubic-bezier(.22, 1, .36, 1) both; }
.card-pf { animation: wywiad-pojaw .5s ease-out both; }
#kc-page-title { animation-delay: .08s; }
#kc-content-wrapper { animation-delay: .16s; }
@media (prefers-reduced-motion: reduce) { #kc-header-wrapper, #kc-page-title, #kc-content-wrapper, .card-pf { animation: none; } }
