/* IA&AD single sign-on — training.cag.gov.in/sso */
:root {
  --sso-primary: #005FB0;
  --sso-primary-dark: #004a8a;
  --sso-navy: #0b2e52;
  --sso-text: #1d2125;
  --sso-muted: #5f6b76;
  --sso-border: #d5dbe1;
  --sso-bg: #f2f4f7;
  --sso-danger: #b42318;
  --sso-danger-bg: #fef3f2;
  --sso-success: #3f7a2b;
  --sso-radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Poppins, "Segoe UI", -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--sso-text); background: var(--sso-bg);
}
a { color: var(--sso-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.sso-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.sso-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 46%) 1fr; }
.sso-brand {
  position: relative; overflow: hidden; color: #fff; padding: 48px 56px;
  background: linear-gradient(150deg, #0b2e52 0%, #0a4380 55%, #005FB0 100%);
  display: flex; flex-direction: column;
}
.sso-brand::before, .sso-brand::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(255,255,255,.10);
}
.sso-brand::before { width: 560px; height: 560px; right: -220px; bottom: -200px; }
.sso-brand::after  { width: 380px; height: 380px; right: -130px; bottom: -110px; border-color: rgba(255,255,255,.14); }
.sso-org { display: flex; align-items: center; gap: 14px; }
.sso-mark {
  width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25); display: grid; place-items: center; flex: none;
}
.sso-mark svg { width: 26px; height: 26px; }
.sso-org-name { font-size: 13px; letter-spacing: .02em; opacity: .9; line-height: 1.35; }
.sso-org-name b { display: block; font-size: 15px; letter-spacing: 0; opacity: 1; font-weight: 600; }
.sso-pitch { margin-top: auto; padding-top: 48px; max-width: 460px; position: relative; z-index: 1; }
.sso-eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; opacity: .75; font-weight: 500; }
.sso-pitch h1 { font-size: 32px; line-height: 1.2; margin: 10px 0 14px; font-weight: 600; letter-spacing: -.01em; }
.sso-pitch p { margin: 0; opacity: .85; font-size: 15px; }
.sso-portals { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.sso-portals li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.sso-portals li span.dot {
  width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.14);
  display: grid; place-items: center; flex: none;
}
.sso-portals li span.dot svg { width: 14px; height: 14px; }
.sso-brand-foot { margin-top: 48px; font-size: 12px; opacity: .7; position: relative; z-index: 1; }

.sso-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.sso-card {
  width: 100%; max-width: 420px; background: #fff; border: 1px solid #e3e7ec; border-radius: 16px;
  padding: 36px 36px 28px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 12px 32px rgba(16,24,40,.08);
}
.sso-card h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.sso-sub { margin: 6px 0 0; color: var(--sso-muted); font-size: 14px; }
.sso-dest {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 12px;
  background: #eef5fc; color: var(--sso-primary-dark); border-radius: 999px; font-size: 13px; font-weight: 500;
}
.sso-dest svg { width: 14px; height: 14px; }

/* ---------- form ---------- */
.sso-form { margin-top: 26px; display: grid; gap: 18px; }
.sso-field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.sso-input {
  width: 100%; height: 46px; padding: 0 14px; font: inherit; font-size: 15px; color: var(--sso-text);
  border: 1px solid var(--sso-border); border-radius: var(--sso-radius); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.sso-input:focus { outline: none; border-color: var(--sso-primary); box-shadow: 0 0 0 4px rgba(0,95,176,.14); }
.sso-pw { position: relative; }
.sso-pw .sso-input { padding-right: 70px; }
.sso-pw button {
  position: absolute; right: 6px; top: 6px; height: 34px; padding: 0 10px; border: 0; background: none;
  color: var(--sso-primary); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; border-radius: 8px;
}
.sso-pw button:hover { background: #eef5fc; }
.sso-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-top: -6px; }
.sso-captcha { display: grid; grid-template-columns: 150px 40px 1fr; gap: 8px; align-items: center; }
.sso-captcha img { width: 150px; height: 46px; border-radius: var(--sso-radius); border: 1px solid var(--sso-border); display: block; background: #fff; }
.sso-icon-btn {
  width: 40px; height: 46px; border: 1px solid var(--sso-border); border-radius: var(--sso-radius); background: #fff;
  display: grid; place-items: center; cursor: pointer; color: var(--sso-muted);
}
.sso-icon-btn:hover { color: var(--sso-primary); border-color: var(--sso-primary); }
.sso-icon-btn svg { width: 18px; height: 18px; }
.sso-btn {
  width: 100%; height: 48px; border: 0; border-radius: var(--sso-radius); background: var(--sso-primary);
  color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s;
}
.sso-btn:hover { background: var(--sso-primary-dark); }
.sso-btn:focus-visible { outline: 3px solid rgba(0,95,176,.35); outline-offset: 2px; }
.sso-btn.ghost { background: #fff; color: var(--sso-primary); border: 1px solid var(--sso-border); font-weight: 500; }
.sso-btn.ghost:hover { background: #f5f8fb; }
.sso-link-btn { border: 0; background: none; color: var(--sso-primary); font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.sso-link-btn:hover { text-decoration: underline; }

.sso-alert {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--sso-radius); font-size: 14px;
  background: var(--sso-danger-bg); color: var(--sso-danger); border: 1px solid #fecdca;
}
.sso-alert.info { background: #eef5fc; color: #0b4a85; border-color: #cfe1f5; }
.sso-alert.ok { background: #edf6ea; color: var(--sso-success); border-color: #cfe5c6; }

/* role choice */
.sso-roles { display: grid; gap: 8px; }
.sso-roles table { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin: -8px 0; }
.sso-roles td { padding: 0; }
.sso-roles input[type=radio] { position: absolute; opacity: 0; }
.sso-roles label {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--sso-border);
  border-radius: var(--sso-radius); cursor: pointer; font-size: 14px; font-weight: 500; transition: border-color .15s, background .15s;
}
.sso-roles label::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #9aa5b1; flex: none; box-sizing: border-box;
}
.sso-roles input[type=radio]:checked + label { border-color: var(--sso-primary); background: #f3f8fd; }
.sso-roles input[type=radio]:checked + label::before { border: 5px solid var(--sso-primary); }
.sso-roles input[type=radio]:focus-visible + label { box-shadow: 0 0 0 4px rgba(0,95,176,.14); }
.sso-hint { font-size: 13px; color: var(--sso-muted); margin: 0; }

.sso-otp { letter-spacing: .5em; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.sso-foot { margin-top: 26px; padding-top: 18px; border-top: 1px solid #eef0f3; font-size: 12px; color: var(--sso-muted); text-align: center; }
.sso-foot a { color: var(--sso-muted); }

/* signed-out page */
.sso-done-icon { width: 52px; height: 52px; border-radius: 50%; background: #edf6ea; color: var(--sso-success); display: grid; place-items: center; margin-bottom: 18px; }
.sso-done-icon svg { width: 26px; height: 26px; }
.sso-frames { position: absolute; width: 0; height: 0; border: 0; overflow: hidden; }

@media (max-width: 900px) {
  .sso-shell { grid-template-columns: 1fr; }
  .sso-brand { padding: 24px; }
  .sso-pitch { padding-top: 20px; }
  .sso-pitch h1 { font-size: 22px; margin: 6px 0 6px; }
  .sso-pitch p, .sso-portals, .sso-brand-foot { display: none; }
  .sso-main { padding: 24px 16px 40px; align-items: flex-start; }
  .sso-card { padding: 28px 22px 22px; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
