:root {
  --gm-background: #f6f5f1;
  --gm-foreground: #152033;
  --gm-muted: #4b5568;
  --gm-border: #d9dee6;
  --gm-primary: #16324f;
  --gm-primary-foreground: #ffffff;
  --gm-destructive: #b91c1c;
  --gm-card: #ffffff;
  --gm-sans: "Source Sans 3", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --gm-display: Fraunces, "Iowan Old Style", Georgia, serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--gm-background);
  color: var(--gm-foreground);
  font-family: var(--gm-sans);
  font-size: 16px;
  line-height: 1.5;
}

:focus-visible {
  outline: 2px solid var(--gm-primary);
  outline-offset: 2px;
}

.gm-auth {
  min-height: 100vh;
}

.gm-brand {
  display: none;
}

.gm-panel {
  padding: 1.25rem 1rem 2.5rem;
}

.gm-card {
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
}

.gm-mobile-mark,
.gm-mark {
  margin: 0;
  font-family: var(--gm-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.gm-mobile-mark {
  color: var(--gm-primary);
}

.gm-kicker {
  margin: 1.5rem 0 0;
  color: var(--gm-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0.5rem 0 0;
  font-family: var(--gm-display);
  font-size: 2rem;
  font-weight: 560;
  line-height: 1.15;
  color: var(--gm-primary);
}

.gm-mobile-mark + h1 {
  margin-top: 1.5rem;
}

.gm-helper,
.instruction {
  margin: 0.75rem 0 0;
  color: var(--gm-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.gm-hint {
  margin: 0.35rem 0 0;
  color: var(--gm-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.gm-alert {
  margin-top: 1rem;
  border: 1px solid var(--gm-border);
  border-radius: 0.5rem;
  padding: 0.75rem 0.9rem;
  background: var(--gm-card);
  font-size: 0.875rem;
  line-height: 1.5;
}

.gm-alert-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--gm-destructive);
}

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

.gm-alert-warning,
.gm-alert-info {
  color: var(--gm-foreground);
}

.gm-section {
  margin-top: 1.5rem;
  border: 1px solid var(--gm-border);
  border-radius: 0.75rem;
  background: var(--gm-card);
  padding: 1.15rem 1rem 1.25rem;
}

form {
  margin: 0;
}

.gm-field {
  position: relative;
  margin-top: 1rem;
}

.gm-control {
  position: relative;
}

.gm-control > input {
  padding-right: 2.75rem;
}

.gm-field:first-child {
  margin-top: 0;
}

label,
legend {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 650;
}

legend {
  margin-bottom: 0;
  padding: 0;
}

fieldset {
  margin: 1.15rem 0 0;
  padding: 0;
  border: 0;
}

fieldset:first-child {
  margin-top: 0;
}

.gm-optional {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--gm-border);
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--gm-border);
  border-radius: 0.5rem;
  background: var(--gm-card);
  color: var(--gm-foreground);
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--gm-destructive);
}

.gm-error {
  display: block;
  margin-top: 0.35rem;
  color: var(--gm-destructive);
  font-size: 0.875rem;
}

.gm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.gm-button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.65rem 1rem;
  background: var(--gm-primary);
  color: var(--gm-primary-foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
}

.gm-actions input[type="submit"] {
  width: auto;
  min-width: 9rem;
}

.gm-actions-single input[type="submit"] {
  width: 100%;
}

button[name="cancel-aia"] {
  width: auto;
  border: 1px solid var(--gm-border);
  background: transparent;
  color: var(--gm-primary);
}

.gm-reveal {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--gm-muted);
  text-decoration: none;
}

.gm-reveal:hover,
.gm-reveal[aria-pressed="true"] {
  color: var(--gm-primary);
}

.gm-reveal svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.gm-reveal .gm-eye-off,
.gm-reveal[aria-pressed="true"] .gm-eye {
  display: none;
}

.gm-reveal[aria-pressed="true"] .gm-eye-off {
  display: block;
}

button:disabled,
input[type="submit"]:disabled {
  cursor: progress;
  opacity: 0.7;
}

a {
  color: var(--gm-primary);
  font-weight: 650;
}

.gm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.875rem;
}

.gm-login-options {
  margin-top: 1rem;
}

.gm-login-options .gm-check {
  align-items: center;
}

.gm-login-options .gm-check input {
  margin-top: 0;
}

.gm-forgot {
  margin-left: auto;
  font-size: 0.875rem;
  text-underline-offset: 0.18em;
}

