/* ================================================================
   PayStubCheck — Advanced Stub Generator Styles
   Standalone styles for /advanced-paystub-generator/
   ================================================================ */

.advanced-page {
  background: linear-gradient(180deg, #f8fbf2 0%, #ffffff 42%);
  min-height: 100vh;
  padding-top: 88px;
}

.advanced-hero {
  max-width: 1160px;
  margin: 0 auto 26px;
  padding: 34px 18px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: end;
}
.advanced-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #ecf8dc;
  border: 1px solid #d9ecbd;
  color: #3d6202;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.advanced-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(34px, 5vw, 58px);
  line-height: .96;
  letter-spacing: -0.05em;
  margin: 16px 0 12px;
  color: var(--text, #18200e);
}
.advanced-subtitle {
  max-width: 680px;
  color: var(--text-2, #4d5b42);
  font-size: 16px;
  line-height: 1.62;
  margin: 0;
}
.advanced-price-card {
  background: #fff;
  border: 1.5px solid #e5eed6;
  border-radius: 18px;
  padding: 20px 24px;
  min-width: 190px;
  box-shadow: 0 20px 50px rgba(44, 61, 20, .08);
}
.advanced-price-card strong {
  display: block;
  font-size: 36px;
  line-height: 1;
  color: #18200e;
  letter-spacing: -0.04em;
}
.advanced-price-card span {
  display: block;
  margin-top: 6px;
  color: #6c7a5f;
  font-size: 13px;
  font-weight: 700;
}

.advanced-shell {
  max-width: 1160px;
  margin: 0 auto 70px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 22px;
  align-items: start;
}

.advanced-panel,
.advanced-preview-panel {
  background: #fff;
  border: 1.5px solid #e5eed6;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(44, 61, 20, .07);
}
.advanced-panel { overflow: hidden; }
.advanced-form-header {
  padding: 22px 24px;
  border-bottom: 1px solid #eef3e5;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.advanced-form-header h2,
.advanced-preview-panel h2 {
  margin: 0;
  color: #18200e;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 23px;
  letter-spacing: -0.025em;
}
.advanced-form-header p,
.advanced-preview-panel p {
  margin: 4px 0 0;
  color: #6c7a5f;
  font-size: 13px;
  line-height: 1.45;
}

.advanced-form { padding: 24px; }
.form-block {
  border: 1px solid #eef3e5;
  background: #fbfdf7;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
}
.form-block h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 900;
  color: #18200e;
  letter-spacing: -0.01em;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  color: #34402a;
  font-size: 12px;
  font-weight: 800;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1.5px solid #dfe8d2;
  border-radius: 10px;
  background: #fff;
  color: #18200e;
  padding: 12px 12px;
  font: 500 14px 'DM Sans', Arial, sans-serif;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.form-field textarea { min-height: 84px; resize: vertical; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #79c006;
  box-shadow: 0 0 0 4px rgba(121, 192, 6, .12);
}
.field-hint { font-size: 11px; line-height: 1.4; color: #7a8670; }
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.template-choice {
  position: relative;
  border: 1.5px solid #dfe8d2;
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}
.template-choice input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.template-choice img {
  width: 100%;
  aspect-ratio: 8.5 / 11;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #eef3e5;
}
.template-choice strong { display: block; margin-top: 8px; font-size: 12px; color: #18200e; }
.template-choice:has(input:checked) {
  border-color: #79c006;
  box-shadow: 0 0 0 4px rgba(121, 192, 6, .12);
}

.advanced-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #eef3e5;
}
.advanced-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: #34402a;
  font-size: 13px;
  font-weight: 800;
}
.btn-advanced-checkout {
  appearance: none;
  border: 0;
  border-radius: 12px;
  background: #ff8a00;
  color: #fff;
  padding: 14px 22px;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  box-shadow: 0 12px 28px rgba(255, 138, 0, .22);
}
.btn-advanced-checkout:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.advanced-error {
  display: none;
  width: 100%;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff1f1;
  color: #b42318;
  border: 1px solid #ffcccc;
  font-size: 13px;
  font-weight: 700;
}

.advanced-preview-panel {
  position: sticky;
  top: 88px;
  padding: 18px;
}
.advanced-preview-panel header {
  margin-bottom: 14px;
}
.preview-stage {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 210px);
  overflow: auto;
  background: #f1f5e9;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid #e5eed6;
}
.preview-page {
  position: relative;
  width: 100%;
  aspect-ratio: 1103 / 1426;
  background: #fff;
  box-shadow: 0 10px 30px rgba(24, 32, 14, .12);
}
.preview-page img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.preview-text {
  position: absolute;
  font-family: Arial, Helvetica, sans-serif;
  color: #111;
  white-space: nowrap;
  line-height: 1.08;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.preview-text.bold { font-weight: 700; }
.preview-text.right { text-align: right; }
.preview-text.center { text-align: center; }
.preview-text.multiline { white-space: pre-line; line-height: 1.2; }

@media (max-width: 980px) {
  .advanced-hero,
  .advanced-shell { grid-template-columns: 1fr; }
  .advanced-price-card { max-width: 220px; }
  .advanced-preview-panel { position: static; }
}
@media (max-width: 680px) {
  .form-grid,
  .form-grid.three,
  .template-grid { grid-template-columns: 1fr; }
  .advanced-form-header { align-items: flex-start; flex-direction: column; }
}

/* Advanced engine QA fixes */
.generated-amount {
  width: 100%;
  border: 1.5px solid #dfe8d2;
  border-radius: 10px;
  background: #f7faf1;
  color: #18200e;
  padding: 12px 12px;
  font: 700 13px 'DM Sans', Arial, sans-serif;
  line-height: 1.35;
  min-height: 45px;
}
.preview-stage {
  max-height: none;
  overflow: visible;
  padding: 10px;
}
.preview-page {
  width: min(100%, 390px);
  margin: 0 auto;
}
.preview-text {
  display: block;
  max-height: 3.8em;
  overflow: hidden;
  letter-spacing: -0.01em;
}
.preview-text.multiline {
  word-break: normal;
  overflow-wrap: anywhere;
  max-height: 4.8em;
}
.advanced-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.advanced-preview-modal.is-open { display: flex; }
.advanced-preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 12, .62);
  backdrop-filter: blur(3px);
}
.advanced-preview-modal__dialog {
  position: relative;
  width: min(760px, 94vw);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  padding: 18px;
}
.advanced-preview-modal__dialog h2 {
  margin: 0 0 12px;
  font-family: 'Bricolage Grotesque', sans-serif;
  color: #18200e;
}
.advanced-preview-modal__dialog img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid #e5eed6;
}
.advanced-preview-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #18200e;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.template-choice::after {
  content: 'Click to preview';
  position: absolute;
  left: 10px;
  top: 10px;
  background: rgba(24, 32, 14, .82);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 5px 8px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}
