/* Brand fonts used for the generated images (canvas rendering).
   These are the licensed files supplied by the client — Monument
   Extended (titles/numerals) and SF Pro Display (body text) — replacing
   the earlier free stand-ins (Unbounded / Inter). */
@font-face {
  font-family: 'Monument Extended';
  src: url('fonts/MonumentExtended-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'Monument Extended';
  src: url('fonts/MonumentExtended-Ultrabold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('fonts/SFPRODISPLAYREGULAR.OTF') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('fonts/SFPRODISPLAYBOLD.OTF') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

:root{
  --bg: #0b0b0c;
  --panel: #151517;
  --panel-2: #1a1a1d;
  --border: #29292d;
  --text: #f4f1ea;
  --text-dim: #9a9a9e;
  --accent: #c8ff4d;
  --accent-dim: rgba(200,255,77,0.12);
  --radius: 10px;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', sans-serif;
  --display: 'Unbounded', sans-serif;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.app{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Topbar ---------- */

.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.brand{
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark{
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent);
  color: #0b0b0c;
  font-family: var(--display);
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.5px;
}

.brand-text{
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name{
  font-weight: 700;
  font-size: 15px;
}

.brand-sub{
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.topbar-actions{
  display: flex;
  gap: 10px;
}

/* ---------- Buttons ---------- */

.btn{
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, transform .1s ease, background .15s ease;
}
.btn:hover{ border-color: #3a3a3f; }
.btn:active{ transform: translateY(1px); }

.btn-ghost{
  background: transparent;
}

.btn-primary{
  background: var(--accent);
  color: #0b0b0c;
  border-color: var(--accent);
}
.btn-primary:hover{ filter: brightness(1.05); }

.btn-secondary{
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

/* ---------- Layout ---------- */

.layout{
  flex: 1;
  display: grid;
  grid-template-columns: 500px 1fr;
  gap: 20px;
  padding: 20px;
}

.panel{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

/* ---------- Form panel ---------- */

.form-panel{
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 130px);
}

.section{
  border: none;
  padding: 0 0 22px 0;
  margin: 0 0 22px 0;
  border-bottom: 1px solid var(--border);
}
.section:last-child{
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-title{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px 0;
  font-weight: 600;
}

.field-row{
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.field{
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.field-row .field{ margin-bottom: 0; }

.field-sm{ flex: 1; }
.field-xs{ flex: 0 0 70px; }

.field em{
  font-style: normal;
  color: #5f5f63;
  font-size: 11px;
}

.field input,
.field select,
.field textarea{
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus{
  outline: none;
  border-color: var(--accent);
}

.field input:disabled,
.field select:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}

.field-hint{
  font-size: 12px;
  color: #5f5f63;
  margin: 4px 0 0 0;
  line-height: 1.4;
}

/* ---------- Preview panel ---------- */

.preview-panel{
  display: flex;
  flex-direction: column;
  padding: 24px;
  align-items: center;
}

.preview-controls{
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.tabs{
  display: flex;
  gap: 4px;
  background: var(--panel-2);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.tab{
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
}

.tab.active{
  background: var(--accent);
  color: #0b0b0c;
}

.format-toggle{
  display: flex;
  gap: 4px;
  background: var(--panel-2);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.seg{
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
}

.seg em{
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  color: inherit;
  opacity: .7;
  margin-left: 6px;
}

.seg.active{
  background: var(--text);
  color: #0b0b0c;
}

.canvas-wrap{
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 10px 0;
}

#canvas{
  max-width: 100%;
  max-height: 62vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.export-row{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.export-info{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.export-info .dot{
  margin: 0 8px;
  color: #3a3a3f;
}

.export-buttons{
  display: flex;
  gap: 10px;
}

/* ---------- Footer ---------- */

.footer{
  padding: 14px 28px;
  font-size: 12px;
  color: #5f5f63;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
}

/* ---------- Lock screen ---------- */

.lock-screen{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lock-box{
  width: 100%;
  max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lock-box .lock-mark{
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent);
  color: #0b0b0c;
  font-family: var(--display);
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.lock-box h1{
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.lock-box p{
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 20px 0;
}

.lock-box input{
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
  margin-bottom: 14px;
  text-align: center;
}

.lock-box input:focus{
  outline: none;
  border-color: var(--accent);
}

.lock-submit{
  width: 100%;
}

.lock-error{
  color: #FF6B6B;
  font-size: 12px;
  margin: 14px 0 0 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px){
  .layout{
    grid-template-columns: 1fr;
  }
  .form-panel{
    max-height: none;
  }
}
