/* SquidSpark Keycloak login theme
   Mirrors https://cloud.squidspark.com/Account/Login
   Palette: primary #18B6E8 (sky blue), hover #0D9FD1, link #0D8FC9, ink #111827
   Sky background: gradient #BFE9FF -> #DFF4FF -> #EEFBFF with drifting SVG clouds + sun */

:root {
  --ss-primary: #18B6E8;
  --ss-primary-deep: #0D9FD1;
  --ss-accent: #0D8FC9;
  --ss-ink: #111827;

  --ss-slate-50: #f9fafb;
  --ss-slate-200: #e5e7eb;
  --ss-slate-300: #d1d5db;
  --ss-slate-400: #9ca3af;
  --ss-slate-500: #6b7280;
  --ss-slate-600: #4b5563;
  --ss-slate-700: #374151;

  --ss-radius-card: 1rem;     /* rounded-2xl */
  --ss-radius-input: 0.5rem;  /* rounded-lg  */
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body.ss-body,
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-x: hidden;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ss-ink);
  background: linear-gradient(180deg, #BFE9FF 0%, #DFF4FF 55%, #EEFBFF 100%) fixed;
}

/* ---------- Sky scene (clouds + sun SVG, emitted by template.ftl) ---------- */
.ss-sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
@keyframes ss-drift {
  0%   { transform: translateX(-30px); }
  100% { transform: translateX(30px); }
}
.drift-a { animation: ss-drift 14s ease-in-out infinite alternate; }
.drift-b { animation: ss-drift 20s ease-in-out infinite alternate; }
.drift-c { animation: ss-drift 26s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) {
  .drift-a, .drift-b, .drift-c { animation: none; }
}

/* ---------- Shell + brand ---------- */
.ss-shell { position: relative; z-index: 10; width: 100%; max-width: 24rem; }   /* max-w-sm */

.ss-brand { text-align: center; margin-bottom: 1.5rem; }
.ss-brand-link { display: inline-block; }
.ss-logo { height: 56px; width: auto; display: block; margin: 0 auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08)); }

/* ---------- Card (white/95 + blur, as on cloud.squidspark.com) ---------- */
.ss-card {
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  border: 1px solid #fff;
  border-radius: var(--ss-radius-card);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.ss-card-header { text-align: center; margin-bottom: 1.25rem; }

#kc-page-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ss-ink);
}

.ss-username { text-align: center; color: var(--ss-slate-600); font-size: 0.875rem; }
.ss-username #kc-attempted-username { font-weight: 600; }

.ss-required-note { font-size: 0.75rem; color: var(--ss-slate-500); margin-bottom: 0.5rem; }
.ss-required-note .required, .required { color: var(--ss-accent); }

/* ---------- Form layout ---------- */
#kc-form, #kc-form-wrapper, #kc-content, #kc-content-wrapper { width: 100%; }

.ss-group { margin-bottom: 1rem; }
.ss-label-wrapper, .ss-input-wrapper { width: 100%; }

/* Keep the required asterisk on the same line as the field label (register page) */
.ss-label-wrapper {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}
.ss-label-wrapper .ss-label {
  display: inline-block;
  margin-bottom: 0;
}

.ss-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ss-slate-700);
  margin-bottom: 0.25rem;
}

.ss-input,
input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="number"], select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--ss-ink);
  background: #fff;
  border: 1px solid var(--ss-slate-200);
  border-radius: var(--ss-radius-input);
  padding: 0.625rem 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ss-input:focus,
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ss-primary);
  box-shadow: 0 0 0 2px rgba(24, 182, 232, 0.35);   /* focus:ring-2 ring-[#18b6e8] */
}

.ss-input::placeholder { color: var(--ss-slate-400); }

/* ---------- Password field + visibility toggle ---------- */
.ss-input-group { position: relative; }
.ss-input-group .ss-input,
.ss-input-group input { padding-right: 2.75rem; }

.ss-pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ss-slate-400);
}
.ss-pw-toggle:hover { color: var(--ss-slate-600); }

.ss-pw-toggle i {
  display: block;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  /* longhands only — must NOT use the `mask` shorthand here, it resets mask-image to none */
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
}

