/* ==========================================================================
   HybridHR – Global Stylesheet
   Design tokens + component styles for the workspace setup / sign-up flow.
   Drop this file into your app and link it once; all classes below are
   namespaced with "hhr-" to avoid collisions with existing styles.
   ========================================================================== */

:root {
  /* Color */
  --hhr-blue-600: #2563EB;
  --hhr-blue-50: #EFF4FF;
  --hhr-blue-100: #DBE7FE;
  --hhr-teal-500: #14BBA6;
  --hhr-teal-50: #E9FBF8;
  --hhr-green-600: #16A34A;
  --hhr-green-50: #EEFBF3;

  --hhr-gray-900: #101828;
  --hhr-gray-700: #344054;
  --hhr-gray-600: #475467;
  --hhr-gray-500: #667085;
  --hhr-gray-400: #98A2B3;
  --hhr-gray-200: #E4E7EC;
  --hhr-gray-100: #F2F4F7;
  --hhr-gray-50: #F9FAFB;
  --hhr-white: #FFFFFF;

  /* Type */
  --hhr-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Radius / shadow */
  --hhr-radius-sm: 8px;
  --hhr-radius-md: 12px;
  --hhr-radius-lg: 16px;
  --hhr-shadow-card: 0 1px 2px rgba(16, 24, 40, 0.05);
  --hhr-shadow-panel: 0 4px 24px rgba(16, 24, 40, 0.06);

  /* Spacing scale */
  --hhr-space-1: 4px;
  --hhr-space-2: 8px;
  --hhr-space-3: 12px;
  --hhr-space-4: 16px;
  --hhr-space-5: 20px;
  --hhr-space-6: 24px;
  --hhr-space-8: 32px;
}

* { box-sizing: border-box; }

.hhr-app {
  font-family: var(--hhr-font);
  color: var(--hhr-gray-900);
  background: var(--hhr-gray-50);
  min-height: 100vh;
}

/* ---------------- Top bar ---------------- */

.hhr-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--hhr-white);
  border-bottom: 1px solid var(--hhr-gray-200);
}

.hhr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--hhr-gray-900);
}

.hhr-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--hhr-blue-600), var(--hhr-teal-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hhr-white);
  font-size: 15px;
}

.hhr-step-indicator {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hhr-step-label {
  font-size: 13px;
  color: var(--hhr-gray-500);
  font-weight: 500;
}

.hhr-step-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hhr-dot {
  width: 34px;
  height: 6px;
  border-radius: 4px;
  background: var(--hhr-gray-200);
}

.hhr-dot.is-done { background: var(--hhr-blue-600); }
.hhr-dot.is-active {
  background: var(--hhr-blue-600);
  box-shadow: 0 0 0 3px var(--hhr-blue-100);
}

/* ---------------- Layout ---------------- */

.hhr-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.hhr-form-col {
  padding: 32px 40px 40px;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.hhr-preview-col {
  padding: 28px 24px 32px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--hhr-gray-50);
  border-left: 1px solid var(--hhr-gray-200);
}

.hhr-preview-inner {
  max-width: 380px;
  margin: 0 auto;
}

.hhr-page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.hhr-page-subtitle {
  font-size: 14px;
  color: var(--hhr-gray-500);
  margin: 0 0 28px;
}

/* ---------------- Section cards ---------------- */

.hhr-section {
  background: var(--hhr-white);
  border: 1px solid var(--hhr-gray-200);
  border-radius: var(--hhr-radius-lg);
  box-shadow: var(--hhr-shadow-card);
  padding: 24px;
  margin-bottom: 20px;
}

.hhr-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.hhr-section-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--hhr-gray-900);
  color: var(--hhr-white);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hhr-section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.hhr-section-desc {
  font-size: 13px;
  color: var(--hhr-gray-500);
  margin: 4px 0 20px 34px;
}

/* ---------------- Form fields ---------------- */

.hhr-field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.hhr-field-row.hhr-cols-2 { grid-template-columns: 1fr 1fr; }

.hhr-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hhr-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--hhr-gray-700);
}

.hhr-input,
.hhr-select {
  font-family: inherit;
  font-size: 14px;
  color: var(--hhr-gray-900);
  padding: 10px 12px;
  border: 1px solid var(--hhr-gray-200);
  border-radius: var(--hhr-radius-sm);
  background: var(--hhr-white);
  width: 100%;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hhr-input::placeholder { color: var(--hhr-gray-400); }

.hhr-input:focus,
.hhr-select:focus {
  border-color: var(--hhr-blue-600);
  box-shadow: 0 0 0 3px var(--hhr-blue-100);
}

.hhr-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%23667085' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.hhr-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--hhr-green-600);
  font-size: 13px;
  font-weight: 500;
}

