/* Layout polish for banner adjacency + Turnstile visual stand-in */

.lm-logo-wrapper {
  text-align: center;
  margin-bottom: 0;
}

.lm-logo-wrapper img {
  display: inline-block;
  height: 23px;
  width: auto;
}

.lm-login-card-body {
  justify-content: center;
  align-items: stretch;
}

.lm-login-banner-container {
  flex: 0 0 365px;
  width: 365px;
  line-height: 0;
}

.lm-login-banner-img {
  display: block;
  width: 365px;
  height: 428px;
  max-width: none;
}

.lm-login-container {
  box-sizing: border-box;
  flex: 0 0 360px !important;
  width: 360px !important;
  max-width: 362px;
  min-width: 360px;
}

.lm-login-options {
  overflow: hidden;
  font-size: 13px;
  color: #253746;
}

.lm-login-options .lm-middle-align {
  margin-left: 4px;
}

.lm-login-input:focus {
  outline: none;
  border-bottom-color: #253746;
}

.lm-login-input:focus ~ .lm-login-label {
  transform: translateX(-5px) translateY(-15px) scale(0.8);
  color: #253746;
}

a {
  cursor: pointer;
}

/* Login alert (Roundcube display_message style) */
#message {
  min-height: 0;
  margin-bottom: 8px;
}

#message .lm-alert-tooltip-top {
  position: relative;
  background: #e67e22;
  color: #fff;
  text-align: left;
  padding: 10px 32px 10px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  margin: 0 0 12px;
}

#message .lm-alert-tooltip-top.alert-error,
#message .lm-alert-tooltip-top.alert-danger {
  background: #ed2350;
}

#message .lm-alert-tooltip-top.alert-warning {
  background: #e67e22;
}

#message .alert-dismiss {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.9;
}

#message .alert-dismiss:before {
  content: "×";
  font-size: 18px;
  line-height: 1;
}

/* Original ships an empty reCAPTCHA node whose top margin spaces the Turnstile */
.g-recaptcha {
  margin: 20px 0 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  border: 0 !important;
}

/* Cloudflare Turnstile mock (original sitekey won't render off-domain) */
.cf-turnstile-mock {
  margin: 0;
  width: 300px;
  max-width: 100%;
  height: 68px;
  background: #fafafa;
  border: 1px solid #d3d3d3;
  border-radius: 2px;
  box-sizing: border-box;
}

.cf-turnstile-mock-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  box-sizing: border-box;
}

.cf-turnstile-mock-check {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.cf-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #e5e5e5;
  border-top-color: #3fc53f;
  border-right-color: #3fc53f;
  animation: cfspin 0.8s linear infinite;
  display: inline-block;
}

@keyframes cfspin {
  to { transform: rotate(360deg); }
}

.cf-turnstile-mock-label {
  flex: 1;
  text-align: left;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: #333;
}

.cf-turnstile-mock-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: 8px;
}

.cf-turnstile-mock-links {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8px;
  color: #696969;
  margin-top: 2px;
  white-space: nowrap;
}

.cf-logo text {
  font-size: 8px;
}

@media screen and (max-width: 720px) {
  .lm-login-card-body {
    flex-direction: column;
    align-items: center;
  }

  .lm-login-banner-container {
    display: none;
  }

  .lm-login-container {
    margin: 0 auto;
  }
}