.template-choice:hover::after,
.template-choice:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}

/* v4 preview and site-layout alignment fixes */
.advanced-page { padding-top: 72px; }
.advanced-preview-wrapper { border-radius: 16px; overflow: hidden; }
.advanced-preview-panel { padding: 0; overflow: hidden; }
.advanced-preview-panel > header { padding: 18px 18px 0; }
.advanced-preview-body {
  position: relative;
  background: #fff;
  min-height: 520px;
  cursor: zoom-in;
}
.preview-stage {
  background: #f4f8ee;
  border-radius: 0;
  border: 0;
  padding: 12px;
}
.preview-page {
  width: min(100%, 390px);
  cursor: zoom-in;
}
.preview-text {
  font-family: Arial, Helvetica, sans-serif;
  color: #111;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: none;
}
.preview-text.bold { font-weight: 700; }
.preview-text.center { text-align: center; }
.preview-text.right { text-align: right; }
.preview-text.multiline { white-space: pre-line; overflow-wrap: normal; word-break: normal; }
.advanced-modal-live {
  width: 100%;
  min-height: 1050px;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 18px 0 260px;
}
.advanced-modal-live .preview-page {
  flex: 0 0 390px;
  width: 390px !important;
  transform: scale(1.75);
  transform-origin: top center;
  cursor: default;
}
.advanced-preview-modal__dialog {
  width: min(920px, 96vw);
}
.advanced-preview-modal__dialog img {
  max-height: 84vh;
  object-fit: contain;
}
@media (max-width: 980px) {
  .advanced-preview-body { min-height: auto; }
  .advanced-modal-live .preview-page { transform: scale(1.35); }
}

/* v5: template cards select only; checkout panel matches global generator layout */
.template-choice::after { content: none !important; display: none !important; }
.template-choice { cursor: pointer; }
.template-choice input { cursor: pointer; }
.advanced-checkout-panel { margin: 18px; }
.advanced-checkout-panel .checkout-panel-title { color: #18200e; }
.advanced-preview-panel .checkout-panel { box-shadow: none; }
.advanced-error { margin-top: 12px; }
