/*
 * HCA login theme — standalone styling for the custom template.ftl / login.ftl.
 * Light mode only, centered card, brand blue accent (#005cb8, sampled from the
 * HCA logo triangle). No PatternFly dependency.
 */

:root {
  --hca-accent: #005cb8;
  --hca-accent-hover: #004e9e;
  --hca-ring: rgba(0, 92, 184, 0.25);
  --hca-bg: #f6f7fb;
  --hca-card: #ffffff;
  --hca-fg: #0f172a;
  --hca-muted: #64748b;
  --hca-border: #e2e8f0;
  --hca-input-border: #cbd5e1;
  --hca-radius: 14px;
  --hca-radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html.hca-login-html,
body.hca-body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--hca-bg);
  color: var(--hca-fg);
  font-family:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hca-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.hca-card {
  width: 100%;
  max-width: 400px;
  background: var(--hca-card);
  border: 1px solid var(--hca-border);
  border-radius: var(--hca-radius);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 32px rgba(15, 23, 42, 0.08);
  padding: 28px 28px 30px;
}

/* Logo */
.hca-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.hca-logo img {
  height: 34px;
  width: auto;
}

/* Heading */
.hca-head {
  text-align: center;
  margin-bottom: 18px;
}
.hca-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--hca-fg);
}
.hca-subtitle {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--hca-muted);
}

/* Alerts */
.hca-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--hca-border);
  border-radius: var(--hca-radius-sm);
  background: #f8fafc;
  color: var(--hca-fg);
  padding: 10px 12px;
  font-size: 0.8125rem;
  line-height: 1.35;
  margin-bottom: 16px;
}
.hca-alert-icon {
  color: var(--hca-accent);
  font-size: 0.95rem;
  line-height: 1.35;
}
.hca-alert-text strong {
  font-weight: 600;
}
.hca-alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.hca-alert-error .hca-alert-icon {
  color: #dc2626;
}
.hca-alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.hca-alert-warning .hca-alert-icon {
  color: #d97706;
}
.hca-alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.hca-alert-success .hca-alert-icon {
  color: #16a34a;
}

/* Form */
.hca-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hca-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.hca-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hca-fg);
}
.hca-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 0.875rem;
  color: var(--hca-fg);
  background: var(--hca-card);
  border: 1px solid var(--hca-input-border);
  border-radius: var(--hca-radius-sm);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
  outline: none;
}
.hca-input::placeholder {
  color: #94a3b8;
}
.hca-input:focus {
  border-color: var(--hca-accent);
  box-shadow: 0 0 0 3px var(--hca-ring);
}
.hca-input[aria-invalid="true"] {
  border-color: #dc2626;
}

/* Password field with reveal toggle */
.hca-input-wrap {
  position: relative;
}
.hca-input-wrap .hca-input {
  padding-right: 40px;
}
.hca-eye {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--hca-muted);
  cursor: pointer;
}
.hca-eye:hover {
  color: var(--hca-fg);
}
.hca-eye svg {
  width: 16px;
  height: 16px;
}

.hca-field-error {
  font-size: 0.8125rem;
  color: #dc2626;
}

/* Options row */
.hca-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
}
.hca-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--hca-fg);
  cursor: pointer;
}
.hca-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--hca-accent);
  cursor: pointer;
}
.hca-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--hca-fg);
  text-decoration: none;
}
.hca-link:hover {
  color: var(--hca-accent);
}

/* Primary button */
.hca-btn {
  width: 100%;
  height: 40px;
  margin-top: 4px;
  border: 0;
  border-radius: var(--hca-radius-sm);
  background: var(--hca-accent);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
}
.hca-btn:hover {
  background: var(--hca-accent-hover);
}
.hca-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--hca-ring);
}
.hca-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Divider + social (only if IdPs are configured) */
.hca-divider {
  position: relative;
  text-align: center;
  margin: 18px 0;
}
.hca-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid var(--hca-border);
}
.hca-divider span {
  position: relative;
  background: var(--hca-card);
  padding: 0 10px;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--hca-muted);
}
.hca-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hca-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  border: 1px solid var(--hca-input-border);
  border-radius: var(--hca-radius-sm);
  background: var(--hca-card);
  color: var(--hca-fg);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}
.hca-social-btn:hover {
  background: #f8fafc;
}

/* Info footer (e.g. reset-password back link) */
.hca-info {
  margin-top: 18px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--hca-muted);
}
.hca-info a {
  color: var(--hca-fg);
  font-weight: 600;
  text-decoration: none;
}
.hca-info a:hover {
  color: var(--hca-accent);
}

/*
 * Fallbacks for inherited flow pages (reset password, OTP, …) that still use
 * Keycloak's PatternFly markup but render through this template. Keeps them
 * legible without a full per-page port.
 */
.hca-card input[type="text"],
.hca-card input[type="password"],
.hca-card input[type="email"],
.hca-card input[type="number"],
.hca-card select,
.hca-card .pf-c-form-control {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 0.875rem;
  color: var(--hca-fg);
  background: var(--hca-card);
  border: 1px solid var(--hca-input-border);
  border-radius: var(--hca-radius-sm);
  outline: none;
}
.hca-card input[type="text"]:focus,
.hca-card input[type="password"]:focus,
.hca-card input[type="email"]:focus,
.hca-card .pf-c-form-control:focus {
  border-color: var(--hca-accent);
  box-shadow: 0 0 0 3px var(--hca-ring);
}
.hca-card input[type="submit"],
.hca-card button[type="submit"],
.hca-card .pf-c-button.pf-m-primary {
  width: 100%;
  height: 40px;
  margin-top: 8px;
  border: 0;
  border-radius: var(--hca-radius-sm);
  background: var(--hca-accent);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.hca-card input[type="submit"]:hover,
.hca-card button[type="submit"]:hover,
.hca-card .pf-c-button.pf-m-primary:hover {
  background: var(--hca-accent-hover);
}
.hca-card label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hca-fg);
}
.hca-card a {
  color: var(--hca-accent);
}
.hca-card .pf-c-form__group,
.hca-card .form-group {
  margin-bottom: 14px;
}
