/* =========================================================
   TrueSignal — QuickBooks Connector  |  Global Styles
   ========================================================= */

/* ----- Reset & Base ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f0f4f8;
  color: #1a202c;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #3b82f6; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----- Header ----- */
.site-header {
  background: #000;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}

.header-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: #fff;
}

.logo:hover { text-decoration: none; }

.logo-mark-box {
  width: 25px;
  height: 25px;
  border-radius: 6px;
  background: #2E7D56;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.header-tagline {
  font-size: .8rem;
  color: #94a3b8;
}

/* ----- Main layout ----- */
.main-content {
  flex: 1;
  padding: 2.5rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ----- Flash messages ----- */
.alert {
  padding: .85rem 1.2rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: .9rem;
  font-weight: 500;
}

.alert-error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

/* ----- Index page: single-column centred layout ----- */
.card-wrapper {
  max-width: 520px;
  margin: 0 auto;
}

/* ----- Card ----- */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
  overflow: hidden;
}

.card-header {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
}

.qb-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
}

.qb-icon svg { width: 100%; height: 100%; }

.card-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: .5rem;
}

.card-subtitle {
  font-size: .875rem;
  color: #64748b;
  line-height: 1.55;
  max-width: 400px;
  margin: 0 auto;
}

/* ----- Form ----- */
.qb-form {
  padding: 1.75rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.form-group { display: flex; flex-direction: column; gap: .4rem; }

.form-label {
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: .9rem;
  color: #111827;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  background: #f9fafb;
}

.form-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
  background: #fff;
}

.form-hint {
  font-size: .78rem;
  color: #6b7280;
}

/* ----- Password toggle ----- */
.input-with-toggle {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-toggle .form-input { padding-right: 2.75rem; }

.toggle-visibility {
  position: absolute;
  right: .75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 0;
  display: flex;
  align-items: center;
}

.toggle-visibility:hover { color: #374151; }
.toggle-visibility svg { width: 18px; height: 18px; }

/* ----- Radio group ----- */
.radio-group { display: flex; gap: 1rem; }

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  cursor: pointer;
  flex: 1;
  padding: .75rem 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  transition: border-color .15s, background .15s;
}

.radio-option:has(input:checked) {
  border-color: #3b82f6;
  background: #eff6ff;
}

.radio-option input[type="radio"] { display: none; }

.radio-custom {
  width: 16px;
  height: 16px;
  border: 2px solid #9ca3af;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radio-option:has(input:checked) .radio-custom {
  border-color: #3b82f6;
  background: #3b82f6;
  box-shadow: inset 0 0 0 3px #fff;
}

.radio-label { display: flex; flex-direction: column; gap: .15rem; }
.radio-label strong { font-size: .875rem; color: #1f2937; }
.radio-label small  { font-size: .775rem; color: #6b7280; }

/* ----- Info notice ----- */
.redirect-notice {
  display: flex;
  gap: .6rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: .85rem 1rem;
  color: #0369a1;
  font-size: .82rem;
  line-height: 1.5;
}

.redirect-notice svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ----- Primary button ----- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .8rem 1.5rem;
  background: #2563eb;
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s;
}

.btn-primary:hover { background: #1d4ed8; text-decoration: none; }
.btn-primary:active { transform: scale(.98); }
.btn-primary svg { width: 16px; height: 16px; }

/* ----- Info panel (right column) ----- */
.info-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
  padding: 1.5rem;
}

.info-panel h3 {
  font-size: .9rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.info-panel ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.info-panel li {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .83rem;
  color: #4b5563;
  line-height: 1.4;
}

.badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  width: fit-content;
}

.badge.green { background: #d1fae5; color: #065f46; }

.info-note {
  margin-top: 1.25rem;
  font-size: .78rem;
  color: #6b7280;
  line-height: 1.5;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.info-note code {
  background: #f1f5f9;
  padding: .1em .35em;
  border-radius: 4px;
  font-size: .85em;
  color: #334155;
}

/* ----- Success / Error pages ----- */
.result-wrapper {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.result-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 560px;
  width: 100%;
}

.result-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
}

.result-icon svg { width: 100%; height: 100%; }

.result-card h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: .6rem;
  color: #0f172a;
}

.result-subtitle {
  font-size: .95rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* ----- Stats grid (success page) ----- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
}

.stat-label {
  font-size: .72rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.result-actions { margin-top: .5rem; }
.result-actions .btn-primary { width: auto; padding: .75rem 2rem; }

/* Next steps block on success page */
.next-steps {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.next-steps p {
  font-size: .9rem;
  color: #0369a1;
  line-height: 1.6;
  margin: 0;
}

/* Customer ID banner on index page */
.customer-id-banner {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: .65rem 1rem;
  font-size: .875rem;
  color: #374151;
}

.customer-id-banner svg {
  width: 18px;
  height: 18px;
  color: #64748b;
  flex-shrink: 0;
}

.customer-id-banner strong {
  color: #1e293b;
  font-weight: 700;
}

/* ----- Footer ----- */
.site-footer {
  background: #000;
  padding: 1rem 2rem;
  text-align: center;
  font-size: .78rem;
  color: #64748b;
}

