/* ──────────────────────────────────────────────────────────────────────────
   Gloroots Auth - Shared Modern Auth Layout (login, signup, forgot/reset
   password, email verification status pages — all portals).
   Palette: positive blues + purple gradient + light gray surfaces
   Typography: Work Sans (headings), Poppins (body)
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --gr-primary: #2563eb;
  --gr-primary-600: #1d4ed8;
  --gr-primary-700: #1e40af;
  --gr-primary-100: #dbeafe;
  --gr-primary-50: #eff6ff;

  --gr-accent: #7c3aed;
  --gr-accent-600: #6d28d9;
  --gr-accent-100: #ede9fe;

  --gr-surface: #ffffff;
  --gr-surface-muted: #f7f8fb;
  --gr-surface-card: #ffffff;
  --gr-border: #e5e7ef;
  --gr-border-strong: #d4d8e3;

  --gr-text-strong: #0f172a;
  --gr-text: #1f2937;
  --gr-text-muted: #6b7280;
  --gr-text-soft: #94a3b8;

  --gr-success: #10b981;
  --gr-success-100: #d1fae5;
  --gr-danger: #dc2626;
  --gr-danger-100: #fee2e2;

  --gr-radius-sm: 8px;
  --gr-radius-md: 12px;
  --gr-radius-lg: 16px;
  --gr-radius-xl: 24px;

  --gr-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --gr-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --gr-shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.12);

  --gr-font-heading: "Work Sans", "Poppins", system-ui, -apple-system, sans-serif;
  --gr-font-body: "Poppins", system-ui, -apple-system, sans-serif;

  --gr-brand-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
  --gr-brand-blob: radial-gradient(closest-side, rgba(124, 58, 237, 0.7), transparent);
}

/* ── Page background ──────────────────────────────────────────────────── */
body.gr-auth-body {
  background-color: var(--gr-surface-muted);
  background-image: none;
  font-family: var(--gr-font-body);
  color: var(--gr-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

/* ── Layout shell ─────────────────────────────────────────────────────── */
.gr-auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
}

@media (max-width: 991.98px) {
  .gr-auth-shell {
    grid-template-columns: 1fr;
  }
}

/* ── Brand panel (left) ───────────────────────────────────────────────── */
.gr-auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 56px;
  color: #ffffff;
  background: var(--gr-brand-gradient);
  isolation: isolate;
}

@media (max-width: 991.98px) {
  .gr-auth-brand {
    padding: 32px 24px;
    min-height: 240px;
  }
}

.gr-auth-brand::before,
.gr-auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
}

.gr-auth-brand::before {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -120px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.45), transparent);
}

.gr-auth-brand::after {
  width: 480px;
  height: 480px;
  bottom: -180px;
  left: -140px;
  background: var(--gr-brand-blob);
}

.gr-auth-brand__logo img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.gr-auth-brand__content {
  max-width: 520px;
  margin: auto 0;
}

.gr-auth-brand__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 20px;
}

.gr-auth-brand__eyebrow .gr-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
}

.gr-auth-brand__title {
  font-family: var(--gr-font-heading);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: #ffffff;
}

.gr-auth-brand__subtitle {
  font-family: var(--gr-font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  max-width: 460px;
}

.gr-auth-brand__features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
  max-width: 520px;
}

