/* =============================================================================
   OPERATING AGREEMENT BUILDER — Multi-tier, multi-class, multi-state
   Donovan Legal PLLC — Reserve members
   ============================================================================= */

* { box-sizing: border-box; }
body { font-family: 'Open Sans', sans-serif; background: #F5F5F0; margin: 0; color: #1a1a1a; }

/* ===== ACCESS GATE ===== */
.access-gate { position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #0a5a37 0%, #107a4d 100%); z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 1rem; }
.access-gate-card { background: #FFFFFF; max-width: 480px; width: 100%;
  padding: 3rem 2.5rem; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.access-gate-logo { font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.85rem;
  letter-spacing: 6px; text-align: center; color: #1a1a1a; margin-bottom: 1.5rem; }
.access-gate-card h2 { font-family: 'Gotham Bold', 'Open Sans', sans-serif; text-align: center;
  font-size: 1.4rem; margin-bottom: 1rem; color: #1a1a1a; }
.access-gate-card p { font-size: 0.95rem; line-height: 1.6; color: #4a4a4a; margin-bottom: 1.25rem; }
.access-gate-card input { width: 100%; padding: 0.85rem 1rem; border: 2px solid #d4d4d0;
  font-size: 1rem; font-family: 'Open Sans', sans-serif; letter-spacing: 2px; text-align: center;
  text-transform: uppercase; margin-bottom: 1rem; }
.access-gate-card input:focus { outline: none; border-color: #169B62; }
.access-gate-card button { width: 100%; padding: 0.9rem; background: #169B62; color: #FFFFFF;
  border: none; font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.9rem;
  letter-spacing: 2px; text-transform: uppercase; cursor: pointer; transition: background 0.15s ease; }
.access-gate-card button:hover { background: #107a4d; }
.access-error { margin-top: 1rem; padding: 0.65rem 0.85rem;
  background: rgba(176, 31, 36, 0.08); border-left: 3px solid #B01F24;
  color: #B01F24; font-size: 0.85rem; }
.access-fineprint { margin-top: 1.5rem; font-size: 0.78rem !important; color: #6b6b6b !important;
  line-height: 1.55 !important; text-align: center; }

/* ===== TOOL HEADER ===== */
.tool-header { background: #1a1a1a; color: #F5F5F0; padding: 0.85rem 0; border-bottom: 3px solid #169B62; }
.tool-header-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; justify-content: space-between; align-items: center; }
.tool-header-brand { font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.8rem; letter-spacing: 4px; }
.tool-header-back { color: #F5F5F0; text-decoration: none; font-size: 0.82rem;
  letter-spacing: 1.5px; text-transform: uppercase; }
.tool-header-back:hover { color: #169B62; text-decoration: none; }

/* ===== TOOL CONTAINER ===== */
.tool-container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.tool-title-bar { margin-bottom: 2rem; }
.tool-title-eyebrow { font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.78rem;
  letter-spacing: 4px; color: #169B62; text-transform: uppercase; margin-bottom: 0.5rem; }
.tool-title { font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 1.85rem;
  color: #1a1a1a; line-height: 1.25; margin-bottom: 0.85rem; }
.tool-subtitle { font-size: 0.95rem; line-height: 1.65; color: #4a4a4a; max-width: 820px; }
.tool-intro-banner { background: #FFFFFF; border-left: 3px solid #C9A961;
  padding: 0.95rem 1.25rem; margin-bottom: 1.75rem; font-size: 0.85rem; line-height: 1.6; color: #4a4a4a; }
.tool-intro-banner strong { color: #1a1a1a; }

/* ===== WIZARD PROGRESS ===== */
.oa-progress { display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 2.5rem; padding: 0; list-style: none; gap: 0.25rem; flex-wrap: wrap; }
.oa-progress-step { flex: 1; min-width: 80px; text-align: center; position: relative;
  padding: 0.5rem 0.15rem; cursor: pointer; opacity: 0.55; transition: opacity 0.15s ease; }
.oa-progress-step.oa-active, .oa-progress-step.oa-complete { opacity: 1; }
.oa-progress-step span { display: inline-block; width: 26px; height: 26px; line-height: 26px;
  border-radius: 50%; background: #d4d4d0; color: #FFFFFF;
  font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.78rem; margin-bottom: 0.4rem; }
.oa-progress-step.oa-active span { background: #169B62; }
.oa-progress-step.oa-complete span { background: #107a4d; }
.oa-progress-step label { display: block; font-size: 0.7rem; color: #4a4a4a;
  letter-spacing: 0.5px; line-height: 1.3; cursor: pointer; }
.oa-progress-step.oa-active label { color: #169B62; font-weight: 700; }

/* ===== WIZARD STEPS ===== */
.oa-step { display: none; background: #FFFFFF; padding: 2rem 2.25rem;
  border-top: 3px solid #169B62; margin-bottom: 1.5rem; }
.oa-step.oa-step-active { display: block; }
.oa-step h2 { font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 1.3rem;
  color: #1a1a1a; margin-top: 0; margin-bottom: 0.5rem; }
.oa-step-subtitle { font-size: 0.9rem; color: #4a4a4a; line-height: 1.6; margin-bottom: 1.5rem; }

/* ===== FORM FIELDS ===== */
.oa-field { margin-bottom: 1.25rem; }
.oa-field label { display: block; font-family: 'Gotham Bold', 'Open Sans', sans-serif;
  font-size: 0.85rem; color: #1a1a1a; margin-bottom: 0.45rem; letter-spacing: 0.5px; }
.oa-field input[type="text"], .oa-field input[type="number"], .oa-field input[type="date"],
.oa-field select, .oa-field textarea {
  width: 100%; padding: 0.65rem 0.85rem; border: 1px solid #d4d4d0; background: #FFFFFF;
  font-family: 'Open Sans', sans-serif; font-size: 0.95rem; color: #1a1a1a; }
.oa-field input:focus, .oa-field select:focus, .oa-field textarea:focus {
  outline: none; border-color: #169B62; }
.oa-field textarea { resize: vertical; min-height: 70px; }
.oa-help { font-size: 0.82rem; color: #6b6b6b; line-height: 1.55; margin-top: 0.4rem; }
.oa-required { color: #B01F24; }
.oa-field-checkbox { margin-bottom: 1.1rem; padding: 0.85rem 1rem;
  background: #F5F5F0; border-left: 3px solid #C9A961; }
.oa-field-checkbox input[type="checkbox"] { margin-right: 0.6rem; }
.oa-field-checkbox label { display: inline; font-family: 'Open Sans', sans-serif; font-weight: 600; font-size: 0.92rem; }
.oa-field-checkbox p { margin: 0.45rem 0 0 1.5rem; font-size: 0.82rem; color: #4a4a4a; line-height: 1.55; }

.oa-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
.oa-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem 1.25rem; }
@media (max-width: 720px) { .oa-grid-2, .oa-grid-3 { grid-template-columns: 1fr; } }

/* ===== NAV BUTTONS ===== */
.oa-nav { display: flex; justify-content: space-between; align-items: center;
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #e6e6e0; }
.btn-oa-back, .btn-oa-next, .btn-oa-add, .btn-oa-remove, .btn-primary-green {
  padding: 0.7rem 1.4rem; font-family: 'Gotham Bold', 'Open Sans', sans-serif;
  font-size: 0.82rem; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer;
  border: none; transition: all 0.15s ease; }
.btn-oa-back { background: transparent; color: #4a4a4a; border: 1px solid #d4d4d0; }
.btn-oa-back:hover { color: #1a1a1a; border-color: #1a1a1a; }
.btn-oa-next, .btn-primary-green { background: #169B62; color: #FFFFFF; }
.btn-oa-next:hover, .btn-primary-green:hover { background: #107a4d; }
.btn-oa-add { background: #FFFFFF; color: #169B62; border: 1.5px dashed #169B62; padding: 0.55rem 1.1rem; font-size: 0.78rem; }
.btn-oa-add:hover { background: rgba(22,155,98,0.06); }
.btn-oa-remove { background: transparent; color: #B01F24; border: 1px solid #B01F24;
  padding: 0.35rem 0.7rem; font-size: 0.72rem; }
.btn-oa-remove:hover { background: rgba(176,31,36,0.06); }

/* ===== ENTITY STACK CARDS ===== */
.entity-stack { margin-bottom: 1.5rem; }
.entity-card { background: #FFFFFF; border: 1px solid #d4d4d0; padding: 1.25rem 1.4rem;
  margin-bottom: 1.1rem; position: relative; }
.entity-card.role-topco   { border-left: 4px solid #C9A961; }
.entity-card.role-midco   { border-left: 4px solid #d4a017; }
.entity-card.role-opco    { border-left: 4px solid #169B62; }
.entity-card.role-spe     { border-left: 4px solid #4a4a4a; }
.entity-card-header { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; padding-bottom: 0.6rem; border-bottom: 1px solid #e6e6e0; }
.entity-card-title { font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.95rem;
  color: #1a1a1a; letter-spacing: 0.5px; }
.entity-card-eyebrow { font-size: 0.7rem; color: #6b6b6b; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 0.25rem; }
.entity-card-tier-badge { display: inline-block; padding: 0.18rem 0.6rem; background: #1a1a1a;
  color: #F5F5F0; font-size: 0.65rem; letter-spacing: 2px; text-transform: uppercase;
  font-family: 'Gotham Bold', 'Open Sans', sans-serif; margin-right: 0.5rem; }
.entity-card-tier-badge.role-topco { background: #C9A961; }
.entity-card-tier-badge.role-midco { background: #d4a017; }
.entity-card-tier-badge.role-opco { background: #169B62; }
.entity-card-tier-badge.role-spe { background: #4a4a4a; }

/* ===== MEMBER CARDS, CLASS CARDS, TIER CARDS (waterfall) ===== */
.sub-card-list { margin-top: 0.75rem; }
.sub-card { background: #f9f9f5; padding: 0.9rem 1.1rem; margin-bottom: 0.7rem;
  border-left: 3px solid #169B62; position: relative; }
.sub-card-header { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.55rem; }
.sub-card-title { font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.82rem;
  color: #1a1a1a; letter-spacing: 0.5px; }
.sub-card .oa-field { margin-bottom: 0.65rem; }
.sub-card .oa-field label { font-size: 0.78rem; }
.sub-card.class-preferred { border-left-color: #C9A961; }
.sub-card.class-common { border-left-color: #169B62; }
.sub-card.class-profits { border-left-color: #d4a017; }

/* Waterfall tier visualization */
.waterfall-tier { background: #FFFFFF; border: 1px solid #d4d4d0; padding: 0.95rem 1.15rem;
  margin-bottom: 0.65rem; border-left: 4px solid #169B62; }
.waterfall-tier-header { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.55rem; }
.waterfall-tier-num { display: inline-block; width: 22px; height: 22px; line-height: 22px;
  background: #169B62; color: #FFFFFF; border-radius: 50%; text-align: center;
  font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.72rem; margin-right: 0.55rem; }
.waterfall-tier-label { font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.85rem; color: #1a1a1a; }
.waterfall-presets { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.waterfall-preset-btn { padding: 0.45rem 0.85rem; background: #FFFFFF; border: 1px solid #d4d4d0;
  font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.72rem; letter-spacing: 1.2px;
  text-transform: uppercase; cursor: pointer; color: #4a4a4a; }
.waterfall-preset-btn:hover { border-color: #169B62; color: #169B62; }
.waterfall-preset-btn.active { background: #169B62; color: #FFFFFF; border-color: #169B62; }

/* ===== REVIEW SUMMARY ===== */
.oa-review-summary { background: #F5F5F0; padding: 1.25rem 1.4rem; margin-bottom: 1.5rem;
  border-left: 3px solid #C9A961; font-size: 0.9rem; line-height: 1.65; }
.oa-review-summary h3 { font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.9rem;
  letter-spacing: 1.5px; text-transform: uppercase; color: #169B62; margin: 0 0 0.65rem 0; }
.oa-review-summary dt { font-weight: 700; display: inline; }
.oa-review-summary dd { display: inline; margin: 0; color: #4a4a4a; }
.oa-review-summary dl { margin: 0; }
.oa-review-summary dl > div { margin-bottom: 0.4rem; }

.oa-action-row { display: flex; gap: 1rem; align-items: center; margin: 1.5rem 0 2rem; flex-wrap: wrap; }
.btn-primary-green-sm { padding: 0.55rem 1.1rem; background: #169B62; color: #FFFFFF;
  border: none; font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.74rem;
  letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; }
.btn-primary-green-sm:hover { background: #107a4d; }
.btn-secondary-sm { padding: 0.55rem 1.1rem; background: transparent; color: #4a4a4a;
  border: 1px solid #d4d4d0; font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.74rem;
  letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; }
.btn-secondary-sm:hover { color: #1a1a1a; border-color: #1a1a1a; }

/* ===== DOCUMENT PREVIEW ===== */
.oa-doc-nav { display: flex; flex-wrap: wrap; gap: 0.35rem; border-bottom: 2px solid #d4d4d0;
  margin: 1.25rem 0 0; padding-bottom: 0; }
.oa-doc-tab { padding: 0.65rem 1.1rem; background: transparent; border: none;
  font-family: 'Gotham Bold', 'Open Sans', sans-serif; font-size: 0.78rem; letter-spacing: 1.2px;
  text-transform: uppercase; color: #6b6b6b; cursor: pointer; border-bottom: 3px solid transparent;
  margin-bottom: -2px; }
.oa-doc-tab:hover { color: #169B62; }
.oa-doc-tab.oa-doc-tab-active { color: #169B62; border-bottom-color: #169B62; }

.oa-doc-actions { display: flex; gap: 0.75rem; align-items: center; margin: 1rem 0;
  padding: 0.75rem 1rem; background: rgba(22,155,98,0.05); flex-wrap: wrap; }
.oa-doc-actions-note { font-size: 0.78rem; color: #6b6b6b; line-height: 1.5; }
.entity-doc-selector { font-family: 'Open Sans', sans-serif; padding: 0.4rem 0.7rem;
  border: 1px solid #d4d4d0; font-size: 0.85rem; }

.oa-doc-preview { background: #FFFFFF; padding: 2.5rem 3rem; font-family: 'Times New Roman', serif;
  font-size: 0.92rem; line-height: 1.55; color: #1a1a1a; max-height: 720px; overflow-y: auto;
  border: 1px solid #d4d4d0; }
.oa-doc-preview h1 { font-family: 'Times New Roman', serif; font-size: 1.35rem;
  text-align: center; text-transform: uppercase; margin: 0 0 1.25rem 0; font-weight: bold; }
.oa-doc-preview h2 { font-family: 'Times New Roman', serif; font-size: 1.1rem; margin-top: 1.5rem; }
.oa-doc-preview h3 { font-family: 'Times New Roman', serif; font-size: 1rem; margin-top: 1.1rem; }
.oa-doc-preview .article { margin: 1.4rem 0; }
.oa-doc-preview .article-heading { font-weight: bold; text-align: center;
  text-transform: uppercase; margin-bottom: 0.85rem; }
.oa-doc-preview .section { margin-bottom: 0.85rem; text-align: justify; }
.oa-doc-preview .signature-block { margin-top: 2.5rem; }
.oa-doc-preview .signature-line { display: inline-block; width: 320px;
  border-bottom: 1px solid #1a1a1a; margin: 0.35rem 0; }
.oa-doc-preview .defined-term { font-weight: bold; }
.oa-doc-preview ol, .oa-doc-preview ul { margin: 0.45rem 0 0.85rem 1.5rem; }
.oa-doc-preview li { margin-bottom: 0.35rem; }

.draft-banner { background: #B01F24; color: #FFFFFF; padding: 0.65rem 1.1rem; text-align: center;
  font-family: 'Gotham Bold', 'Open Sans', sans-serif; letter-spacing: 1.5px; font-size: 0.78rem;
  margin: -2.5rem -3rem 1.75rem -3rem; }

.oa-final-disclaimer { background: #FFFFFF; border-left: 3px solid #B01F24; padding: 1rem 1.25rem;
  margin-top: 1.5rem; font-size: 0.82rem; line-height: 1.6; color: #4a4a4a; }
.oa-final-disclaimer strong { color: #B01F24; }

/* Validation feedback */
.oa-validation { background: rgba(176,31,36,0.06); border-left: 3px solid #B01F24;
  padding: 0.7rem 1rem; margin: 0.5rem 0; font-size: 0.85rem; color: #B01F24; }
.oa-validation ul { margin: 0.3rem 0 0 1.25rem; padding: 0; }

@media print {
  .tool-header, .oa-progress, .oa-doc-nav, .oa-doc-actions, .draft-banner,
  .oa-final-disclaimer, .access-gate { display: none !important; }
  .oa-doc-preview { max-height: none; overflow: visible; padding: 0; border: none; }
  body { background: #FFFFFF; }
}