/* ---------------- Auth / integration method cards ---------------- */

.hhr-method-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.hhr-method-card {
  position: relative;
  border: 1px solid var(--hhr-gray-200);
  border-radius: var(--hhr-radius-md);
  padding: 18px 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: var(--hhr-white);
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
}

.hhr-method-card:hover { border-color: var(--hhr-gray-400); }

.hhr-method-card:has(input:checked) {
  border-color: var(--hhr-blue-600);
  background: var(--hhr-blue-50);
}

.hhr-method-card:focus-within {
  outline: 2px solid var(--hhr-blue-600);
  outline-offset: 2px;
}

.hhr-method-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.hhr-method-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--hhr-gray-700);
  text-align: center;
}

.hhr-method-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--hhr-gray-300, #D0D5DD);
  background: var(--hhr-white);
}

.hhr-method-card:has(input:checked) .hhr-method-check {
  background: var(--hhr-blue-600);
  border-color: var(--hhr-blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hhr-method-card:has(input:checked) .hhr-method-check::after {
  content: "✓";
  color: var(--hhr-white);
  font-size: 11px;
  line-height: 1;
}

/* Upload zone */

.hhr-upload-zone {
  border: 1.5px dashed var(--hhr-gray-200);
  border-radius: var(--hhr-radius-sm);
  padding: 18px 12px;
  text-align: center;
  color: var(--hhr-gray-500);
  font-size: 12.5px;
  cursor: pointer;
  background: var(--hhr-gray-50);
}

.hhr-upload-zone strong {
  display: block;
  color: var(--hhr-blue-600);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}

.hhr-uploaded-file {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--hhr-gray-200);
  border-radius: var(--hhr-radius-sm);
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--hhr-gray-700);
  background: var(--hhr-white);
}

/* Toggle rows */

.hhr-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--hhr-gray-100);
}

.hhr-toggle-row:first-of-type { border-top: 1px solid var(--hhr-gray-100); margin-top: 6px; }

.hhr-toggle-text strong {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--hhr-gray-900);
}

.hhr-toggle-text span {
  font-size: 12.5px;
  color: var(--hhr-gray-500);
}

.hhr-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.hhr-switch input { opacity: 0; width: 0; height: 0; }

.hhr-switch-track {
  position: absolute;
  inset: 0;
  background: var(--hhr-gray-200);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.hhr-switch-track::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: var(--hhr-white);
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2);
}

.hhr-switch input:checked + .hhr-switch-track { background: var(--hhr-blue-600); }
.hhr-switch input:checked + .hhr-switch-track::before { transform: translateX(18px); }

/* ---------------- Branding ---------------- */

.hhr-branding-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.hhr-logo-drop {
  border: 1.5px dashed var(--hhr-gray-200);
  border-radius: var(--hhr-radius-md);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--hhr-gray-50);
}

.hhr-logo-drop-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--hhr-blue-600), var(--hhr-teal-500));
}

.hhr-logo-drop-text strong {
  display: block;
  font-size: 13.5px;
}

.hhr-logo-drop-text a {
  font-size: 12px;
  color: var(--hhr-blue-600);
  text-decoration: none;
  font-weight: 500;
}

.hhr-color-swatch-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hhr-color-input {
  -webkit-appearance: none;
  appearance: none;
  width: 38px;
  height: 38px;
  border-radius: var(--hhr-radius-sm);
  border: 1px solid var(--hhr-gray-200);
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  background: none;
}

.hhr-color-input::-webkit-color-swatch-wrapper { padding: 3px; }
.hhr-color-input::-webkit-color-swatch { border: none; border-radius: 5px; }
.hhr-color-input::-moz-color-swatch { border: none; border-radius: 5px; }

/* ---------------- Footer actions ---------------- */

.hhr-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.hhr-actions-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hhr-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--hhr-radius-sm);
  padding: 11px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hhr-btn-secondary {
  background: var(--hhr-white);
  color: var(--hhr-gray-700);
  border-color: var(--hhr-gray-200);
}

.hhr-btn-primary {
  background: var(--hhr-blue-600);
  color: var(--hhr-white);
}

.hhr-link-muted {
  font-size: 13.5px;
  color: var(--hhr-gray-600);
  text-decoration: none;
  font-weight: 500;
}

/* ---------------- Live preview panel ---------------- */

.hhr-preview-header {
  margin-bottom: 16px;
}

.hhr-preview-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 2px;
}

