/* Create page and read page: options, messages, result panel.
   Sits next to leesogen.css (face, eyes, textarea, .btn), which is not changed. */

[hidden] { display: none !important; }

/* ---- Form controls ---- */

.input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: var(--field-bg);
  color: var(--text);
  border: 1px solid var(--field-border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  color-scheme: dark;
}

.input:focus {
  outline: none;
  border-color: #5b7cff;
  box-shadow: 0 0 0 1px #5b7cff;
}

/* ---- Options under the letter ---- */

.options {
  display: grid;
  gap: 12px 16px;
  margin-top: 16px;
}

.opt__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.opt--check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  cursor: pointer;
}

.opt--check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #5b7cff;
}

@container (min-width: 440px) {
  .options { grid-template-columns: 1fr 1fr; }
  .opt--check { grid-column: 1 / -1; }
}

/* ---- Messages ---- */

.msg {
  margin: 14px 0 0;
  min-height: 1.4em;
  font-size: 0.92rem;
  color: var(--muted);
}

.msg:empty { display: none; }

.msg--error { color: #ff8787; }
.msg--warn  { color: #ffd479; }

/* ---- Button variants ---- */

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn--secondary {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--field-border);
}

.btn--secondary:hover { background: rgba(255, 255, 255, 0.06); }

/* ---- Result panel (create page) ---- */

.result {
  padding: 4px 0 0;
}

.result__title {
  margin: 0 0 14px;
  font-size: 1.25rem;
  text-align: center;
}

.result__link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
}

.result__summary {
  margin: 16px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
}

.result__note {
  margin: 10px 0 0;
  font-size: 0.92rem;
  color: #ffd479;
  text-align: center;
}

/* The test view on the "Your link is ready" screen: the read page in an iframe (see create.js) */
.result__demo {
  display: block;
  width: 100%;
  height: 900px;               /* until the frame reports its real height */
  margin: 20px 0 16px;
  border: 0;
}

.embed { overflow: hidden; }     /* the parent sizes the frame; a scrollbar would change the width and height */
.embed body { min-height: 0; }
.embed .page { padding: 0; }
.embed .page__title { display: none; }

/* ---- Read page ---- */

.panel {
  margin-top: 16px;
}

.panel p {
  margin: 0 0 10px;
}

.panel__lead {
  font-size: 1.05rem;
  font-weight: 600;
}

.panel__small {
  font-size: 0.9rem;
  color: var(--muted);
}

.panel .opt { margin-top: 14px; }

/* Read page: the received text can be read and scrolled, not selected (copying goes via the button) */
.secret--locked {
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ---- Read page: closed envelope, destroy video ---- */

.btn--link {
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

/* Laid exactly over the letter photo (same crop, same aspect), above the face and the textarea. */
.envelope {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 700ms ease;
}

.envelope--open {
  opacity: 0;
  pointer-events: none;
}

/* "Copy and destroy!": the video takes the place of the photo, in the same box. */
.field--destroyed .strip,
.field--destroyed .secret {
  visibility: hidden;
}

.destroy-video {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

@media (prefers-reduced-motion: reduce) {
  .envelope { transition: none; }
}
