/* ============================================================
   Swiss Post Sans font
   ============================================================ */
@font-face {
  font-display: swap;
  font-family: 'Swiss Post Sans';
  font-weight: 700;
  src: url('https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Bold.woff2') format('woff2'),
    url('https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Bold.woff') format('woff');
}

@font-face {
  font-display: swap;
  font-family: 'Swiss Post Sans';
  font-weight: 400;
  src: url('https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Regular.woff2') format('woff2'),
    url('https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Regular.woff') format('woff');
}

@font-face {
  font-display: swap;
  font-family: 'Swiss Post Sans';
  font-weight: 300;
  src: url('https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Light.woff2') format('woff2'),
    url('https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Light.woff') format('woff');
}

/* ============================================================
   Page layout
   ============================================================ */
body {
  padding: 0; /* reset portal-layout padding injected by post-external.css */
  background: url('../img/background.png') center / cover fixed;
}

.spdg-login-page {
  min-height: 100vh;
  padding-bottom: 3rem;
}

@media (max-width: 767px) {
  .spdg-login-page {
    padding-bottom: 0;
  }
}

/* ============================================================
   Card (login panel)
   ============================================================ */
.spdg-card {
  max-width: 520px;
  margin: 5em auto 0; /* in-flow centering - position:fixed breaks scrolling */
  border: none;
  border-top: 4px solid #ffcc00;
  border-top: 4px solid var(--post-core-color-brand-postyellow, #ffcc00);
  border-radius: 0 0 2px 2px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  padding: 0 1.75rem 1.75rem;
}

@media (max-width: 767px) {
  .spdg-card {
    margin: 0;
    border-top: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0 1rem 1.5rem;
    width: 100%;
  }
}

/* ============================================================
   Logo header (top of card)
   ============================================================ */
.spdg-form-header {
  display: block;
  background: url('../img/logo.png') center 1rem no-repeat;
  background-size: auto 90px;
  height: 120px;
  margin: 0 -1.75rem 0;
  text-decoration: none;
}

@media (max-width: 767px) {
  .spdg-form-header {
    margin: 0 -1rem 0;
  }
}

/* ============================================================
   Page title (shown below logo)
   ============================================================ */
.spdg-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e1d19;
  margin: 0 0 1.25rem;
  padding-top: 0.5rem;
}

/* ============================================================
   Utility
   ============================================================ */
.hidden {
  display: none !important;
}

/* ============================================================
   Alert: map Keycloak "error" type to Bootstrap alert-danger look
   ============================================================ */
.alert-error {
  color: #58151c;
  background-color: #f8d7da;
  border-color: #f1aeb5;
}

/* ============================================================
   Form tweaks
   ============================================================ */
.form-check {
  margin-bottom: 0;
}

/* ============================================================
   MFA warning
   ============================================================ */
#mfaWarning {
  margin-bottom: 1rem;
}

/* ============================================================
   Options row (remember me + forgot password)
   ============================================================ */
.kc-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

/* ============================================================
   Social providers
   ============================================================ */
.kc-social-links {
  margin-top: 0.5rem;
}

.kc-social-item + .kc-social-item {
  margin-top: 0.5rem;
}

.kc-social-provider-logo {
  margin-right: 0.5rem;
}

.kc-social-section {
  margin-top: 1.5rem;
  text-align: center;
}

.kc-social-section hr {
  margin-bottom: 0.75rem;
}

/* ============================================================
   Info area (registration link, back to login, etc.)
   ============================================================ */
#kc-info {
  border-top: 1px solid #e1e0dc;
  margin: 1.25rem -1.75rem -1.75rem;
  padding: 0.875rem 1.75rem;
  background: #faf9f8;
  font-size: 0.875rem;
}

@media (max-width: 767px) {
  #kc-info {
    margin: 1rem -1rem -1.5rem;
    padding: 0.875rem 1rem;
  }
}

/* ============================================================
   Locale switcher
   ============================================================ */
#kc-locale {
  text-align: right;
  padding: 0.5rem 0 0;
  max-width: 520px;
  margin: 0 auto;
}

