/* =============================================
   HELPER-ID — Shared Stylesheet
   All views: index, generator, reader, writer
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Serif+Display&display=swap');

:root {
  /* --- Brand colors --- */
  --red: #D0312D;
  --red-dark: #A82320;
  --red-light: #FDECEA;
  --red-border: #FCA5A5;

  /* --- Neutral palette --- */
  --black: #1A1A1A;
  --gray-dark: #444444;
  --gray-mid: #888888;
  --gray-muted: #999999;   /* muted chrome / footer text */
  --gray-faint: #CCCCCC;   /* placeholder text, fine print on dark */
  --gray-hover: #E8E8E8;   /* secondary interactive hover */
  --gray-light: #F4F4F4;
  --white: #FFFFFF;
  --border: #E0E0E0;

  /* --- Semantic / alert colors --- */
  --color-info: #3730A3;
  --color-info-bg: #EEF2FF;
  --color-info-border: #C7D2FE;

  --color-success: #166534;
  --color-success-bg: #F0FDF4;
  --color-success-border: #BBF7D0;

  --color-warning: #92400E;
  --color-warning-bg: #FFFBEB;
  --color-warning-border: #FDE68A;

  /* --- Spacing scale (4px base) --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;

  /* --- Typography scale (16px html base) --- */
  --text-2xs: 0.6875rem;  /* 11px — wallet fine print */
  --text-xs:  0.75rem;    /* 12px — badges, section labels */
  --text-sm:  0.875rem;   /* 14px — hints, metadata, nav */
  --text-base: 1.125rem;  /* 18px — body copy, inputs (accessible) */
  --text-md:  1.25rem;    /* 20px — subheadings, large buttons */
  --text-lg:  1.5rem;     /* 24px — card headings */
  --text-xl:  1.875rem;   /* 30px — page subtitles */
  --text-2xl: 2.25rem;    /* 36px — page titles (h1) */
  --text-display: 3rem;   /* 48px — hero / marketing headline */

  /* --- Line heights --- */
  --leading-tight: 1.1;
  --leading-snug: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;

  /* --- Effects --- */
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);

  /* --- Type faces --- */
  --font-body: 'DM Sans', sans-serif;
  --font-display: 'DM Serif Display', serif;

  /* --- Layout --- */
  --max-width: 860px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
.hid-header {
  background: var(--white);
  border-bottom: 2px solid var(--border);
  padding: 0 var(--space-6);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.hid-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.hid-logo-mark {
  width: 36px;
  height: 36px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.hid-logo-text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--black);
  letter-spacing: -0.3px;
}

.hid-logo-text span {
  color: var(--red);
}

.hid-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hid-nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-dark);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.hid-nav a:hover {
  background: var(--gray-light);
  color: var(--black);
}

.hid-nav a.active {
  color: var(--red);
  background: var(--red-light);
}

/* ---- Footer ---- */
.hid-footer {
  margin-top: auto;
  background: var(--black);
  color: var(--gray-muted);
  padding: var(--space-7) var(--space-6);
  text-align: center;
  font-size: var(--text-xs);
}

.hid-footer a {
  color: var(--gray-faint);
  text-decoration: none;
}

.hid-footer a:hover { color: var(--white); }

.hid-footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.hid-footer-logo .hid-logo-mark {
  width: 28px;
  height: 28px;
  font-size: var(--text-2xs);
}

.hid-footer-logo span {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--white);
}

/* ---- Main container ---- */
.hid-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-10) var(--space-6);
}

.hid-main.wide {
  max-width: 1100px;
}

/* ---- Page title ---- */
.hid-page-title {
  margin-bottom: var(--space-8);
}

.hid-page-title h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--black);
  line-height: 1.2;
  margin-bottom: var(--space-2);
}

.hid-page-title p {
  font-size: var(--text-base);
  color: var(--gray-dark);
  max-width: 560px;
}

/* ---- Cards ---- */
.hid-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-6);
}

.hid-card-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: var(--space-4);
}

/* ---- Forms ---- */
.hid-form-group {
  margin-bottom: var(--space-5);
}

.hid-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--black);
  margin-bottom: 6px;
}

.hid-label .hid-hint {
  font-weight: 400;
  color: var(--gray-mid);
  font-size: var(--text-xs);
}

.hid-input,
.hid-select,
.hid-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--black);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.hid-input:focus,
.hid-select:focus,
.hid-textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(208, 49, 45, 0.12);
}

.hid-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.hid-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* ---- Buttons ---- */
.hid-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 13px 24px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
  line-height: 1;
}

.hid-btn:active { transform: scale(0.98); }

.hid-btn-primary {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(208,49,45,0.25);
}

.hid-btn-primary:hover {
  background: var(--red-dark);
  box-shadow: 0 4px 14px rgba(208,49,45,0.35);
}

.hid-btn-secondary {
  background: var(--gray-light);
  color: var(--black);
}

.hid-btn-secondary:hover { background: var(--gray-hover); }

.hid-btn-outline {
  background: transparent;
  color: var(--red);
  border: 1.5px solid var(--red);
}

.hid-btn-outline:hover {
  background: var(--red-light);
}

.hid-btn-full { width: 100%; }

.hid-btn-lg {
  font-size: var(--text-md);
  padding: var(--space-4) var(--space-8);
  border-radius: 12px;
}

/* ---- Badges / Tags ---- */
.hid-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}

.hid-badge-red { background: var(--red-light); color: var(--red); }
.hid-badge-black { background: var(--black); color: var(--white); }
.hid-badge-gray { background: var(--gray-light); color: var(--gray-dark); }

/* ---- Divider ---- */
.hid-divider {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: var(--space-6) 0;
}