.gm-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.gm-check input {
  width: 1rem;
  min-height: 1rem;
  margin-top: 0.2rem;
  accent-color: var(--gm-primary);
}

.gm-switch {
  margin: 1rem 0 0;
  color: var(--gm-muted);
  font-size: 0.875rem;
}

.gm-back {
  margin: 0.65rem 0 0;
}

.gm-back a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border: 1px solid var(--gm-border);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--gm-primary);
  font-size: 0.875rem;
  font-weight: 650;
  text-decoration: none;
}

.gm-back a:hover {
  border-color: var(--gm-primary);
  background: var(--gm-background);
}

.gm-policy ul {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  color: var(--gm-muted);
  font-size: 0.875rem;
}

.gm-policy li + li {
  margin-top: 0.2rem;
}

.gm-address {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--gm-border);
  border-radius: 0.5rem;
  background: var(--gm-card);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.gm-steps {
  margin: 0.85rem 0 0;
  padding-left: 1.2rem;
}

.gm-steps li + li {
  margin-top: 0.75rem;
}

.gm-apps {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.gm-secret {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid var(--gm-border);
  border-radius: 0.5rem;
  background: var(--gm-card);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.gm-qr {
  display: block;
  width: min(100%, 220px);
  height: auto;
  margin: 0.75rem 0;
  background: var(--gm-card);
}

.gm-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.85rem;
  }

  .gm-actions {
    flex-direction: column;
  }

  .gm-actions input[type="submit"],
  button[name="cancel-aia"] {
    width: 100%;
  }
}

@media (min-width: 960px) {
  .gm-auth {
    display: grid;
    grid-template-columns: 20rem minmax(0, 1fr);
  }

  .gm-brand {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 2.5rem;
    background: var(--gm-primary);
    color: #ffffff;
  }

  .gm-mark {
    font-size: 1.35rem;
  }

  .gm-brand-line {
    margin: 0;
    font-size: 0.95rem;
  }

  .gm-brand-copy {
    max-width: 16rem;
    margin: 0.75rem 0 0;
    color: rgb(255 255 255 / 78%);
    font-size: 0.875rem;
    line-height: 1.6;
  }

  .gm-mobile-mark {
    display: none;
  }

  .gm-panel {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4.5rem 2rem 3rem;
  }

  .gm-kicker {
    margin-top: 0;
  }

  .gm-mobile-mark + h1 {
    margin-top: 0;
  }
}

.gm-update-password .gm-card {
  max-width: 28.5rem;
}

.gm-update-password .gm-helper {
  max-width: 36rem;
}

.gm-update-password .gm-section {
  padding: 1.25rem 1.15rem 1.2rem;
}

.gm-update-password .gm-error,
.gm-update-password .gm-alert,
.gm-update-password .gm-rule-text,
.gm-update-password .gm-check-hint {
  overflow-wrap: anywhere;
}

.gm-update-password .gm-control > input:focus-visible {
  border-color: var(--gm-primary);
  outline: 2px solid var(--gm-primary);
  outline-offset: 2px;
}

.gm-update-password .gm-inset {
  margin-top: 1.15rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--gm-border);
  border-radius: 0.5rem;
  background: var(--gm-background);
}

.gm-update-password .gm-rules-title {
  margin: 0;
  color: var(--gm-foreground);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.4;
}

.gm-update-password .gm-rules ul {
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
}

