@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
  --bg:#f4f5fa;
  --surface:#ffffff;
  --surface-2:#f8f8fc;
  --line:#e8e9f1;
  --line-strong:#d8dae7;
  --text:#191a23;
  --muted:#74778a;
  --primary:#6d5dfc;
  --primary-2:#5142e8;
  --primary-soft:#eeecff;
  --success:#18a66a;
  --shadow:0 18px 50px rgba(28,24,65,.08);
  --shadow-soft:0 8px 24px rgba(28,24,65,.06);
  --radius:22px;
}

*{box-sizing:border-box}
html{min-height:100%;background:var(--bg)}
body{
  margin:0;
  min-height:100vh;
  font-family:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 7% 0%, rgba(109,93,252,.10), transparent 25rem),
    radial-gradient(circle at 100% 30%, rgba(91,184,255,.10), transparent 24rem),
    var(--bg);
}

button,input{font:inherit}
button{cursor:pointer}
svg{display:block}

.page-shell{
  width:min(1540px,calc(100% - 36px));
  margin:0 auto;
  padding:22px 0 28px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:4px 2px 18px;
}
.brand{display:flex;align-items:center;gap:13px}
.brand-mark{
  width:48px;height:48px;
  display:grid;place-items:center;
  border-radius:15px;
  background:linear-gradient(145deg,var(--primary),#8d7fff);
  box-shadow:0 10px 24px rgba(109,93,252,.25);
}
.brand-mark svg{width:28px;height:28px;fill:none;stroke:white;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.brand-kicker{font-size:10px;line-height:1;font-weight:800;letter-spacing:.15em;color:var(--primary);margin-bottom:5px}
h1{font-size:24px;line-height:1.05;margin:0;letter-spacing:-.035em}
.topbar-meta{display:flex;align-items:center;gap:9px;flex-wrap:wrap;justify-content:flex-end}
.status-pill,.version-pill{
  height:34px;
  display:inline-flex;align-items:center;gap:8px;
  padding:0 12px;
  border-radius:999px;
  font-size:11px;font-weight:700;
  border:1px solid var(--line);
  background:rgba(255,255,255,.78);
  backdrop-filter:blur(10px);
}
.status-dot{width:7px;height:7px;border-radius:50%;background:var(--success);box-shadow:0 0 0 4px rgba(24,166,106,.10)}
.version-pill{color:var(--primary);background:var(--primary-soft);border-color:#ded9ff}

.hero-note{
  min-height:70px;
  padding:15px 18px;
  display:flex;align-items:center;justify-content:space-between;gap:20px;
  border:1px solid rgba(109,93,252,.14);
  border-radius:18px;
  background:linear-gradient(105deg,rgba(255,255,255,.94),rgba(242,240,255,.92));
  box-shadow:var(--shadow-soft);
  margin-bottom:16px;
}
.hero-note>div:first-child{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.hero-note strong{font-size:14px}
.hero-note span{font-size:12px;color:var(--muted)}
.hero-badges{display:flex;gap:7px}
.hero-badges span{
  padding:6px 9px;border-radius:9px;
  background:white;border:1px solid var(--line);
  color:#56596e;font-weight:700;font-size:10px;text-transform:uppercase;letter-spacing:.04em
}

.workspace{
  display:grid;
  grid-template-columns:365px minmax(0,1fr);
  gap:16px;
  align-items:start;
}

.control-card,.preview-card{
  background:rgba(255,255,255,.96);
  border:1px solid rgba(218,220,233,.9);
  box-shadow:var(--shadow);
  border-radius:var(--radius);
}

.control-card{
  padding:20px;
  position:sticky;
  top:16px;
}

.section-title,.export-title{
  display:flex;align-items:center;gap:11px;
  margin-bottom:17px;
}
.section-number{
  width:30px;height:30px;min-width:30px;
  display:grid;place-items:center;
  border-radius:10px;
  background:var(--primary-soft);
  color:var(--primary);
  font-size:11px;font-weight:800;
}
.section-title h2,.export-title h3{margin:0;font-size:16px;letter-spacing:-.02em}
.section-title p,.export-title p{margin:3px 0 0;font-size:11px;color:var(--muted)}

.upload-zone{
  min-height:88px;
  display:flex;align-items:center;gap:13px;
  padding:14px;
  border:1.5px dashed #c9c8dd;
  border-radius:16px;
  background:linear-gradient(180deg,#fbfbff,#f7f6ff);
  cursor:pointer;
  transition:.2s ease;
}
.upload-zone:hover{border-color:var(--primary);background:var(--primary-soft);transform:translateY(-1px)}
.upload-zone input{display:none}
.upload-icon{
  width:44px;height:44px;min-width:44px;
  display:grid;place-items:center;
  border-radius:13px;
  background:white;
  border:1px solid var(--line);
  box-shadow:0 5px 14px rgba(42,38,83,.06);
}
.upload-icon svg{width:20px;height:20px;fill:none;stroke:var(--primary);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.upload-copy{display:flex;flex-direction:column;gap:4px}
.upload-copy strong{font-size:13px}
.upload-copy small{font-size:11px;color:var(--muted)}

.control-group{
  padding:15px 0;
  border-bottom:1px solid #f0f0f5;
}
.control-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  margin-bottom:10px;
}
.control-head label{font-size:12px;font-weight:700}
.control-head output{font-size:11px;font-weight:700;color:var(--primary)}
.control-chip{
  padding:4px 7px;border-radius:7px;
  background:#f2f2f8;color:#777a8d;
  font-size:9px;font-weight:700;
}
.measure-row{
  display:flex;align-items:center;
  border:1px solid var(--line-strong);
  border-radius:12px;
  overflow:hidden;
  background:#fff;
  margin-bottom:10px;
}
.measure-row input{
  width:100%;
  border:0;outline:0;
  padding:10px 12px;
  font-weight:700;
  color:var(--text);
  background:transparent;
}
.unit{
  align-self:stretch;
  display:flex;align-items:center;
  padding:0 12px;
  background:#f7f7fb;
  border-left:1px solid var(--line);
  color:var(--muted);
  font-size:11px;font-weight:700;
}
.slider-row{display:flex;align-items:center;gap:10px}
.slider-row output{min-width:55px;text-align:right;font-size:10px;font-weight:700;color:var(--muted)}
input[type=range]{
  width:100%;
  height:5px;
  appearance:none;
  border-radius:999px;
  background:linear-gradient(90deg,var(--primary-soft),#e9eaf0);
  outline:none;
}
input[type=range]::-webkit-slider-thumb{
  appearance:none;
  width:18px;height:18px;border-radius:50%;
  background:white;
  border:5px solid var(--primary);
  box-shadow:0 2px 8px rgba(109,93,252,.25);
}
input[type=range]::-moz-range-thumb{
  width:10px;height:10px;border-radius:50%;
  background:white;border:5px solid var(--primary);
}
.range-legend{
  display:flex;justify-content:space-between;
  margin-top:6px;
  font-size:9px;color:#a0a2b1;
}

.switch-row{
  display:flex;align-items:center;gap:11px;
  margin:14px 0 16px;
  cursor:pointer;
}
.switch-row input{display:none}
.switch{
  width:38px;height:22px;min-width:38px;
  border-radius:999px;
  background:#d9dbe5;
  position:relative;
  transition:.2s;
}
.switch::after{
  content:"";position:absolute;top:3px;left:3px;
  width:16px;height:16px;border-radius:50%;
  background:white;box-shadow:0 2px 5px #0002;
  transition:.2s;
}
.switch-row input:checked + .switch{background:var(--primary)}
.switch-row input:checked + .switch::after{transform:translateX(16px)}
.switch-row strong{display:block;font-size:11px;margin-bottom:2px}
.switch-row small{display:block;font-size:9px;color:var(--muted)}

.output-options{
  margin:4px 0 16px;
  padding:12px 13px 5px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-2);
}
.output-options-title{
  margin-bottom:3px;
  font-size:10px;
  font-weight:800;
  color:var(--primary);
  text-transform:uppercase;
  letter-spacing:.06em;
}
.output-switch{margin:10px 0}
.output-fixed-note{
  margin:4px 0 7px;
  padding:8px 9px;
  border-radius:9px;
  background:#fff;
  color:var(--muted);
  font-size:9px;
  line-height:1.45;
}

.primary-action{
  width:100%;
  height:52px;
  border:0;
  border-radius:14px;
  display:flex;align-items:center;justify-content:center;gap:9px;
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
  color:white;
  font-size:12px;font-weight:800;letter-spacing:.025em;
  box-shadow:0 10px 24px rgba(109,93,252,.24);
  transition:.18s ease;
}
.primary-action:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 14px 28px rgba(109,93,252,.30)}
.button-icon{font-size:16px}
button:disabled{opacity:.38;cursor:not-allowed;box-shadow:none!important;transform:none!important}

.export-box{
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid var(--line);
}
.export-title{margin-bottom:11px}
.export-button{
  width:100%;
  min-height:58px;
  display:flex;align-items:center;gap:11px;
  padding:10px 12px;
  margin-top:8px;
  text-align:left;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  color:var(--text);
  transition:.18s ease;
}
.export-button:hover:not(:disabled){border-color:#cfc9ff;background:#faf9ff;transform:translateY(-1px)}
.export-icon{
  width:36px;height:36px;min-width:36px;
  display:grid;place-items:center;
  border-radius:11px;
  color:var(--primary);
  background:var(--primary-soft);
}
.export-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.export-button strong{display:block;font-size:11px;margin-bottom:3px}
.export-button small{display:block;font-size:9px;color:var(--muted)}

.production-note{
  display:flex;gap:10px;
  padding:11px;
  margin-top:14px;
  border-radius:13px;
  background:#f8f8fb;
  border:1px solid #eeeeF4;
}
.note-icon{
  width:22px;height:22px;min-width:22px;
  display:grid;place-items:center;
  border-radius:50%;
  background:var(--primary-soft);
  color:var(--primary);font-size:11px;font-weight:800;
}
.production-note strong{font-size:10px}
.production-note p{font-size:9px;line-height:1.5;color:var(--muted);margin:3px 0 0}

.preview-card{overflow:hidden}
.preview-top{
  min-height:78px;
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  padding:15px 18px;
  border-bottom:1px solid var(--line);
}
.eyebrow{font-size:9px;font-weight:800;letter-spacing:.12em;color:var(--primary);margin-bottom:3px}
.preview-top h2{margin:0;font-size:17px;letter-spacing:-.02em}
.tabs{
  padding:4px;
  display:flex;gap:3px;
  border-radius:12px;
  background:#f3f3f8;
}
.tab{
  height:34px;padding:0 12px;
  border:0;border-radius:9px;
  background:transparent;
  color:#7a7d8d;
  font-size:10px;font-weight:700;
  transition:.18s;
}
.tab.active{background:white;color:var(--text);box-shadow:0 3px 10px #0000000d}
.tab:hover:not(.active){color:var(--primary)}

.stage{
  position:relative;
  min-height:720px;
  display:flex;align-items:center;justify-content:center;
  padding:24px;
  overflow:auto;
  background-color:#f7f7fa;
  background-image:
    linear-gradient(45deg,#ececf2 25%,transparent 25%),
    linear-gradient(-45deg,#ececf2 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#ececf2 75%),
    linear-gradient(-45deg,transparent 75%,#ececf2 75%);
  background-size:20px 20px;
  background-position:0 0,0 10px,10px -10px,-10px 0;
}
.stage::before{
  content:"";
  position:absolute;inset:18px;
  border:1px solid rgba(105,101,129,.08);
  border-radius:15px;
  pointer-events:none;
}
canvas{
  display:none;
  max-width:96%;
  max-height:680px;
  background:#fff;
  border-radius:3px;
  box-shadow:0 12px 40px rgba(35,32,70,.14);
}
.empty-state{
  position:relative;z-index:1;
  text-align:center;
  padding:28px;
  color:var(--muted);
}
.empty-art{
  width:100px;height:100px;
  display:grid;place-items:center;
  margin:0 auto 14px;
  border-radius:26px;
  background:rgba(255,255,255,.82);
  border:1px solid var(--line);
  box-shadow:0 10px 30px rgba(40,36,75,.08);
}
.empty-art svg{width:57px;height:57px;fill:none;stroke:#aaa6c8;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.empty-state h3{margin:0 0 5px;color:#4a4c5e;font-size:14px}
.empty-state p{margin:0;font-size:10px}

.preview-footer{
  min-height:46px;
  display:flex;align-items:center;justify-content:space-between;gap:15px;
  padding:0 16px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:9px;
}
.footer-status{display:flex;align-items:center;gap:7px}
.footer-dot{width:7px;height:7px;border-radius:50%;background:var(--success)}

.page-footer{
  display:flex;justify-content:space-between;gap:15px;
  padding:16px 4px 0;
  color:#9496a5;
  font-size:9px;
}

@media(max-width:1050px){
  .workspace{grid-template-columns:330px minmax(0,1fr)}
  .stage{min-height:620px}
}
@media(max-width:850px){
  .page-shell{width:min(100% - 20px,760px);padding-top:12px}
  .topbar,.hero-note{align-items:flex-start}
  .topbar-meta{display:none}
  .hero-note{flex-direction:column}
  .workspace{grid-template-columns:1fr}
  .control-card{position:static}
  .preview-top{align-items:flex-start;flex-direction:column}
  .stage{min-height:520px;padding:14px}
  canvas{max-height:500px}
}
@media(max-width:520px){
  .page-shell{width:calc(100% - 12px)}
  .topbar{padding-inline:5px}
  .brand-mark{width:42px;height:42px}
  h1{font-size:20px}
  .brand-kicker{font-size:8px}
  .hero-note{padding:13px}
  .hero-badges{flex-wrap:wrap}
  .control-card{padding:14px;border-radius:17px}
  .preview-card{border-radius:17px}
  .preview-top{padding:13px}
  .tabs{width:100%}
  .tab{flex:1;padding:0 8px}
  .stage{min-height:420px}
  canvas{max-height:400px}
  .page-footer{display:none}
}


/* V23+ Texto */
.text-tool-box .text-area{
  width:100%;
  min-height:86px;
  resize:vertical;
  padding:12px 12px;
  border:1px solid var(--line-strong);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  margin:4px 0 12px;
}
.mini-grid{
  display:grid;
  grid-template-columns:1fr 92px;
  gap:10px;
  margin-bottom:12px;
}
.mini-field label{
  display:block;
  font-size:11px;
  font-weight:700;
  margin-bottom:6px;
  color:var(--text);
}
.mini-field select,
.mini-field input[type="color"]{
  width:100%;
  height:42px;
  border:1px solid var(--line-strong);
  border-radius:12px;
  background:#fff;
  padding:0 10px;
  color:var(--text);
}
.mini-field input[type="color"]{
  padding:5px;
}
.micro-tip{
  margin:10px 0 0;
  color:var(--muted);
  font-size:10px;
  line-height:1.5;
}


/* Fonte exclusiva do gerador */
.text-tool-box select#textFont{
  font-weight:800;
  color:#5b3700;
  background:linear-gradient(180deg,#fff9de,#fff3bb);
}

.mini-grid-single{
  grid-template-columns:1fr !important;
}
