:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef5f2;
  color: #12354a;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(12, 147, 131, 0.1) 0 1px, transparent 1px 72px),
    linear-gradient(#f8fbf9, #e8f2ef);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.workspace {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 400px) 1fr;
  gap: 34px;
  align-items: center;
}

.app-footer {
  width: min(1120px, 100%);
  margin-top: 22px;
  color: #31596a;
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
}

.panel {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #c7e1dc;
  border-top: 6px solid #159684;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 55px rgba(13, 55, 73, 0.12);
}

.panel-header {
  position: relative;
  margin-bottom: 28px;
}

.panel-title-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.panel-title-row img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.panel-title-copy {
  min-width: 0;
}

.panel-header p {
  margin: 0 0 10px;
  color: #f36c2d;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel-header h1 {
  max-width: 100%;
  margin: 0;
  color: #113b84;
  font-size: clamp(1.7rem, 3.25vw, 2.55rem);
  line-height: 0.98;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.form {
  position: relative;
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #12354a;
  font-size: 0.92rem;
  font-weight: 800;
}

input {
  width: 100%;
  border: 1px solid #b8d7d0;
  border-radius: 6px;
  padding: 14px;
  color: #102d40;
  font: inherit;
  font-weight: 700;
  background: #fafdfe;
  outline: none;
}

input:focus {
  border-color: #159684;
  box-shadow: 0 0 0 3px rgba(21, 150, 132, 0.16);
}

button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 14px 18px;
  margin-top: 6px;
  background: #113b84;
  color: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

button:hover {
  background: #0d315f;
}

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

.status {
  min-height: 22px;
  margin: 16px 0 0;
  color: #31596a;
  font-weight: 700;
}

.status.error {
  color: #b5442d;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  padding: 20px;
}

.modal.is-open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 30, 43, 0.42);
}

.modal-dialog {
  position: relative;
  width: min(430px, 100%);
  padding: 26px;
  border-top: 6px solid #f36c2d;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(8, 30, 43, 0.28);
}

.modal-dialog h2 {
  margin: 0 0 10px;
  color: #113b84;
  font-size: 1.35rem;
  line-height: 1.15;
}

.modal-dialog p {
  margin: 0 0 22px;
  color: #263f4c;
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 650;
}

.modal-button {
  margin: 0;
}

.preview {
  min-width: 0;
}

.certificate-sheet {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.414 / 1;
  width: 100%;
  padding: 26px 42px 34px;
  background: #fffefd;
  border: 1px solid #d8e5e1;
  box-shadow: 0 22px 70px rgba(13, 55, 73, 0.16);
}

.preview-top {
  display: flex;
  justify-content: center;
}

.preview-brand {
  display: grid;
  justify-items: center;
  color: #113b84;
  text-align: center;
  text-transform: uppercase;
}

.preview-brand span {
  color: #113b84;
  font-size: clamp(2rem, 5vw, 4.4rem);
  font-weight: 1000;
  line-height: 0.78;
}

.preview-brand strong {
  font-size: clamp(1.25rem, 3.2vw, 2.6rem);
  font-weight: 1000;
  line-height: 0.9;
}

.preview-brand em {
  color: #f36c2d;
  font-size: clamp(0.9rem, 2vw, 1.55rem);
  font-style: normal;
  font-weight: 1000;
}

.preview-rule {
  height: 5px;
  margin: 10px -42px 22px;
  background: #159684;
}

.preview-logo-strip {
  width: min(720px, 90%);
  display: block;
  height: auto;
  margin: 52px auto 0;
}

.preview-signature {
  width: min(310px, 42%);
  height: 0;
  margin: 130px auto 0;
}

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

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

  .panel {
    padding: 22px;
  }

  .panel-title-row {
    grid-template-columns: 54px 1fr;
    gap: 12px;
  }

  .panel-title-row img {
    width: 54px;
    height: 54px;
  }
}

@media (max-width: 560px) {
  .certificate-sheet {
    padding: 18px 22px 24px;
  }

  .preview-top {
    justify-content: center;
  }

  .preview-rule {
    margin-right: -22px;
    margin-left: -22px;
  }

}