.gm-update-password .gm-rule {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr) auto;
  gap: 0.45rem 0.65rem;
  align-items: start;
  margin: 0;
  padding: 0.28rem 0;
  color: var(--gm-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.gm-update-password .gm-rule[data-rule="info"] {
  grid-template-columns: 1rem minmax(0, 1fr);
}

.gm-update-password .gm-rule-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-top: 0.12rem;
  border: 1.5px solid #8b95a7;
  border-radius: 999px;
  background: var(--gm-card);
  color: transparent;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.gm-update-password .gm-rule[data-state="info"] .gm-rule-mark {
  border-radius: 0.2rem;
}

.gm-update-password .gm-rule[data-state="met"] {
  color: var(--gm-foreground);
}

.gm-update-password .gm-rule[data-state="met"] .gm-rule-mark {
  border-color: #166534;
  background: #166534;
  color: #ffffff;
}

.gm-update-password .gm-rule[data-state="met"] .gm-rule-mark::before {
  content: "✓";
}

.gm-update-password .gm-rule[data-state="unmet"] .gm-rule-mark {
  border-color: var(--gm-destructive);
  color: var(--gm-destructive);
}

.gm-update-password .gm-rule[data-state="unmet"] .gm-rule-mark::before {
  content: "!";
}

.gm-update-password .gm-rule-status {
  min-width: 5.5rem;
  color: var(--gm-muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}

.gm-update-password .gm-rule[data-state="met"] .gm-rule-status {
  color: #166534;
}

.gm-update-password .gm-rule[data-state="unmet"] .gm-rule-status {
  color: var(--gm-destructive);
}

.gm-update-password .gm-session .gm-check {
  align-items: flex-start;
  font-weight: 400;
}

.gm-update-password .gm-check-label {
  display: block;
  color: var(--gm-foreground);
  font-weight: 650;
  line-height: 1.35;
}

.gm-update-password .gm-check-hint {
  display: block;
  margin-top: 0.25rem;
  color: var(--gm-muted);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
}

.gm-update-password .gm-actions {
  margin-top: 1.35rem;
}

.gm-update-password .gm-actions input[type="submit"] {
  min-width: 11.5rem;
}

@media (min-width: 960px) {
  .gm-update-password .gm-panel {
    align-items: safe center;
    min-height: 100vh;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

@media (max-width: 480px) {
  .gm-update-password .gm-section {
    padding: 1.05rem 0.95rem 1.1rem;
  }

  .gm-update-password .gm-rule-status {
    min-width: 4.6rem;
  }
}

.gm-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  margin: 0 0 1.15rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--gm-border);
  border-radius: 0.5rem;
  background: var(--gm-background);
}

.gm-identity-main {
  display: flex;
  min-width: 0;
  flex: 1 1 12rem;
  flex-direction: column;
  gap: 0.1rem;
}

.gm-identity-label {
  color: var(--gm-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.gm-identity-name {
  color: var(--gm-foreground);
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.gm-identity a {
  flex: 0 0 auto;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.35;
  text-underline-offset: 0.18em;
}

.gm-reauth .gm-reauth-options {
  justify-content: flex-start;
}

.gm-reauth .gm-forgot {
  margin-left: 0;
}

@media (min-width: 960px) {
  .gm-reauth .gm-panel {
    align-items: safe center;
    min-height: 100vh;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

/* Mimar v1: shared form foundation for all login and required-action pages. */
:root { --gm-background:#f6f5f1; --gm-primary:#2459a6; --gm-destructive:#8a3b2f;
 --gm-sans:"Segoe UI",ui-sans-serif,system-ui,sans-serif; --gm-display:var(--gm-sans); }
.mimar-admin { --gm-primary:#2459a6; background:#14283f; }
.gm-auth { display:flex; min-height:100vh; align-items:center; justify-content:center; }
.gm-panel { display:block; width:100%; min-height:0; padding:2.5rem 1rem; }
.gm-card { max-width:32rem; padding:2rem; border:1px solid var(--gm-border); border-radius:.75rem; background:#fff; overflow-wrap:anywhere; }
.gm-mobile-mark { display:block; margin:0; font-family:var(--gm-sans); font-size:1.25rem; font-weight:700; letter-spacing:0; color:#14283f; }
.gm-audience { margin:.5rem 0 1.5rem; color:var(--gm-muted); font-size:.875rem; }
h1 { font-family:var(--gm-sans); font-size:1.75rem; font-weight:650; line-height:1.25; }
.gm-section { border:0; border-radius:0; padding:0; margin-top:1.5rem; }
.gm-row { align-items:center; gap:.75rem; flex-wrap:wrap; }
.gm-check { margin:0; }
.gm-alert,.gm-error,.gm-helper { overflow-wrap:anywhere; }
.gm-caps { color:#8a5a12; font-size:.875rem; margin:.5rem 0; }
.gm-actions-single input[type=submit],#kc-login { width:100%; }
@media(min-width:960px) {
 .gm-panel,.gm-update-password .gm-panel,.gm-reauth .gm-panel { display:block; min-height:0; padding:2.5rem 1rem; }
 .gm-mobile-mark { display:block; }
}
@media(max-width:480px) { .gm-auth { align-items:flex-start; } .gm-panel { padding:1rem; } .gm-card { padding:1.25rem; } h1 { font-size:1.5rem; } }

.gm-login h1 { margin-top:0; color:#14283f; }
.gm-recovery-preview button:disabled {
  display:inline; min-width:0; min-height:0; padding:0; border:0;
  background:transparent; color:var(--gm-muted); font:inherit;
  font-size:.875rem; text-align:left; opacity:1; cursor:not-allowed;
}
.gm-recovery-preview .gm-hint { margin-top:.25rem; }