/* ---- Alert / info boxes ---- */
.hid-alert {
  display: flex;
  gap: var(--space-3);
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}

.hid-alert-info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--color-info-border);
}

.hid-alert-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.hid-alert-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.hid-alert-error {
  background: var(--red-light);
  color: var(--red-dark);
  border: 1px solid var(--red-border);
}

/* ---- Section headers ---- */
.hid-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}

/* ---- Profile display (reader view) ---- */
.hid-profile-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--black);
  line-height: 1.1;
}

.hid-profile-section {
  margin-bottom: var(--space-6);
}

.hid-contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.hid-contact-item:last-child { border-bottom: none; }

.hid-contact-icon {
  width: 36px;
  height: 36px;
  background: var(--red-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--red);
  font-size: var(--text-base);
}

.hid-contact-info { flex: 1; }
.hid-contact-name { font-weight: 600; font-size: var(--text-base); }
.hid-contact-rel { font-size: var(--text-sm); color: var(--gray-mid); }
.hid-contact-phone { font-size: var(--text-base); color: var(--gray-dark); margin-top: 2px; }

/* ---- URL output box ---- */
.hid-url-box {
  background: var(--gray-light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: monospace;
  font-size: var(--text-xs);
  color: var(--gray-dark);
  word-break: break-all;
  line-height: 1.5;
}

/* ---- Step indicator ---- */
.hid-steps {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-8);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--border);
}

.hid-step {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gray-mid);
  background: var(--gray-light);
  border-right: 1.5px solid var(--border);
  position: relative;
}

.hid-step:last-child { border-right: none; }

.hid-step.active {
  background: var(--red);
  color: var(--white);
}

.hid-step.complete {
  background: var(--black);
  color: var(--white);
}

.hid-step-num {
  display: block;
  font-size: var(--text-md);
  font-weight: 700;
  margin-bottom: 2px;
}

/* ---- Input row: full-width (single column) modifier ---- */
.hid-input-row.full { grid-template-columns: 1fr; }

/* ---- Button: danger variant ---- */
.hid-btn-danger {
  background: transparent;
  color: var(--red);
  border: 1.5px solid var(--red);
}
.hid-btn-danger:hover { background: var(--red); color: var(--white); }

/* ---- Button: disabled state ---- */
.hid-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.hid-btn-primary:disabled { background: var(--gray-mid); opacity: 1; }

/* ---- Form: field-level error state ---- */
.hid-input.hid-field-error,
.hid-select.hid-field-error,
.hid-textarea.hid-field-error {
  border-color: var(--red);
  background: var(--red-light);
}
.hid-field-error-msg {
  color: var(--red);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}

/* ---- Credential card (setup / dashboard) ---- */
.hid-credential-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-6);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow);
}
.hid-credential-row { margin-bottom: var(--space-5); }
.hid-credential-row:last-child { margin-bottom: 0; }
.hid-credential-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.hid-credential-value {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--black);
}

/* ---- Progress bar (dot/pip style for multi-step flows) ---- */
.hid-progress-bar {
  display: flex;
  gap: 6px;
  margin-bottom: var(--space-8);
}
.hid-progress-step {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.3s;
}
.hid-progress-step.active { background: var(--red); }
.hid-progress-step.done   { background: var(--black); }

/* ---- Section heading (display font sub-header with underline) ---- */
.hid-section-heading {
  font-family: var(--font-display);
  font-size: var(--text-md);
  color: var(--black);
  margin: var(--space-6) 0 14px;
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--border);
}

/* ---- Contact block (grouped contact fields) ---- */
.hid-contact-block {
  background: var(--gray-light);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: var(--space-3);
}
.hid-contact-block-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-mid);
  margin-bottom: 10px;
}

/* ---- Info card (compact, reader view) ---- */
.hid-info-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.hid-info-card-title {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-bottom: var(--space-2);
}

/* ---- Profile section label (compact, muted — reader view) ---- */
.hid-profile-section-label {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-bottom: var(--space-2);
}

/* ---- Profile divider (inset, reader view) ---- */
.hid-profile-divider {
  height: 1px;
  background: var(--border);
  margin: 0 var(--space-4);
}

/* ---- Wallet card ---- */
.hid-wallet-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: var(--space-5) 22px;
  background: var(--white);
  max-width: 320px;
}
.hid-wc-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.hid-wc-logo-mark {
  background: var(--red);
  color: var(--white);
  font-size: var(--text-2xs);
  font-weight: 900;
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.hid-wc-logo-text { font-size: var(--text-sm); font-weight: 700; color: var(--black); flex: 1; }
.hid-wc-url { font-size: var(--text-2xs); color: var(--gray-mid); }
.hid-wc-cred { margin-bottom: var(--space-3); }
.hid-wc-cred:last-of-type { margin-bottom: 0; }
.hid-wc-cred-label {
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 2px;
}
.hid-wc-cred-value {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--black);
}
.hid-wc-footer {
  margin-top: var(--space-3);
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: var(--text-2xs);
  color: var(--gray-mid);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .hid-header { padding: 0 var(--space-4); }

  .hid-nav a {
    font-size: var(--text-xs);
    padding: 5px 8px;
  }

  .hid-main { padding: var(--space-6) var(--space-4); }

  .hid-card { padding: var(--space-5) var(--space-4); }

  .hid-input-row { grid-template-columns: 1fr; }

  .hid-page-title h1 { font-size: 1.6rem; }

  .hid-btn-lg { font-size: var(--text-base); padding: 14px 24px; }

  .hid-steps { flex-direction: column; }
  .hid-step { border-right: none; border-bottom: 1.5px solid var(--border); }
  .hid-step:last-child { border-bottom: none; }
}