.ss-pw-toggle i.pw-eye {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke='%23000'%20stroke-width='2'%3E%3Cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M15%2012a3%203%200%2011-6%200%203%203%200%20016%200z'/%3E%3Cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M2.458%2012C3.732%207.943%207.523%205%2012%205c4.477%200%208.268%202.943%209.542%207-1.274%204.057-5.065%207-9.542%207-4.477%200-8.268-2.943-9.542-7z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke='%23000'%20stroke-width='2'%3E%3Cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M15%2012a3%203%200%2011-6%200%203%203%200%20016%200z'/%3E%3Cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M2.458%2012C3.732%207.943%207.523%205%2012%205c4.477%200%208.268%202.943%209.542%207-1.274%204.057-5.065%207-9.542%207-4.477%200-8.268-2.943-9.542-7z'/%3E%3C/svg%3E");
}

.ss-pw-toggle i.pw-eye-off {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke='%23000'%20stroke-width='2'%3E%3Cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M13.875%2018.825A10.05%2010.05%200%200112%2019c-4.477%200-8.268-2.943-9.542-7a9.97%209.97%200%20011.563-3.029m5.858.908a3%203%200%20114.243%204.243M9.878%209.878l4.242%204.242M9.88%209.88l-3.29-3.29m7.532%207.532l3.29%203.29M3%203l3.59%203.59m0%200A9.953%209.953%200%200112%205c4.477%200%208.268%202.943%209.542%207a10.025%2010.025%200%2001-4.132%205.411m0%200L21%2021'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke='%23000'%20stroke-width='2'%3E%3Cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M13.875%2018.825A10.05%2010.05%200%200112%2019c-4.477%200-8.268-2.943-9.542-7a9.97%209.97%200%20011.563-3.029m5.858.908a3%203%200%20114.243%204.243M9.878%209.878l4.242%204.242M9.88%209.88l-3.29-3.29m7.532%207.532l3.29%203.29M3%203l3.59%203.59m0%200A9.953%209.953%200%200112%205c4.477%200%208.268%202.943%209.542%207a10.025%2010.025%200%2001-4.132%205.411m0%200L21%2021'/%3E%3C/svg%3E");
}

/* ---------- Options row (remember me / forgot password) ---------- */
#kc-form-options { display: flex; align-items: center; }
.ss-form-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.ss-form-options-wrapper { margin-left: auto; }

.checkbox { margin: 0; }
.checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--ss-slate-600);
  cursor: pointer;
}

input[type="checkbox"], input[type="radio"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--ss-primary);
  border: 1px solid var(--ss-slate-300);
  cursor: pointer;
}

/* ---------- Links ---------- */
a { color: var(--ss-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.ss-btn {
  display: inline-block;
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--ss-radius-input);
  padding: 0.625rem 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ss-btn-block { display: block; width: 100%; }

.ss-btn-primary { background: var(--ss-primary); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.ss-btn-primary:hover { background: var(--ss-primary-deep); text-decoration: none; }

.ss-btn-secondary, .ss-btn-default {
  background: #fff;
  color: var(--ss-slate-700);
  border-color: var(--ss-slate-200);
}
.ss-btn-secondary:hover, .ss-btn-default:hover { background: var(--ss-slate-50); text-decoration: none; }

#kc-form-buttons { margin-top: 0.25rem; }

/* ---------- Errors & alerts ---------- */
.ss-error {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #dc2626;
}
input[aria-invalid="true"], .ss-group-error input { border-color: #dc2626; }

.ss-alert {
  display: block;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  border: 1px solid transparent;
  border-radius: var(--ss-radius-input);
}
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-info    { background: #f0f9ff; border-color: #bae6fd; color: #0369a1; }

/* ---------- Info / registration footer ---------- */
#kc-info, .ss-signup {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--ss-slate-500);
}
#kc-registration a, #kc-info a, .ss-signup a { color: var(--ss-primary); font-weight: 500; }

#kc-registration-container { margin-top: 0; }

/* ---------- Informational pages (verify email, email verified, ...) ---------- */
.instruction {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ss-slate-600);
  text-align: center;
}
#kc-info-message { text-align: center; }
#kc-info-message p:last-child { margin-bottom: 0; }

/* "Back to Login" link on the verify-email / email-verified pages */
.ss-back-to-login {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.875rem;
}
.ss-back-to-login a { color: var(--ss-primary); font-weight: 500; }

/* ---------- Social / identity providers ---------- */
.ss-social { margin-top: 1.5rem; }
.ss-social hr { display: none; }

/* "OR SIGN IN WITH" divider with rules on each side */
.ss-social h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.875rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ss-slate-400);
}
.ss-social h2::before, .ss-social h2::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--ss-slate-200);
}