.gr-auth-brand__feature {
  padding: 14px 16px;
  border-radius: var(--gr-radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
}

.gr-auth-brand__feature-label {
  font-family: var(--gr-font-heading);
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.gr-auth-brand__feature-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

.gr-auth-brand__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  gap: 16px;
}

@media (max-width: 991.98px) {
  .gr-auth-brand__features,
  .gr-auth-brand__footer {
    display: none;
  }
}

/* ── Per-portal theme variants ────────────────────────────────────────── */
/* Default theme is admin (blue→indigo→purple). These tweak the gradient
   accent + decorative blob color while keeping the form panel identical. */
.gr-auth-shell--employer .gr-auth-brand {
  --gr-brand-gradient: linear-gradient(135deg, #2563eb 0%, #4338ca 55%, #6366f1 100%);
  --gr-brand-blob: radial-gradient(closest-side, rgba(99, 102, 241, 0.7), transparent);
}

.gr-auth-shell--contractor .gr-auth-brand {
  --gr-brand-gradient: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 55%, #9333ea 100%);
  --gr-brand-blob: radial-gradient(closest-side, rgba(147, 51, 234, 0.7), transparent);
}

.gr-auth-shell--employee .gr-auth-brand {
  --gr-brand-gradient: linear-gradient(135deg, #1e40af 0%, #4f46e5 55%, #7c3aed 100%);
  --gr-brand-blob: radial-gradient(closest-side, rgba(99, 102, 241, 0.7), transparent);
}

.gr-auth-shell--partner .gr-auth-brand {
  --gr-brand-gradient: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #7c3aed 100%);
  --gr-brand-blob: radial-gradient(closest-side, rgba(124, 58, 237, 0.7), transparent);
}

/* ── Form panel (right) ───────────────────────────────────────────────── */
.gr-auth-form {
  display: flex;
  flex-direction: column;
  padding: 40px 56px;
  background: var(--gr-surface);
}

@media (max-width: 991.98px) {
  .gr-auth-form {
    padding: 32px 20px;
  }
}

.gr-auth-form__inner {
  width: 100%;
  max-width: 440px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.gr-auth-form__heading {
  text-align: left;
}

.gr-auth-form__heading--center {
  text-align: center;
}

.gr-auth-form__heading h1 {
  font-family: var(--gr-font-heading);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--gr-text-strong);
  margin: 0 0 8px;
}

.gr-auth-form__heading p {
  font-family: var(--gr-font-body);
  font-size: 15px;
  color: var(--gr-text-muted);
  margin: 0;
}

/* ── Status icon (verify success/expired pages) ───────────────────────── */
.gr-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 8px;
}

.gr-status-icon i {
  font-size: 36px;
  line-height: 1;
}

.gr-status-icon--success {
  background: var(--gr-success-100);
  color: var(--gr-success);
}

.gr-status-icon--danger {
  background: var(--gr-danger-100);
  color: var(--gr-danger);
}

/* ── Google SSO ──────────────────────────────────────────────────────── */
.gr-sso-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border-radius: var(--gr-radius-md);
  border: 1px solid var(--gr-border-strong);
  background: var(--gr-surface);
  color: var(--gr-text-strong);
  font-family: var(--gr-font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.gr-sso-button:hover:not(:disabled) {
  border-color: var(--gr-primary);
  background: var(--gr-primary-50);
  box-shadow: var(--gr-shadow-sm);
}

.gr-sso-button:active:not(:disabled) {
  transform: translateY(1px);
}

.gr-sso-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.gr-sso-button img {
  height: 18px;
  width: 18px;
}

.gr-sso-form {
  margin: 0;
  width: 100%;
}

/* ── Separator ───────────────────────────────────────────────────────── */
.gr-auth-separator {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gr-text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.gr-auth-separator::before,
.gr-auth-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gr-border);
}

/* ── Form-level layout: stack rows with consistent spacing ───────────── */
.gr-form-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gr-form-stack--tight {
  gap: 14px;
}

/* ── Form fields ─────────────────────────────────────────────────────── */
.gr-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gr-form-label {
  font-family: var(--gr-font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--gr-text);
  letter-spacing: 0.01em;
}

.gr-form-label--required::after {
  content: " *";
  color: var(--gr-danger);
}

.gr-form-hint {
  font-size: 12px;
  color: var(--gr-text-muted);
  line-height: 1.5;
  margin-top: 4px;
}

.gr-input-wrapper {
  position: relative;
}

.gr-form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--gr-border-strong);
  border-radius: var(--gr-radius-md);
  background: var(--gr-surface);
  font-family: var(--gr-font-body);
  font-size: 14px;
  color: var(--gr-text-strong);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.gr-form-input::placeholder {
  color: var(--gr-text-soft);
}

.gr-form-input:hover {
  border-color: var(--gr-text-soft);
}

.gr-form-input:focus,
.gr-form-input:focus-visible {
  outline: none;
  border-color: var(--gr-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: var(--gr-surface);
}

.gr-input-wrapper--password .gr-form-input {
  padding-right: 48px;
}

.gr-input-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--gr-text-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.gr-input-toggle:hover {
  color: var(--gr-primary);
  background: var(--gr-primary-50);
}

.gr-input-toggle:focus-visible {
  outline: 2px solid var(--gr-primary);
  outline-offset: 2px;
}

.gr-input-toggle i {
  font-size: 18px;
  line-height: 1;
}

/* ── Password strength meter (compatible with Metronic data-kt-password-meter) */
.gr-password-meter {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.gr-password-meter > div {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--gr-border);
  transition: background-color 0.18s ease;
}

[data-kt-password-meter-control="highlight"] {
  display: flex !important;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0 0 !important;
}

[data-kt-password-meter-control="highlight"] > div {
  flex: 1 1 auto !important;
  height: 4px !important;
  border-radius: 999px !important;
  background: var(--gr-border) !important;
  margin: 0 !important;
  transition: background-color 0.18s ease;
}

[data-kt-password-meter-control="highlight"] > div.active {
  background: var(--gr-success) !important;
}

/* ── Helpers row (right-aligned link beneath fields) ─────────────────── */
.gr-form-helpers {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: -8px;
}

.gr-form-helpers--between {
  justify-content: space-between;
}

.gr-link {
  color: var(--gr-primary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease;
}

.gr-link:hover {
  color: var(--gr-primary-700);
  text-decoration: underline;
}

/* ── Terms checkbox ──────────────────────────────────────────────────── */
.gr-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--gr-text-muted);
  line-height: 1.5;
}

.gr-terms input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--gr-border-strong);
  background: var(--gr-surface);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.gr-terms input[type="checkbox"]:hover {
  border-color: var(--gr-primary);
}

