/* GP Capital Management Suite sign-in pages. Each firm's colours arrive as
   --firm-primary and --firm-accent from the back office (/brand/{realm}/theme.css);
   these defaults are Grey Parrot's. No script builds the layout: template.ftl
   renders it, so every page works without JavaScript. */

@font-face {
  font-family: "Satoshi";
  src: url("./fonts/Satoshi-Regular.woff2") format("woff2"), url("./fonts/Satoshi-Regular.woff") format("woff"),
    url("./fonts/Satoshi-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --firm-primary: #1f2a44;
  --firm-accent: #b8932f;
  --ink: #1b1f1d;
  --muted: #5e6461;
  --line: #d9d7d0;
  --surface: #ffffff;
  --canvas: #f7f6f2;
  --danger: #b4432f;
  --success: #1e7b4f;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.gp-body {
  font-family: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
}

/* The split: the form on the left, the illustration on the right. */
.gp-login { display: flex; min-height: 100vh; }
.gp-panel {
  width: 42%;
  min-width: 420px;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 3rem 1.5rem;
  background: var(--surface);
}
.gp-panel > * { width: 100%; max-width: 440px; margin-inline: auto; }
.gp-art {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: color-mix(in srgb, var(--firm-primary) 8%, var(--canvas));
  border-left: 4px solid var(--firm-accent);
}
.gp-art img { width: 80%; max-width: 720px; height: auto; }
@media (max-width: 900px) {
  .gp-art { display: none; }
  .gp-panel { width: 100%; min-width: 0; padding: 1.5rem 1.25rem 1rem; }
}

/* The firm. */
#kc-header { margin: 0 auto 2rem; }
.gp-brand { display: flex; align-items: center; gap: 0.75rem; }
.gp-logo { height: 56px; width: auto; max-width: 220px; object-fit: contain; }

/* The card. */
.gp-card { flex: 1; }
#kc-page-title { font-size: 1.75rem; font-weight: 600; margin: 0 0 1.5rem; letter-spacing: -0.01em; }
.subtitle { font-size: 0.85rem; color: var(--muted); }
.required { color: var(--danger); }
p, .instruction { color: var(--muted); }
a { color: var(--firm-primary); font-weight: 600; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }

/* Fields. */
.gp-field { margin-top: 1.25rem; }
.gp-label, .gp-field label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--ink); margin-bottom: 0.35rem; }
.gp-input, .gp-field input[type="text"], .gp-field input[type="email"], .gp-field input[type="password"],
.gp-field input[type="tel"], .gp-field input[type="number"], .gp-field select {
  width: 100%;
  padding: 0.8rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gp-input:focus, .gp-field input:focus, .gp-field select:focus {
  border-color: var(--firm-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--firm-primary) 18%, transparent);
}
.gp-input[aria-invalid="true"], .gp-field input[aria-invalid="true"] {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 5%, white);
}
.gp-error, [id^="input-error"] { display: block; margin-top: 0.35rem; color: var(--danger); font-size: 0.85rem; }
.gp-help { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.85rem; }

/* Show or hide the password. */
.gp-input-group { position: relative; display: flex; }
.gp-input-group .gp-input { padding-right: 4.5rem; }
.gp-reveal {
  position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer; padding: 0.35rem 0.5rem;
  color: var(--firm-primary); font: inherit; font-weight: 600; font-size: 0.85rem;
}
.gp-reveal-show::after { content: "Show"; font-style: normal; }
.gp-reveal-hide::after { content: "Hide"; font-style: normal; }

/* Remember me and forgot password. */
.gp-settings { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.gp-settings .checkbox label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; margin: 0; }
.gp-options { font-size: 0.9rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--firm-primary); width: 1rem; height: 1rem; }

/* Buttons. */
.gp-button, input[type="submit"], button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85rem 1.25rem; font: inherit; font-weight: 600; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; transition: filter 0.15s;
}
.gp-button-primary, input[type="submit"].gp-button, #kc-login {
  background: var(--firm-primary); color: #fff;
}
.gp-button-primary:hover, #kc-login:hover { filter: brightness(1.1); }
.gp-button-secondary { background: var(--surface); color: var(--firm-primary); border-color: var(--line); }
.gp-button-block { width: 100%; }
#kc-form-buttons { margin-top: 1.75rem; display: flex; flex-direction: column; gap: 0.75rem; }
.gp-button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--firm-accent) 70%, transparent); outline-offset: 2px; }

/* Messages. */
.gp-alert {
  display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 1.25rem;
  padding: 0.85rem 1rem; border-radius: var(--radius); font-size: 0.925rem;
  border: 1px solid var(--line); background: var(--canvas);
}
.alert-error.gp-alert { border-color: color-mix(in srgb, var(--danger) 35%, white); background: color-mix(in srgb, var(--danger) 7%, white); color: #7a2a1d; }
.alert-success.gp-alert { border-color: color-mix(in srgb, var(--success) 35%, white); background: color-mix(in srgb, var(--success) 7%, white); color: #14532d; }
.alert-warning.gp-alert { border-color: #e7c873; background: #fdf6e3; color: #6b4e00; }
.alert-info.gp-alert { border-color: color-mix(in srgb, var(--firm-primary) 25%, white); background: color-mix(in srgb, var(--firm-primary) 6%, white); }
.pf-c-alert__icon:empty { display: none; }

/* Who is signing in, and starting again. */
#kc-username { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--canvas); margin: -0.5rem 0 1.25rem; }
#kc-attempted-username { font-weight: 600; margin: 0; }
.kc-tooltip-text { font-size: 0.85rem; }
.kc-login-tooltip i { display: none; }

/* Authenticator set-up: the steps and the QR code. */
#kc-totp-settings { padding-left: 1.25rem; color: var(--muted); }
#kc-totp-settings li { margin-bottom: 0.75rem; }
#kc-totp-supported-apps { margin: 0.35rem 0 0; padding-left: 1.1rem; }
#kc-totp-secret-qr-code { display: block; width: 180px; height: 180px; margin: 0.75rem 0; padding: 0.5rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
#kc-totp-secret-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; word-break: break-all; color: var(--ink); }

/* Choosing another way to sign in. */
#try-another-way { display: inline-block; margin-top: 1rem; font-size: 0.9rem; }
.select-auth-box-parent, ul.pf-l-stack > li { list-style: none; }
.select-auth-box-parent { display: flex; gap: 0.75rem; align-items: center; padding: 0.9rem 1rem; margin-bottom: 0.6rem;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.select-auth-box-parent:hover { border-color: var(--firm-primary); }

/* Sign-up link (only where a realm allows it) and the footer. */
.gp-info { margin-top: 1.5rem; font-size: 0.9rem; color: var(--muted); }
.gp-footer { margin-top: 2rem; padding-top: 1rem; display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  font-size: 0.8rem; color: var(--muted); }
.gp-footer img { height: 18px; width: auto; }

.gp-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
