/* FIXD — request drawer.
   A right-hand drawer on desktop, a full-height sheet on phones. Demo only:
   nothing is submitted anywhere, and the success state says so out loud. */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  justify-items: end;
  visibility: hidden;
}
.drawer.is-open { visibility: visible; }

.drawer__veil {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 10, .72);
  opacity: 0;
  transition: opacity var(--dur-md) var(--ease-snap);
  border: 0;
  padding: 0;
  cursor: pointer;
}
.drawer.is-open .drawer__veil { opacity: 1; }

.drawer__panel {
  position: relative;
  width: min(100%, 480px);
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--black);
  color: var(--white);
  border-left: 3px solid var(--yellow);
  transform: translateX(100%);
  transition: transform var(--dur-md) var(--ease-snap);
  padding: 1.25rem var(--gutter) calc(2rem + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.drawer.is-open .drawer__panel { transform: none; }

.drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--white-16);
}
.drawer__title { font-size: clamp(1.7rem, 5vw, 2.3rem); font-variation-settings: 'wdth' 80; }
.drawer__note { color: var(--white-48); font-size: var(--t-small); margin-top: .5rem; }

.drawer__close {
  flex: none;
  width: 44px; height: 44px;
  display: grid;
  place-content: center;
  border: 1px solid var(--white-16);
  border-radius: var(--r);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  transition: background var(--dur-xs) linear, color var(--dur-xs) linear, border-color var(--dur-xs) linear;
}
.drawer__close:hover { background: var(--yellow); color: var(--black); border-color: var(--yellow); }

/* --- form -------------------------------------------------------------- */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .45rem; }
.field > label {
  font-family: var(--font-display);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--white-72);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: .95rem 1rem;
  border: 1px solid var(--white-16);
  border-radius: var(--r);
  background: var(--graphite);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;              /* 16px stops iOS zooming on focus */
  transition: border-color var(--dur-xs) linear, background var(--dur-xs) linear;
}
.field textarea { min-height: 108px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--white-48); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--yellow);
  outline: none;
  background: #2c2c2c;
}
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--yellow) 50%),
                    linear-gradient(135deg, var(--yellow) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}
.field__err { font-size: var(--t-small); color: var(--yellow); min-height: 0; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--yellow); }

.form__row { display: grid; gap: 1.1rem; }
.form .btn { width: 100%; justify-content: center; margin-top: .25rem; }
.form__small { font-size: var(--t-small); color: var(--white-48); }

/* --- demo result ------------------------------------------------------- */
.drawer__done {
  display: none;
  border-top: 3px solid var(--yellow);
  background: var(--graphite);
  padding: clamp(1.4rem, 4vw, 2rem);
}
.drawer__done.is-shown { display: grid; gap: .75rem; }
.drawer__done h3 { font-size: 1.5rem; font-variation-settings: 'wdth' 84; color: var(--yellow); }
.drawer__done p { color: var(--white-72); }

@media (min-width: 520px) {
  .form__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 700px) {
  .drawer__panel { padding-inline: clamp(1.5rem, 3vw, 2.25rem); }
}
@media (prefers-reduced-motion: reduce) {
  .drawer__panel, .drawer__veil { transition: none; }
}