.gr-terms input[type="checkbox"]:checked {
  background: var(--gr-primary);
  border-color: var(--gr-primary);
}

.gr-terms input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.gr-terms input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--gr-primary);
  outline-offset: 2px;
}

.gr-terms a {
  color: var(--gr-primary);
  font-weight: 500;
  text-decoration: none;
}

.gr-terms a:hover {
  text-decoration: underline;
}

/* ── Primary submit button ───────────────────────────────────────────── */
.gr-btn-primary {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: var(--gr-radius-md);
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
  font-family: var(--gr-font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.gr-btn-primary,
.gr-btn-primary:hover,
.gr-btn-primary:focus {
  text-decoration: none;
}

.gr-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.32);
}

.gr-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.gr-btn-primary:disabled,
.gr-btn-primary[data-kt-indicator="on"] {
  opacity: 0.85;
  cursor: progress;
}

.gr-btn-primary .indicator-progress {
  display: none;
}

.gr-btn-primary[data-kt-indicator="on"] .indicator-label {
  display: none;
}

.gr-btn-primary[data-kt-indicator="on"] .indicator-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ── Aux link below primary action ───────────────────────────────────── */
.gr-aux-link {
  text-align: center;
  font-size: 14px;
  color: var(--gr-text-muted);
}

.gr-aux-link a {
  color: var(--gr-primary);
  font-weight: 500;
  text-decoration: none;
}

.gr-aux-link a:hover {
  text-decoration: underline;
}

/* ── Footer links ────────────────────────────────────────────────────── */
.gr-auth-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  padding-top: 12px;
  border-top: 1px solid var(--gr-border);
  margin-top: 12px;
}

.gr-auth-footer a {
  color: var(--gr-text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease;
}

.gr-auth-footer a:hover {
  color: var(--gr-primary);
}

/* ── FormValidation overrides ────────────────────────────────────────── */
.fv-plugins-message-container {
  font-family: var(--gr-font-body);
  font-size: 12px;
  color: var(--gr-danger);
  margin-top: 6px;
}

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .gr-sso-button,
  .gr-form-input,
  .gr-input-toggle,
  .gr-link,
  .gr-btn-primary,
  .gr-auth-footer a,
  .gr-terms input[type="checkbox"],
  [data-kt-password-meter-control="highlight"] > div {
    transition: none;
  }
}
