:root{
  --bg:#ecebe6;
  --ink:#111;
  --muted:#77736c;
  --paper:#f7f5ef;
  --line:#c7c2b9;
  --black:#111;
  --accent:#74996b;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Arial,Helvetica,sans-serif;color:var(--ink);background:radial-gradient(circle at top left,#fff 0,#efede7 38%,#e3e0d8 100%)}
button,input,select{font:inherit}
.page-shell{width:min(1500px,96vw);margin:0 auto;padding:38px 0 52px}
.page-header{display:flex;align-items:end;justify-content:space-between;gap:30px;margin-bottom:26px;padding:0 4px}
.brand-lockup{display:flex;align-items:center;gap:14px}.brand-symbol{width:44px;height:44px;object-fit:contain}.eyebrow{font-size:11px;letter-spacing:.18em;font-weight:800;color:#5f5b55}.page-header h1{font-size:clamp(42px,5vw,78px);line-height:.85;margin:4px 0 0;letter-spacing:-.06em}.page-header p{margin:0 0 6px;color:#5f5b55;font-size:14px}
.workspace{display:grid;grid-template-columns:minmax(340px,430px) minmax(0,1fr);gap:24px;align-items:start}
.controls-panel,.preview-panel{background:rgba(255,255,255,.72);border:1px solid rgba(17,17,17,.12);box-shadow:0 18px 60px rgba(23,21,17,.08);border-radius:24px;backdrop-filter:blur(10px)}
.controls-panel{padding:24px;position:sticky;top:18px}.step-block+.step-block{margin-top:24px}.step-title{font-size:12px;font-weight:900;letter-spacing:.10em;margin-bottom:13px}.step-title span{display:inline-flex;width:28px;height:28px;border-radius:50%;background:#111;color:white;align-items:center;justify-content:center;margin-right:9px;font-size:10px}
.member-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:7px}.member-choice{border:1px solid #b9b5ad;background:#f5f3ee;border-radius:11px;padding:0;overflow:hidden;cursor:pointer;transition:.18s ease;position:relative}.member-choice img{display:block;width:100%;aspect-ratio:3/4;object-fit:cover}.member-choice span{display:block;padding:7px 2px;background:#111;color:#fff;font-size:9px;font-weight:900;text-align:center;letter-spacing:.02em}.member-choice.active{outline:3px solid #111;outline-offset:2px;transform:translateY(-2px)}
.fields{display:grid;gap:11px}.fields label{display:grid;gap:6px}.fields label span{font-size:10px;font-weight:900;letter-spacing:.11em}.fields input,.fields select{width:100%;border:1px solid #c6c1b8;background:#fbfaf7;color:#111;border-radius:11px;padding:13px 14px;outline:none}.fields input:focus,.fields select:focus{border-color:#111;box-shadow:0 0 0 2px rgba(17,17,17,.08)}
.primary-btn,.secondary-btn{width:100%;border-radius:12px;padding:15px 16px;font-weight:900;letter-spacing:.05em;cursor:pointer}.primary-btn{background:#111;color:white;border:1px solid #111;margin-top:20px}.secondary-btn{background:transparent;border:1px solid #bbb5ab;color:#111;margin-top:9px}.privacy-note{font-size:10px;color:#77736c;line-height:1.45;margin:12px 3px 0;text-align:center}
.preview-panel{padding:22px}.preview-topline{display:flex;justify-content:space-between;align-items:center;margin:0 2px 12px;font-size:10px;font-weight:900;letter-spacing:.14em;color:#68645e}.card-wrap{width:100%;overflow:auto;padding:4px 0 6px}.coer-card{position:relative;width:100%;aspect-ratio:1.6/1;background:linear-gradient(135deg,#fbfaf6,#f0eee8);border:1px solid #bdb8ae;border-radius:30px;overflow:hidden;box-shadow:0 20px 44px rgba(17,17,17,.14);display:grid;grid-template-columns:34% 66%;grid-template-rows:15% 85%;isolation:isolate}.coer-card:after{content:"";position:absolute;inset:0;pointer-events:none;background-image:radial-gradient(rgba(0,0,0,.03) .8px, transparent .8px);background-size:4px 4px;mix-blend-mode:multiply;z-index:8}.card-header{grid-column:1/3;background:#111;display:flex;align-items:center;padding:0 4.2%;z-index:4}.cortis-brand{height:48%;display:flex;align-items:center;gap:10px}.cortis-brand img:first-child{height:100%;width:auto;filter:brightness(0) invert(1)}.cortis-wordmark-text{color:#fff;font-family:Arial,Helvetica,sans-serif;font-size:clamp(22px,2.6vw,42px);font-weight:900;letter-spacing:-.055em;line-height:1}
.photo-column{grid-column:1;grid-row:2;padding:6% 5.5% 4%;display:flex;flex-direction:column;justify-content:space-between;z-index:3}.photo-frame{height:80%;border:2px solid #111;position:relative;background:#eee;overflow:hidden}.photo-frame:before,.photo-frame:after{content:"";position:absolute;width:20px;height:20px;border-color:#111;z-index:2}.photo-frame:before{left:-9px;top:-9px;border-left:2px solid;border-top:2px solid}.photo-frame:after{right:-9px;bottom:-9px;border-right:2px solid;border-bottom:2px solid}.photo-frame img{width:100%;height:100%;object-fit:cover;object-position:center 18%;display:block}.id-number small{font-size:clamp(7px,.7vw,11px);letter-spacing:.13em;display:block;margin-bottom:3px}.id-number strong{display:inline-block;border:2px solid #111;border-radius:999px;padding:2px 12px;font-size:clamp(14px,1.65vw,27px)}
.info-column{grid-column:2;grid-row:2;padding:6% 13% 4% 4%;display:flex;flex-direction:column;z-index:3}.card-kicker{font-size:clamp(8px,.9vw,14px);letter-spacing:.08em;margin-bottom:3.5%}.info-row{border-bottom:1px dashed #777;padding-bottom:1.5%;margin-bottom:3.2%}.info-row small{display:block;font-size:clamp(7px,.75vw,12px);letter-spacing:.12em;margin-bottom:.6%;color:#3d3a36}.info-row strong{font-size:clamp(15px,2.05vw,33px);line-height:1;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bottom-row{margin-top:auto;display:grid;grid-template-columns:22% 1fr;gap:8%;align-items:end}.fingerprint-box{aspect-ratio:1;border:1px solid #777;display:grid;place-items:center;background:rgba(255,255,255,.25)}.fingerprint-lines{width:58%;height:70%;border-radius:50%;background:repeating-radial-gradient(ellipse at 50% 70%,transparent 0 3px,#222 3px 5px,transparent 5px 8px);opacity:.78}.signature-block{border-bottom:1px dashed #777;min-height:78px;position:relative;display:flex;align-items:end}.signature-block small{position:absolute;left:0;bottom:6px;font-size:clamp(7px,.72vw,11px);letter-spacing:.12em}.signature-block img{margin-left:25%;width:66%;height:88px;object-fit:contain;object-position:center bottom;filter:contrast(1.25)}
.watermark{position:absolute;right:12%;top:23%;width:42%;height:62%;opacity:.055;z-index:1}.watermark img{width:100%;height:100%;object-fit:contain;filter:grayscale(1) brightness(.25)}.barcode{position:absolute;right:4.5%;top:28%;width:3.2%;height:50%;object-fit:fill;z-index:3}.mobile-download-hint{font-size:10px;color:#77736c;text-align:center;margin-top:12px}
@media(max-width:1050px){.workspace{grid-template-columns:1fr}.controls-panel{position:relative;top:auto}.member-grid{max-width:620px}.preview-panel{order:-1}.coer-card{min-width:760px}.card-wrap{overflow-x:auto}}
@media(max-width:700px){.page-shell{width:min(94vw,700px);padding:22px 0 34px}.page-header{align-items:start;margin-bottom:18px}.page-header p{display:none}.page-header h1{font-size:48px}.brand-symbol{width:34px;height:34px}.workspace{gap:14px}.preview-panel,.controls-panel{border-radius:18px;padding:14px}.preview-panel{overflow:hidden}.card-wrap{margin:0 -2px;padding-bottom:8px}.coer-card{min-width:710px}.member-grid{grid-template-columns:repeat(5,minmax(64px,1fr));overflow-x:auto;padding:4px 3px 8px}.member-choice{min-width:68px}.member-choice span{font-size:8px}.controls-panel{padding:18px}.primary-btn{position:sticky;bottom:10px;box-shadow:0 12px 30px rgba(0,0,0,.18)}}

/* V3 — final positioning tweaks */
.id-number{margin-left:18px}
.barcode{right:4.5%;top:28%;width:3.2%;height:50%;object-fit:fill;}

/* V11 — approved page header + final card labels */
.brand-symbol{width:58px;height:58px}
.brand-lockup{gap:16px}
.page-header h1{margin:0}
.cortis-brasil-header-logo{width:180px;height:92px;object-fit:contain;object-position:center;mix-blend-mode:multiply}
@media(max-width:700px){
  .brand-symbol{width:44px;height:44px}
  .cortis-brasil-header-logo{width:118px;height:64px}
  .page-header{align-items:center}
}

/* V12 — proportional page branding */
.page-header{align-items:center}
.brand-symbol{width:52px;height:52px}
.brand-lockup{gap:14px}
.page-header h1{font-size:clamp(44px,4.5vw,68px);line-height:.9}
.cortis-brasil-header-logo{width:138px;height:70px;object-fit:contain;object-position:center;mix-blend-mode:multiply}
@media(max-width:700px){
  .brand-symbol{width:38px;height:38px}
  .page-header h1{font-size:42px}
  .brand-lockup{gap:10px}
  .cortis-brasil-header-logo{width:92px;height:50px}
}

/* V13 — editorial project credit */
.project-credit{font-size:11px;font-weight:800;letter-spacing:.18em;color:#5f5b55;white-space:nowrap;text-transform:uppercase;padding-right:4px}
.project-credit span{opacity:.55;margin:0 .35em}
@media(max-width:700px){.project-credit{font-size:8px;letter-spacing:.12em;white-space:normal;text-align:right;max-width:145px;line-height:1.45;padding-right:0}}

/* V17 — lower project credit toward header edge */
.project-credit{transform:translateY(14px)}
@media(max-width:700px){.project-credit{transform:translateY(8px)}}

/* V18 — slightly smaller COER ID heading for better visual proportion */
.page-header h1{font-size:clamp(40px,4.05vw,61px)}
@media(max-width:700px){.page-header h1{font-size:38px}}


/* V19 — mobile-only responsive layout. Desktop/card export remain unchanged. */
.mobile-actions{display:none}
@media(max-width:700px){
  .page-shell{width:100%;padding:14px 10px 28px}
  .page-header{padding:0 8px;margin-bottom:14px;gap:12px;align-items:center}
  .brand-lockup{gap:8px;min-width:0}
  .brand-symbol{width:34px;height:34px;flex:0 0 auto}
  .page-header h1{font-size:34px;line-height:1;white-space:nowrap;letter-spacing:-.055em}
  .project-credit{font-size:7px;line-height:1.35;letter-spacing:.11em;max-width:136px;transform:translateY(4px);margin-left:auto}

  .workspace{display:flex;flex-direction:column;gap:14px}
  .controls-panel{order:1;padding:16px;border-radius:18px;position:relative;top:auto}
  .preview-panel{order:2;padding:12px;border-radius:18px;overflow:hidden}

  .step-block+.step-block{margin-top:22px}
  .step-title{font-size:11px;margin-bottom:12px;letter-spacing:.09em}
  .step-title span{width:27px;height:27px;margin-right:8px}

  .member-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;overflow:visible;max-width:none;padding:4px 2px 8px}
  .member-choice{min-width:0;grid-column:span 2;border-radius:10px}
  .member-choice:nth-child(4){grid-column:2 / span 2}
  .member-choice:nth-child(5){grid-column:4 / span 2}
  .member-choice img{aspect-ratio:3/4}
  .member-choice span{font-size:8px;padding:7px 1px}

  .fields{gap:10px}
  .fields label{gap:5px}
  .fields label span{font-size:9px}
  .fields input,.fields select{padding:12px 13px;border-radius:10px;font-size:15px}

  .controls-panel > .primary-btn,.controls-panel > .secondary-btn{display:none}

  .preview-topline{font-size:9px;margin:0 2px 10px}
  .card-wrap{width:100%;overflow:hidden;margin:0;padding:0}
  .coer-card{min-width:0!important;width:100%!important;aspect-ratio:1.6/1;border-radius:16px;box-shadow:0 10px 26px rgba(17,17,17,.12)}
  .card-header{padding:0 4.2%}
  .cortis-brand{gap:5px}
  .cortis-wordmark-text{font-size:clamp(13px,5.3vw,22px)}
  .photo-column{padding:5.4% 5% 3.8%}
  .photo-frame{border-width:1px}
  .id-number{margin-left:4px}
  .id-number small{font-size:5.5px;margin-bottom:1px}
  .id-number strong{font-size:10px;border-width:1px;padding:1px 6px}
  .info-column{padding:5.5% 12.5% 3.7% 4%}
  .card-kicker{font-size:6px;margin-bottom:2.7%}
  .info-row{padding-bottom:1.1%;margin-bottom:2.5%}
  .info-row small{font-size:5.2px;margin-bottom:.4%}
  .info-row strong{font-size:clamp(9px,3.7vw,15px)}
  .bottom-row{grid-template-columns:22% 1fr;gap:8%}
  .signature-block{min-height:36px}
  .signature-block small{font-size:5px;bottom:2px}
  .signature-block img{height:42px}
  .fingerprint-box{border-width:.7px}
  .barcode{right:4.5%;top:28%;width:3.2%;height:50%}

  .mobile-actions{display:block;margin-top:14px}
  .mobile-actions .primary-btn{margin-top:0;position:static;box-shadow:none;padding:14px 12px}
  .mobile-actions .secondary-btn{margin-top:8px;padding:13px 12px}
}
@media(max-width:390px){
  .page-header h1{font-size:31px}
  .brand-symbol{width:31px;height:31px}
  .project-credit{font-size:6.5px;max-width:120px}
}

/* V20 — mobile member selector: keep all five IDs in one row */
@media(max-width:700px){
  .member-grid{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:5px;
    overflow:visible;
    max-width:none;
    padding:4px 0 8px;
  }
  .member-choice,
  .member-choice:nth-child(4),
  .member-choice:nth-child(5){
    grid-column:auto;
    min-width:0;
    width:100%;
    border-radius:8px;
  }
  .member-choice img{width:100%;aspect-ratio:3/4;object-fit:cover}
  .member-choice span{font-size:6.5px;padding:6px 0;letter-spacing:-.02em;white-space:nowrap}
}
@media(max-width:390px){
  .member-grid{gap:4px}
  .member-choice span{font-size:5.8px}
}

/* V21 — mobile preview: show the complete lower edge + compact project credit */
@media(max-width:700px){
  .project-credit{
    font-size:6px;
    letter-spacing:.10em;
    line-height:1.25;
    max-width:118px;
    transform:translateY(2px);
  }
  .preview-panel{overflow:visible}
  .card-wrap{
    overflow:visible;
    padding:0 0 3px;
  }
  .coer-card{
    aspect-ratio:1.6 / 1 !important;
    overflow:hidden;
  }
  .photo-column{padding-bottom:3%}
  .info-column{padding-bottom:3%}
  .bottom-row{margin-top:auto;align-items:end}
  .fingerprint-box{max-height:none}
  .signature-block{min-height:31px}
  .signature-block img{height:35px}
}

/* V22 — mobile: guarantee fingerprint + signature remain fully inside card */
@media(max-width:700px){
  .coer-card{position:relative!important}
  .info-column{padding:4.6% 12.5% 3.2% 4%!important}
  .card-kicker{margin-bottom:1.8%!important}
  .info-row{padding-bottom:.7%!important;margin-bottom:1.6%!important}
  .bottom-row{
    position:absolute!important;
    left:38.5%;
    right:8.5%;
    bottom:3.4%;
    height:22%;
    margin:0!important;
    display:grid!important;
    grid-template-columns:22% 1fr!important;
    gap:8%!important;
    align-items:end!important;
    z-index:5;
  }
  .fingerprint-box{width:100%;height:auto;aspect-ratio:1/1;align-self:end}
  .signature-block{height:100%;min-height:0!important;align-self:end}
  .signature-block img{height:92%!important;max-height:44px;width:66%;object-fit:contain;object-position:center bottom}
  .signature-block small{bottom:2px}
}