.ss-social-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.ss-social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.ss-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid var(--ss-slate-200);
  border-radius: var(--ss-radius-input);
  color: var(--ss-slate-700);
  font-weight: 500;
  font-size: 0.875rem;
  background: #fff;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.ss-social-btn:hover { background: var(--ss-slate-50); border-color: var(--ss-slate-300); text-decoration: none; }
.ss-social-name { line-height: 1; }

/* Brand logos injected per provider (independent of any icon font) */
.ss-social-btn .ss-social-logo { display: none; }
#social-google::before, #social-microsoft::before {
  content: "";
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
#social-google::before {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3E%3Cpath%20fill='%23FFC107'%20d='M43.611%2020.083H42V20H24v8h11.303c-1.649%204.657-6.08%208-11.303%208-6.627%200-12-5.373-12-12s5.373-12%2012-12c3.059%200%205.842%201.154%207.961%203.039l5.657-5.657C34.046%206.053%2029.268%204%2024%204%2012.955%204%204%2012.955%204%2024s8.955%2020%2020%2020%2020-8.955%2020-20c0-1.341-.138-2.65-.389-3.917z'/%3E%3Cpath%20fill='%23FF3D00'%20d='M6.306%2014.691l6.571%204.819C14.655%2015.108%2018.961%2012%2024%2012c3.059%200%205.842%201.154%207.961%203.039l5.657-5.657C34.046%206.053%2029.268%204%2024%204%2016.318%204%209.656%208.337%206.306%2014.691z'/%3E%3Cpath%20fill='%234CAF50'%20d='M24%2044c5.166%200%209.86-1.977%2013.409-5.192l-6.19-5.238C29.211%2035.091%2026.715%2036%2024%2036c-5.202%200-9.619-3.317-11.283-7.946l-6.522%205.025C9.505%2039.556%2016.227%2044%2024%2044z'/%3E%3Cpath%20fill='%231976D2'%20d='M43.611%2020.083H42V20H24v8h11.303c-.792%202.237-2.231%204.166-4.087%205.571l6.19%205.238C36.971%2039.205%2044%2034%2044%2024c0-1.341-.138-2.65-.389-3.917z'/%3E%3C/svg%3E");
}
#social-microsoft::before {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2023%2023'%3E%3Cpath%20fill='%23f25022'%20d='M1%201h10v10H1z'/%3E%3Cpath%20fill='%237fba00'%20d='M12%201h10v10H12z'/%3E%3Cpath%20fill='%2300a4ef'%20d='M1%2012h10v10H1z'/%3E%3Cpath%20fill='%23ffb900'%20d='M12%2012h10v10H12z'/%3E%3C/svg%3E");
}

/* ---------- Try another way ---------- */
#kc-select-try-another-way-form { margin-top: 1rem; text-align: center; }

/* ---------- Locale switcher ---------- */
.ss-locale { position: relative; text-align: right; margin-bottom: 0.75rem; }
.ss-locale-wrapper { display: inline-block; position: relative; }

#kc-locale button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: #fff;
  border: 1px solid var(--ss-slate-200);
  border-radius: var(--ss-radius-input);
  padding: 0.375rem 0.625rem;
  cursor: pointer;
  color: var(--ss-slate-600);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
}
#kc-locale button:hover { border-color: var(--ss-slate-300); color: var(--ss-slate-700); }

/* globe icon before the current language */
#kc-locale button::before {
  content: "";
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke='%23000'%20stroke-width='2'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpath%20d='M3%2012h18M12%203c2.5%202.5%203.5%206%203.5%209s-1%206.5-3.5%209c-2.5-2.5-3.5-6-3.5-9s1-6.5%203.5-9z'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke='%23000'%20stroke-width='2'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpath%20d='M3%2012h18M12%203c2.5%202.5%203.5%206%203.5%209s-1%206.5-3.5%209c-2.5-2.5-3.5-6-3.5-9s1-6.5%203.5-9z'/%3E%3C/svg%3E") no-repeat center / contain;
}
/* chevron after */
#kc-locale button::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
}

.ss-locale-list {
  display: none; /* opened by menu-button-links.js via inline display:block */
  list-style: none;
  margin: 0.375rem 0 0;
  padding: 0.25rem;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 30;
  min-width: 11rem;
  background: #fff;
  border: 1px solid var(--ss-slate-200);
  border-radius: var(--ss-radius-input);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}
.ss-locale-list-item { list-style: none; }
.ss-locale-item {
  display: block;
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  color: var(--ss-slate-700);
  font-size: 0.8125rem;
}
.ss-locale-item:hover { background: var(--ss-slate-50); color: var(--ss-primary); text-decoration: none; }
