@font-face {
  font-family: "IranSansX";
  src: url("/fonts/IRANSansX-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "IranSansX";
  src: url("/fonts/IRANSansX-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
}

:root {
  color-scheme: light;
  font-family: "IranSansX", system-ui, sans-serif;
  background: #eef1f4;
  color: #121820;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 40px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(420px, 1fr);
  gap: 28px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: start;
}

.form-panel,
.preview-panel {
  min-width: 0;
  background: #ffffff;
  border: 1px solid #d9dee5;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 18px 42px rgba(30, 41, 59, 0.06);
}

h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
}

.panel-description {
  margin: 0 0 22px;
  color: #667587;
  font-size: 14px;
  line-height: 1.8;
}

form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd3dd;
  border-radius: 10px;
  padding: 12px 14px;
  background: #ffffff;
  color: #121820;
}

textarea {
  resize: vertical;
  min-height: 116px;
}

button,
.download-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  background: #176b87;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.submit-area {
  display: grid;
  gap: 8px;
}

.output-format {
  color: #7a8795;
  font-size: 12px;
  line-height: 1.6;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

#message {
  min-height: 28px;
  margin: 16px 0 0;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  color: #526070;
  font-weight: 400;
  line-height: 1.7;
}

#message:empty {
  border-color: transparent;
  padding: 0;
}

#message[data-type="info"] {
  border-color: #9ac5d7;
  background: #e7f4f8;
  color: #15556d;
}

#message[data-type="success"] {
  border-color: #9fd4b4;
  background: #e8f7ee;
  color: #166534;
}

#message[data-type="error"] {
  border-color: #f0a4a4;
  background: #fff0f0;
  color: #b42318;
}

#message[data-type="warning"] {
  border-color: #f3c17b;
  background: #fff7ed;
  color: #b45309;
}

.preview-panel {
  display: grid;
  gap: 18px;
}

.preview-frame {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  aspect-ratio: var(--preview-aspect-ratio, 806 / 472);
  border: 1px dashed #c6d0dc;
  border-radius: 16px;
  background: #f9fbfd;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.preview-frame img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.preview-frame img[hidden] {
  display: none;
}

#empty-preview {
  display: grid;
  gap: 6px;
  color: #667587;
  text-align: center;
  padding: 18px;
}

#empty-preview[hidden] {
  display: none;
}

#empty-preview strong {
  color: #526070;
  font-size: 15px;
  font-weight: 700;
}

#empty-preview small {
  color: #7a8795;
  font-size: 12px;
  line-height: 1.8;
}

.download-link {
  justify-self: start;
}

.download-link[hidden] {
  display: none;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 18px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-frame {
    max-height: 72vh;
  }
}
