/* Hesskey Web Portal — Shared Brand Styles */

:root {
  --hk-green: #4CAF50;
  --hk-green-dark: #388E3C;
  --hk-green-light: #E8F5E9;
  --hk-yellow: #FFC107;
  --hk-orange: #FF9800;
  --hk-purple: #7B1FA2;
  --hk-bg: #FAFAFA;
  --hk-white: #FFFFFF;
  --hk-dark: #212121;
  --hk-grey: #757575;
  --hk-light-grey: #F5F5F5;
  --hk-border: #E0E0E0;
  /* No red in the Hesskey palette — "danger" / "failed" states use a darker
     Hesskey orange (orange-700) so the badge stands out without leaving the
     brand. `--hk-red` stays named for compatibility. */
  --hk-red: #EF6C00;
  --hk-radius: 12px;
  --hk-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --hk-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--hk-font);
  background: var(--hk-bg);
  color: var(--hk-dark);
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.hk-header {
  background: var(--hk-green);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.hk-header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.hk-header-icon {
  width: 36px;
  height: 36px;
  background: var(--hk-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.hk-header-title {
  color: var(--hk-white);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hk-header-subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 400;
}

.hk-header-nav {
  display: flex;
  gap: 16px;
}

.hk-header-nav a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.hk-header-nav a:hover,
.hk-header-nav a.active {
  background: rgba(255,255,255,0.15);
}

/* ── Main Content ───────────────────────────────────────────────────────── */

.hk-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px;
}

.hk-card {
  background: var(--hk-white);
  border-radius: var(--hk-radius);
  box-shadow: var(--hk-shadow);
  padding: 32px;
  margin-bottom: 24px;
}

.hk-card-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--hk-dark);
}

.hk-card-subtitle {
  font-size: 14px;
  color: var(--hk-grey);
  margin-bottom: 24px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.hk-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.hk-btn-primary {
  background: var(--hk-green);
  color: var(--hk-white);
}

.hk-btn-primary:hover { background: var(--hk-green-dark); }

.hk-btn-secondary {
  background: var(--hk-orange);
  color: var(--hk-white);
}

.hk-btn-secondary:hover { background: #F57C00; }

.hk-btn-outline {
  background: transparent;
  color: var(--hk-green);
  border: 2px solid var(--hk-green);
}

.hk-btn-outline:hover { background: var(--hk-green-light); }

.hk-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── QR Modal ───────────────────────────────────────────────────────────── */

.hk-qr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}

.hk-qr-modal-overlay.visible { opacity: 1; }

.hk-qr-modal {
  background: var(--hk-white);
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.hk-qr-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.hk-qr-modal-subtitle {
  font-size: 13px;
  color: var(--hk-grey);
  margin-bottom: 20px;
}

.hk-qr-container {
  background: var(--hk-white);
  padding: 16px;
  border-radius: 12px;
  display: inline-block;
  border: 2px solid var(--hk-green-light);
  margin-bottom: 16px;
}

.hk-qr-status {
  font-size: 14px;
  color: var(--hk-grey);
  margin-bottom: 16px;
}

.hk-qr-status.verified {
  color: var(--hk-green);
  font-weight: 600;
}

.hk-qr-status.failed {
  color: var(--hk-red);
  font-weight: 600;
}

/* ── Status badges ──────────────────────────────────────────────────────── */

.hk-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hk-badge-pending { background: #FFF3E0; color: var(--hk-orange); }
.hk-badge-verified { background: var(--hk-green-light); color: var(--hk-green-dark); }
.hk-badge-failed { background: #FFF3E0; color: var(--hk-red); }
.hk-badge-expired { background: var(--hk-light-grey); color: var(--hk-grey); }

/* ── Tabs ───────────────────────────────────────────────────────────────── */

.hk-tabs {
  display: flex;
  gap: 4px;
  background: var(--hk-light-grey);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}

.hk-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--hk-grey);
  transition: all 0.2s;
}

.hk-tab.active {
  background: var(--hk-white);
  color: var(--hk-green);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.hk-tab-content { display: none; }
.hk-tab-content.active { display: block; }

/* ── Result display ─────────────────────────────────────────────────────── */

.hk-result {
  background: var(--hk-green-light);
  border: 1px solid #C8E6C9;
  border-radius: var(--hk-radius);
  padding: 20px;
  margin-top: 16px;
}

.hk-result-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--hk-green-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hk-result-field {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #C8E6C9;
  font-size: 14px;
}

.hk-result-field:last-child { border-bottom: none; }

.hk-result-label {
  color: var(--hk-grey);
  font-weight: 500;
}

.hk-result-value {
  color: var(--hk-dark);
  font-weight: 600;
  font-family: monospace;
  font-size: 13px;
  word-break: break-all;
  max-width: 60%;
  text-align: right;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.hk-footer {
  background: var(--hk-orange);
  padding: 16px 24px;
  text-align: center;
  color: var(--hk-white);
  font-size: 12px;
  margin-top: 48px;
}

/* ── Spinner ────────────────────────────────────────────────────────────── */

.hk-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--hk-green-light);
  border-top-color: var(--hk-green);
  border-radius: 50%;
  animation: hk-spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes hk-spin {
  to { transform: rotate(360deg); }
}

/* ── Collapsible details / code blocks ──────────────────────────────────── */

.hk-details {
  background: var(--hk-light-grey);
  border-radius: 10px;
  border-left: 3px solid var(--hk-green);
  overflow: hidden;
}

.hk-details-summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 13px;
  color: var(--hk-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  border-left: 3px solid transparent;
  margin-left: -3px;
}

.hk-details-summary::-webkit-details-marker { display: none; }
.hk-details-summary::marker { display: none; }

.hk-details-summary:hover { background: rgba(0,0,0,0.03); }

.hk-details-icon {
  display: inline-block;
  transition: transform 0.15s ease;
  font-size: 11px;
  color: var(--hk-grey);
}

.hk-details[open] .hk-details-icon { transform: rotate(90deg); }

.hk-details-body {
  padding: 0 16px 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--hk-dark);
}

.hk-code {
  background: #1E1E1E;
  color: #E0E0E0;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: 'SF Mono', Monaco, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  overflow-x: auto;
  margin: 0;
  white-space: pre;
}

.hk-code code { font-family: inherit; color: inherit; background: none; }

/* ── Utilities ──────────────────────────────────────────────────────────── */

.hk-text-center { text-align: center; }
.hk-mt-16 { margin-top: 16px; }
.hk-mt-24 { margin-top: 24px; }
.hk-mb-16 { margin-bottom: 16px; }
.hk-hidden { display: none !important; }
