/* ── Reset CAS layout chrome ── */
.header-section, .top-strip, .footer, #serviceui { display: none !important; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #4a5568; }
.container   { max-width: 100% !important; padding: 0 !important; width: 100% !important; }
.body-section { margin: 0 !important; }

/* ── Page shell ── */
.sso-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #f0f4f8;
}

/* ── Card ── */
.sso-card {
  background: #fff;
  border: 0.5px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  overflow: hidden;
}

/* ── Card header ── */
.sso-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 0.5px solid rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
}

/* ── SSO header: logo above card ── */
.sso-header {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sso-logo {
  height: 32px;
  object-fit: contain;
  display: block;
}

/* ── Card body ── */
.sso-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

/* ── Footer ── */
.sso-footer {
  margin-top: 1.25rem;
  font-size: 11px;
  color: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* ── Buttons (shared across login + error pages) ── */
.sso-btn-primary,
button.sso-btn-primary,
a.sso-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 44px;
  background: #1565C0 !important;
  color: #fff !important;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none !important;
  transition: background .15s;
  margin-bottom: 8px;
  box-sizing: border-box;
}
.sso-btn-primary:hover,
button.sso-btn-primary:hover,
a.sso-btn-primary:hover { background: #1255a8 !important; color: #fff !important; }

.sso-btn-outline,
a.sso-btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 44px;
  background: #fff;
  color: #1a1a1a !important;
  border: 1px solid #e0e0e0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none !important;
  transition: border-color .15s, background .15s;
  margin-bottom: 8px;
  box-sizing: border-box;
}
.sso-btn-outline:hover,
a.sso-btn-outline:hover { border-color: #bbb; background: #fafafa; }

/* ── App badge ── */
.sso-app-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #fafafa;
  border: 0.5px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 10px 14px;
  box-sizing: border-box;
}

.sso-app-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sso-app-badge-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sso-app-badge-url {
  font-size: 11px;
  color: #999;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sso-form h2       { font-size: 18px !important; font-weight: 600 !important; color: #1a1a1a !important; margin: 0 0 4px !important; }
.sso-form .sso-sub { font-size: 13px !important; color: #777 !important; margin: 0 0 1.25rem !important; }

/* ── Input wrap + icon ── */
.sso-input-wrap     { position: relative; margin-bottom: 8px; }
.sso-input-wrap > svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #bbb;
  pointer-events: none;
  width: 16px;
  height: 16px;
  display: block;
}
.sso-input {
  width: 100%;
  height: 44px;
  padding: 0 12px 0 40px !important;
  border: 1px solid #e0e0e0;
  border-radius: 9px;
  font-size: 13px;
  color: #1a1a1a;
  background: #fff;
  outline: none;
  font-family: inherit;
  box-sizing: border-box !important;
  transition: border-color .15s, box-shadow .15s;
}
.sso-input:focus         { border-color: #1565C0; box-shadow: 0 0 0 3px rgba(21,101,192,0.08); }
.sso-input.sso-input-err { border-color: #e53935; }

/* ── Inline error message ── */
.sso-err-msg     { font-size: 12px; color: #e53935; margin: -2px 0 8px 2px; display: none; align-items: center; gap: 4px; }
.sso-err-msg.on  { display: flex; }

/* ── Alert banner ── */
.sso-alert-warn {
  margin-bottom: 1.25rem;
  border-radius: 10px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  padding: 10px 14px;
  font-size: 13px;
  color: #92400e;
  text-align: left;
}

/* ── Divider ── */
.sso-divider { display: flex; align-items: center; gap: 10px; margin: 1rem 0; color: #ccc; font-size: 12px; }
.sso-divider::before,
.sso-divider::after { content: ''; flex: 1; height: 1px; background: #eee; }

/* ── IdP button ── */
.sso-idp-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  color: #1a1a1a;
  transition: border-color .12s, background .12s;
  box-sizing: border-box;
}
.sso-idp-btn:hover { border-color: #bbb; background: #fafafa; }

.sso-idp-icon            { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sso-idp-icon.ic-google  { background: #fef3e2; }
.sso-idp-icon.ic-entra   { background: #e8f0fe; }
.sso-idp-icon.ic-default { background: #f5f5f5; }

.sso-idp-name { font-size: 13px; font-weight: 600; color: #1a1a1a; }
.sso-idp-sub  { font-size: 11px; color: #999; margin-top: 1px; }

/* ── All providers panel ── */
.sso-all-card { border: 1px solid #eee; border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.sso-all-top  { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }

.sso-pill {
  display: inline-block;
  background: #f5f5f3;
  border: 0.5px solid rgba(0,0,0,0.08);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px;
  color: #666;
  margin: 2px 2px 0 0;
}

.sso-tog       { background: none; border: none; font-size: 11px; color: #1565C0; cursor: pointer; padding: 2px 0; margin-top: 2px; font-family: inherit; }
.sso-tog:hover { text-decoration: underline; }

/* ── Back button ── */
.sso-back       { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #999; cursor: pointer; background: none; border: none; font-family: inherit; padding: 0; margin-bottom: 1.25rem; }
.sso-back:hover { color: #1a1a1a; }

/* ── Matched card (confirm screen) ── */
.sso-matched { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #e8e8e8; border-radius: 10px; background: #f8f8f8; margin-bottom: 14px; }

/* ── Pick / disambiguate notice ── */
.sso-notice { background: #e8f0fe; border: 0.5px solid #b5d4f4; border-radius: 9px; padding: 10px 12px; font-size: 12px; color: #0c447c; margin-bottom: 1rem; display: flex; gap: 8px; align-items: flex-start; line-height: 1.6; }

/* ── Redirect screen ── */
.sso-redir-wrap { text-align: center; padding: 1rem 0 1.5rem; }
.sso-redir-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }

.sso-dots             { display: flex; justify-content: center; gap: 6px; margin-bottom: 1.25rem; }
.sso-dot              { width: 7px; height: 7px; border-radius: 50%; background: #ccc; animation: ssoPulse 1.2s ease-in-out infinite; }
.sso-dot:nth-child(2) { animation-delay: .2s; }
.sso-dot:nth-child(3) { animation-delay: .4s; }
@keyframes ssoPulse { 0%,100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

.sso-cancel       { font-size: 12px; color: #999; cursor: pointer; background: none; border: none; font-family: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sso-cancel:hover { color: #1a1a1a; }

/* ── Screen visibility ── */
.sso-screen        { display: none; }
.sso-screen.active { display: block; }

/* ── External form fields ── */
.sso-field       { margin-bottom: 12px; }
.sso-field label { display: block; font-size: 12px; font-weight: 500; color: #555; margin-bottom: 4px; }

/* ── Error page ── */
.err-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #fde8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.err-title { font-size: 17px !important; font-weight: 600 !important; color: #1a1a1a !important; margin: 0 0 6px !important; }
.err-desc  { font-size: 13px; color: #888; line-height: 1.6; margin: 0 0 6px; }
.err-cause { font-size: 12px; color: #e53935; margin: 0 0 1.5rem; line-height: 1.5; }
.err-hint  { font-size: 11px; color: #bbb; margin-top: 1rem; line-height: 1.6; }

.err-detail-box   { background: #f8f8f8; border: 1px solid #eee; border-radius: 10px; padding: 12px 14px; text-align: left; margin-bottom: 1.5rem; }
.err-detail-label { font-size: 10px; font-weight: 600; color: #bbb; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.err-detail-row   { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.err-detail-row:last-child { margin-bottom: 0; }
.err-detail-key   { font-size: 11px; font-weight: 600; color: #999; min-width: 80px; flex-shrink: 0; padding-top: 1px; }
.err-detail-val   { font-size: 12px; color: #555; word-break: break-all; line-height: 1.5; }
.err-detail-val.mono { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 11px; color: #777; }

/* ── Error / no-service shared box ── */
.sso-err-screen   { text-align: center; padding: 1rem 0 0.5rem; }
.sso-err-icon-box { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.sso-err-box      { background: #f8f8f8; border: 1px solid #eee; border-radius: 10px; padding: 12px 14px; text-align: left; margin-bottom: 1.25rem; }