#kc-locale-dropdown {
  display: inline-block;
  position: relative;
}

#kc-locale ul {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 120px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 2px;
  padding: 0.25rem 0;
  z-index: 9999;
  list-style: none;
  margin: 0;
}

#kc-locale-dropdown:hover ul {
  display: block;
}

#kc-locale-dropdown a {
  font-size: 0.875rem;
  color: #504f4b;
  text-decoration: none;
}

a#kc-current-locale-link::after {
  content: ' \25be';
  margin-left: 0.2rem;
}

/* ============================================================
   TOTP setup
   ============================================================ */
#kc-totp-secret-qr-code {
  max-width: 160px;
  height: auto;
  display: block;
  margin-bottom: 1rem;
}

#kc-totp-secret-key {
  font-size: 0.9rem;
  font-weight: 700;
  word-break: break-all;
  padding: 0.5rem 0.75rem;
  background: #faf9f8;
  border: 1px solid #cdccc8;
  border-radius: 2px;
  margin-bottom: 1rem;
}

ol#kc-totp-settings {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

ul#kc-totp-supported-apps {
  margin-bottom: 1rem;
}

/* ============================================================
   OTP credential tiles (login-otp.ftl)
   ============================================================ */
.spdg-otp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0;
}

.spdg-otp-list > li {
  flex: 1 1 130px;
}

.spdg-otp-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.spdg-otp-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  border: 1px solid #cdccc8;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s;
  background: #fff;
  user-select: none;
}

.spdg-otp-label:hover {
  border-color: #ffcc00;
  border-color: var(--post-core-color-brand-postyellow, #ffcc00);
}

.spdg-otp-radio:checked + .spdg-otp-label {
  border: 2px solid #ffcc00;
  border: 2px solid var(--post-core-color-brand-postyellow, #ffcc00);
}

.spdg-otp-radio:focus + .spdg-otp-label {
  outline: 2px solid #ffcc00;
  outline: 2px solid var(--post-core-color-brand-postyellow, #ffcc00);
  outline-offset: 2px;
}

.spdg-otp-icon {
  font-size: 1.5rem;
  color: #696864;
  margin-bottom: 0.25rem;
}

.spdg-otp-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e1d19;
}

/* ============================================================
   Select authenticator (select-authenticator.ftl)
   ============================================================ */
.spdg-select-auth-list {
  margin: 0;
  padding: 0;
}

.spdg-select-auth-item {
  border-top: 1px solid #e1e0dc;
  padding: 0.875rem 0;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.1s;
}

.spdg-select-auth-item:first-child {
  border-top: none;
}

.spdg-select-auth-item:hover {
  background-color: #f0efed;
  color: inherit;
  text-decoration: none;
}

.spdg-select-auth-icon-wrap {
  font-size: 1.4rem;
  width: 2.25rem;
  text-align: center;
  margin-right: 0.875rem;
  color: #ffcc00;
  color: var(--post-core-color-brand-postyellow, #ffcc00);
  flex-shrink: 0;
}

.spdg-select-auth-heading {
  font-weight: 700;
  color: #1e1d19;
  font-size: 0.95rem;
}

.spdg-select-auth-desc {
  font-size: 0.8rem;
  color: #696864;
}

.spdg-select-auth-arrow {
  color: #9b9a96;
  font-size: 1rem;
}

/* ============================================================
   Back / secondary links
   ============================================================ */
#kc-back,
#try-another-way {
  display: inline-block;
  margin-top: 0.75rem;
}

/* ============================================================
   Terms
   ============================================================ */
#kc-terms-text {
  margin-bottom: 1.25rem;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e1e0dc;
  padding: 0.75rem;
  border-radius: 2px;
  font-size: 0.875rem;
}

/* ============================================================
   Recovery codes
   ============================================================ */
#kc-recovery-codes-list {
  font-family: monospace;
  font-size: 1rem;
  columns: 2;
  list-style: none;
  padding: 0.75rem;
  background: #faf9f8;
  border: 1px solid #e1e0dc;
  border-radius: 2px;
  margin-bottom: 1rem;
}