.hhr-preview-subtitle {
  font-size: 12.5px;
  color: var(--hhr-gray-500);
  margin: 0;
}

.hhr-mock {
  background: var(--hhr-white);
  border: 1px solid var(--hhr-gray-200);
  border-radius: var(--hhr-radius-lg);
  box-shadow: var(--hhr-shadow-panel);
  overflow: hidden;
  display: grid;
  grid-template-columns: 118px 1fr;
  min-height: 380px;
}

.hhr-mock-sidebar {
  background: var(--hhr-gray-50);
  border-right: 1px solid var(--hhr-gray-200);
  padding: 14px 10px;
}

.hhr-mock-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
  padding: 0 6px;
}

.hhr-mock-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--hhr-gray-600);
  padding: 8px 8px;
  border-radius: 7px;
  margin-bottom: 2px;
}

.hhr-mock-nav-item.is-active {
  background: var(--hhr-blue-50);
  color: var(--hhr-blue-600);
  font-weight: 600;
}

.hhr-mock-main { padding: 16px 18px; }

.hhr-mock-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hhr-mock-search {
  flex: 1;
  max-width: 220px;
  font-size: 12px;
  color: var(--hhr-gray-400);
  background: var(--hhr-gray-50);
  border: 1px solid var(--hhr-gray-200);
  border-radius: 8px;
  padding: 7px 10px;
}

.hhr-mock-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hhr-mock-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--hhr-teal-500);
  color: var(--hhr-white);
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hhr-mock-greeting {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 2px;
}

.hhr-mock-greeting-sub {
  font-size: 11.5px;
  color: var(--hhr-gray-500);
  margin: 0 0 14px;
}

.hhr-mock-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.hhr-mock-stat {
  border: 1px solid var(--hhr-gray-200);
  border-radius: 10px;
  padding: 10px;
}

.hhr-mock-stat-label {
  font-size: 10.5px;
  color: var(--hhr-gray-500);
  margin-bottom: 4px;
}

.hhr-mock-stat-value {
  font-size: 17px;
  font-weight: 700;
}

.hhr-mock-stat-sub {
  font-size: 10px;
  color: var(--hhr-gray-400);
}

.hhr-mock-lists {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.hhr-mock-panel {
  border: 1px solid var(--hhr-gray-200);
  border-radius: 10px;
  padding: 10px;
}

.hhr-mock-panel-title {
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.hhr-mock-panel-title span { color: var(--hhr-blue-600); font-weight: 500; font-size: 10.5px; }

.hhr-mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--hhr-gray-600);
  padding: 5px 0;
}

.hhr-mock-tag {
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--hhr-teal-50);
  color: var(--hhr-teal-500);
}

/* Sign-in preview card */

.hhr-signin-card {
  background: var(--hhr-white);
  border: 1px solid var(--hhr-gray-200);
  border-radius: var(--hhr-radius-lg);
  box-shadow: var(--hhr-shadow-panel);
  padding: 24px;
  text-align: center;
  margin-top: 20px;
}

.hhr-signin-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
}

.hhr-signin-sub {
  font-size: 12.5px;
  color: var(--hhr-gray-500);
  margin: 0 0 18px;
}

.hhr-signin-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--hhr-gray-700);
  border: 1px solid var(--hhr-gray-200);
  border-radius: var(--hhr-radius-sm);
  padding: 11px;
  background: var(--hhr-white);
  margin-bottom: 10px;
  cursor: pointer;
}

.hhr-signin-divider {
  font-size: 11.5px;
  color: var(--hhr-gray-400);
  margin: 8px 0;
}

.hhr-signin-email-link {
  font-size: 13px;
  color: var(--hhr-blue-600);
  font-weight: 600;
  text-decoration: none;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1100px) {
  .hhr-layout { grid-template-columns: 1fr; }
  .hhr-preview-col { position: static; height: auto; border-left: none; border-top: 1px solid var(--hhr-gray-200); }
  .hhr-method-grid { grid-template-columns: repeat(3, 1fr); }
  .hhr-branding-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .hhr-field-row { grid-template-columns: 1fr; }
  .hhr-method-grid { grid-template-columns: repeat(2, 1fr); }
  .hhr-branding-row { grid-template-columns: 1fr; }
  .hhr-actions { flex-direction: column; gap: 14px; align-items: stretch; }
  .hhr-actions-right { justify-content: space-between; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Visible keyboard focus */
.hhr-btn:focus-visible,
.hhr-method-card:focus-visible,
.hhr-switch-track:focus-visible {
  outline: 2px solid var(--hhr-blue-600);
  outline-offset: 2px;
}