* {
  box-sizing: border-box;
}

:root {
  --calee-primary: #2F80ED;
  --calee-primary-dark: #1F5B9A;
  --calee-primary-soft: #EAF4FF;
  --calee-bg: #EEF6FB;
  --calee-surface: #FFFFFF;
  --calee-surface-soft: #F7FAFD;
  --calee-text: #111827;
  --calee-muted: #5B6B82;
  --calee-border: #D8E4F0;
  --calee-sync-green: #A8D86D;
  --calee-success: #5DBB63;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--calee-bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--calee-text);
}

html body .login-pf-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

html body #kc-header,
html body #kc-page-title {
  display: none;
}

html body #kc-content,
html body #kc-content-wrapper,
html body .card-pf {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

html body .calee-page {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

html body .calee-auth-shell {
  width: min(480px, 100%);
  max-width: 480px;
  margin: 0 auto;
}

html body .calee-auth-card {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--calee-border);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.1), 0 8px 24px rgba(15, 23, 42, 0.06);
  padding: 32px;
}

.calee-auth-brand {
  margin-bottom: 24px;
}

.calee-logo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--calee-primary-dark), var(--calee-primary));
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
}

.calee-auth-copy h1 {
  margin: 0 0 10px;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.calee-auth-copy p {
  margin: 0 0 28px;
  color: var(--calee-muted);
  font-size: 18px;
  line-height: 1.5;
}

.calee-alert {
  margin: 0 0 22px;
  padding: 13px 15px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid #dbe5f1;
  background: #f5f8fc;
  color: #172033;
}

.calee-alert-error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.calee-alert-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.calee-alert-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.calee-form {
  margin: 0;
}

.calee-field {
  margin-bottom: 18px;
}

.calee-form label,
.calee-form .kcLabelClass {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #17345c;
}

html body .calee-form input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--calee-border);
  background: #ffffff;
  font-size: 16px;
  line-height: 1.4;
  box-sizing: border-box;
}

.calee-form input:focus {
  outline: none;
  border-color: var(--calee-primary);
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.15);
}

.calee-field-error {
  margin: -4px 0 18px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #fff1f2;
  color: #991b1b;
  font-size: 14px;
  line-height: 1.45;
}

.calee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  margin: 4px 0 22px;
  gap: 12px;
}

.calee-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--calee-muted);
  font-size: 14px;
}

.calee-link {
  display: inline-block;
  margin: 8px 0 20px;
  color: var(--calee-primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.calee-link:hover {
  text-decoration: underline;
}

html body .calee-submit,
html body .calee-form button[type="submit"],
html body .calee-form input[type="submit"] {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--calee-primary-dark), var(--calee-primary));
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(47, 128, 237, 0.22);
}

.calee-support-copy {
  margin: 20px 0 0;
  color: var(--calee-muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 640px) {
  body {
    background: var(--calee-bg);
  }

  html body .login-pf-page {
    display: block;
    min-height: 100dvh;
    padding: 0;
  }

  html body .calee-page {
    display: block;
    min-height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
  }

  html body .calee-auth-shell {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  html body .calee-auth-card {
    width: 100%;
    max-width: none;
    padding: 18px 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .calee-auth-brand {
    margin-bottom: 18px;
  }

  .calee-logo-pill {
    min-height: 36px;
    padding: 0 14px;
    font-size: 14px;
  }

  .calee-auth-copy h1 {
    font-size: 32px;
    line-height: 1.08;
    margin-bottom: 8px;
  }

  .calee-auth-copy p {
    font-size: 16px;
    margin-bottom: 24px;
  }

  .calee-field {
    margin-bottom: 16px;
  }

  html body .calee-form input {
    min-height: 56px;
    border-radius: 14px;
    background: #ffffff;
  }

  html body .calee-submit,
  html body .calee-form button[type="submit"],
  html body .calee-form input[type="submit"] {
    min-height: 56px;
    border-radius: 14px;
  }

  .calee-support-copy {
    margin-top: 18px;
    text-align: left;
  }
}

@media (max-width: 430px) {
  html body .calee-page {
    padding: max(14px, env(safe-area-inset-top)) 12px max(22px, env(safe-area-inset-bottom));
  }

  html body .calee-auth-card {
    padding-top: 12px;
  }

  .calee-auth-brand {
    margin-bottom: 16px;
  }

  .calee-auth-copy h1 {
    font-size: 29px;
  }

  .calee-auth-copy p {
    margin-bottom: 22px;
  }
}

/* CALEE_AUTH_LAYOUT_WIDTH_PATCH */
.calee-auth-shell {
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 28px);
  box-sizing: border-box;
}

.calee-auth-card {
  width: 100%;
  box-sizing: border-box;
}

.calee-auth-title {
  margin: 0 0 10px 0;
  text-align: center;
}

.calee-auth-subtitle {
  margin: 0 0 18px 0;
  text-align: center;
}

.calee-field {
  margin-bottom: 16px;
}

.calee-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.calee-field input {
  width: 100%;
  box-sizing: border-box;
}

.calee-field-error {
  display: block;
  margin-top: 8px;
  color: #c62828;
  font-size: 0.92rem;
}

.calee-submit {
  width: 100%;
  box-sizing: border-box;
}

.calee-actions {
  margin-top: 18px;
  text-align: center;
}

.calee-actions-left {
  margin-top: 18px;
  text-align: left;
}

@media (max-width: 640px) {
  .calee-auth-shell {
    max-width: 100%;
    padding: 16px;
  }

  .calee-auth-title {
    font-size: 1.6rem;
  }
}

/* CALEE_AUTH_PAGE_V4 */
html body .calee-auth-shell {
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 28px);
  box-sizing: border-box;
}

html body .calee-auth-card {
  width: 100%;
  box-sizing: border-box;
}

html body .calee-auth-title {
  margin: 0 0 10px 0;
  text-align: center;
}

html body .calee-auth-subtitle {
  margin: 0 0 20px 0;
  text-align: center;
}

html body .calee-field {
  margin-bottom: 16px;
}

html body .calee-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

html body .calee-field input {
  width: 100%;
  box-sizing: border-box;
}

html body .calee-submit {
  width: 100%;
  box-sizing: border-box;
}

html body .calee-actions {
  margin-top: 18px;
  text-align: center;
}

@media (max-width: 640px) {
  html body .calee-auth-shell {
    max-width: 100%;
    padding: 16px;
  }
}
