/* Site-wide form dialogs (assets/dialogs.js). The box style of the Products grid: hairlines, square corners,
   no shadows. Type comes from type.css (Newsreader display, Helvetica Neue / Inter text, EDX mono for small labels),
   with the technical.css faces as a fallback. Fields sit in a hairline grid; the focused field is framed in accent.
   Phones (up to 640px) get a full-height sheet. Selectors start with "html body dialog.edx-dialog" so they win over
   the older form rules in style.css, technical.css and type.css whatever order the sheets load in. */

html.edx-dialog-lock{overflow:hidden}
html.edx-dialog-lock.edx-dialog-gutter{scrollbar-gutter:stable}

html body dialog.edx-dialog{
  --dlg-display:var(--font-display,var(--type-display,Georgia,serif));
  --dlg-text:var(--font-text,var(--type-text,"Helvetica Neue",Arial,sans-serif));
  --dlg-mono:var(--font-mono,"EDX Display",ui-monospace,SFMono-Regular,Menlo,monospace);
  --dlg-line:color-mix(in srgb,var(--ink,#0e100e) 15%,var(--bg,#f4f4f0));
  --dlg-pad:clamp(1.25rem,.85rem + 1.5vw,2.25rem);
  --dlg-bad:var(--bad,#b3261e);
  box-sizing:border-box;width:min(46rem,calc(100% - 2rem));max-width:none;max-height:min(calc(100% - 3rem),62rem);
  margin:auto;padding:0;border:1px solid var(--dlg-line);border-radius:0;box-shadow:none;
  background:var(--bg,#fff);color:var(--ink,#111);
  font-family:var(--dlg-text);font-size:1rem;font-weight:400;line-height:1.5;letter-spacing:normal;text-align:left;
  overflow:auto;overscroll-behavior:contain;scrollbar-width:thin
}
html[data-theme=dark] body dialog.edx-dialog{--dlg-line:color-mix(in srgb,var(--ink,#e8ebe5) 18%,var(--bg,#0b0c0b))}
html body dialog.edx-dialog *,html body dialog.edx-dialog *::before,html body dialog.edx-dialog *::after{box-sizing:border-box}
html body dialog.edx-dialog::backdrop{background:rgba(11,12,11,.55);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
html[data-theme=dark] body dialog.edx-dialog::backdrop{background:rgba(0,0,0,.72)}

/* Bar: a mono label and the close button, kept in view while the form scrolls. */
html body dialog.edx-dialog .edx-dialog-bar{position:sticky;top:0;z-index:3;display:flex;align-items:stretch;justify-content:space-between;min-height:3rem;border-bottom:1px solid var(--dlg-line);background:var(--bg)}
html body dialog.edx-dialog .edx-kicker{display:flex;align-items:center;gap:.65rem;margin:0;padding:0 var(--dlg-pad);font-family:var(--dlg-mono);font-size:.6875rem;font-weight:500;line-height:1.2;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-soft)}
html body dialog.edx-dialog .edx-kicker::before{content:"";flex:none;width:.5rem;height:.5rem;background:var(--accent)}
html body dialog.edx-dialog .edx-dialog-close{position:static;display:grid;place-items:center;flex:none;width:3rem;height:auto;min-height:3rem;margin:0;padding:0;border:0;border-left:1px solid var(--dlg-line);border-radius:0;background:transparent;color:var(--ink);font-size:1rem;line-height:1;cursor:pointer;transition:background-color .15s ease,color .15s ease}
html body dialog.edx-dialog .edx-dialog-close svg{display:block;width:.9375rem;height:.9375rem;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:square}
html body dialog.edx-dialog .edx-dialog-close:hover{background:var(--surface);color:var(--accent-ink,var(--accent))}
html body dialog.edx-dialog .edx-dialog-close:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}

/* Body. */
html body dialog.edx-dialog .edx-dialog-body{padding:var(--dlg-pad) var(--dlg-pad) calc(var(--dlg-pad) + env(safe-area-inset-bottom,0px))}
html body dialog.edx-dialog .edx-title{margin:0 0 .75rem;font-family:var(--dlg-display);font-size:clamp(1.75rem,1.3rem + 1.4vw,2.5rem);font-weight:var(--display-weight,500);line-height:1.08;letter-spacing:var(--display-tracking,-.02em);text-transform:none;color:var(--ink);text-wrap:balance}
html body dialog.edx-dialog .edx-title:focus{outline:none}
html body dialog.edx-dialog .edx-intro{max-width:36rem;margin:0;font-family:var(--dlg-text);font-size:clamp(1rem,.96rem + .2vw,1.0625rem);line-height:1.6;color:var(--ink-soft);text-wrap:balance}
html body dialog.edx-dialog form{max-width:none;margin:1.75rem 0 0}

/* The field grid: 1px gaps over the line colour draw the hairlines between cells. */
html body dialog.edx-dialog .edx-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;border:1px solid var(--dlg-line);background:var(--dlg-line)}
html body dialog.edx-dialog .edx-field{position:relative;grid-column:1/-1;display:flex;flex-direction:column;gap:.375rem;min-width:0;margin:0;padding:.875rem 1rem 1rem;background:var(--bg)}
html body dialog.edx-dialog .edx-field.edx-half{grid-column:auto}
html body dialog.edx-dialog .edx-field:focus-within{z-index:1;outline:2px solid var(--accent);outline-offset:-1px}
html body dialog.edx-dialog .edx-label{display:block;margin:0;font-family:var(--dlg-text);font-size:.9375rem;font-weight:500;line-height:1.35;letter-spacing:-.005em;text-transform:none;color:var(--ink);cursor:pointer}
html body dialog.edx-dialog .edx-req{color:var(--accent-ink,var(--accent))}
html body dialog.edx-dialog .edx-hint{margin:0;font-family:var(--dlg-text);font-size:.875rem;line-height:1.45;color:var(--ink-faint)}
html body dialog.edx-dialog .edx-control{display:block;width:100%;min-width:0;margin:0;padding:.25rem 0;border:0;border-radius:0;background:transparent;box-shadow:none;font-family:var(--dlg-text);font-size:1.0625rem;font-weight:400;line-height:1.5;letter-spacing:-.005em;color:var(--ink);-webkit-appearance:none;appearance:none}
html body dialog.edx-dialog .edx-control:is(:focus,:focus-visible){outline:none;box-shadow:none}
html body dialog.edx-dialog .edx-control::placeholder{color:var(--ink-faint);opacity:.8}
/* A placeholder longer than a phone-width field (Team or role) ends in an ellipsis instead of a hard cut. */
html body dialog.edx-dialog input.edx-control{text-overflow:ellipsis}
html body dialog.edx-dialog textarea.edx-control{min-height:4.75rem;resize:vertical}
html body dialog.edx-dialog .edx-select{position:relative;display:block}
html body dialog.edx-dialog .edx-select::after{content:"";position:absolute;top:50%;right:.3rem;width:.45rem;height:.45rem;border-right:1.5px solid var(--ink-soft);border-bottom:1.5px solid var(--ink-soft);transform:translateY(-70%) rotate(45deg);pointer-events:none}
html body dialog.edx-dialog select.edx-control{padding-right:1.75rem;cursor:pointer;text-overflow:ellipsis}
html body dialog.edx-dialog select.edx-control:has(option[value=""]:checked){color:var(--ink-faint)}
html body dialog.edx-dialog select.edx-control option{color:var(--ink);background:var(--bg)}

/* Errors: a red edge and label, and the message under the field. */
html body dialog.edx-dialog .edx-field.is-invalid{box-shadow:inset 3px 0 0 var(--dlg-bad)}
html body dialog.edx-dialog .edx-field.is-invalid .edx-label{color:var(--dlg-bad)}
.field-error{margin:.375rem 0 0;font-size:.875rem;line-height:1.4;color:var(--bad,#a32929)}
html[data-theme=dark] .field-error{color:var(--bad,#f0938e)}
html body dialog.edx-dialog .field-error{margin:.125rem 0 0;font-family:var(--dlg-text);font-size:.875rem;color:var(--dlg-bad)}
html body dialog.edx-dialog .form-error{margin:1rem 0 0;font-family:var(--dlg-text);font-size:.9375rem;line-height:1.45;color:var(--dlg-bad)}

/* Last row: the note and the send button share the grid. */
html body dialog.edx-dialog .edx-foot{justify-content:center;gap:.625rem}
html body dialog.edx-dialog .edx-note{margin:0;font-family:var(--dlg-text);font-size:.875rem;line-height:1.5;color:var(--ink-soft);text-wrap:pretty}
html body dialog.edx-dialog .edx-legend{margin:0;font-family:var(--dlg-mono);font-size:.6875rem;font-weight:500;line-height:1.3;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-faint)}
html body dialog.edx-dialog .edx-send{padding:0}
html body dialog.edx-dialog .edx-send:focus-within{outline:none}
html body dialog.edx-dialog .edx-submit{display:flex;align-items:center;justify-content:space-between;gap:1rem;width:100%;height:100%;min-height:3.75rem;margin:0;padding:1rem 1.25rem;border:0;border-radius:0;background:var(--accent);color:#0b0c0b;box-shadow:none;font-family:var(--dlg-text);font-size:1.0625rem;font-weight:500;line-height:1.3;letter-spacing:-.005em;text-transform:none;text-align:left;cursor:pointer;transition:background-color .15s ease,color .15s ease}
html body dialog.edx-dialog .edx-submit:hover{background:var(--ink);border-color:var(--ink);color:var(--bg);box-shadow:none}
html body dialog.edx-dialog .edx-submit:focus-visible{outline:2px solid var(--ink);outline-offset:-6px}
html body dialog.edx-dialog .edx-submit:hover:focus-visible{outline-color:var(--bg)}
html body dialog.edx-dialog .edx-submit:disabled{cursor:progress;opacity:.8}
html body dialog.edx-dialog .edx-arrow{flex:none;transition:transform .15s ease}
html body dialog.edx-dialog .edx-submit:hover .edx-arrow{transform:translateX(.2rem)}

/* Honeypot: out of sight, out of the tab order, hidden from screen readers. */
html body dialog.edx-dialog .edx-hp{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}

/* Thank-you state (assets/form.js): the form is replaced by a note and a Close button. */
html body dialog.edx-dialog.is-success{width:min(34rem,calc(100% - 2rem))}
html body dialog.edx-dialog.is-success .edx-dialog-head{display:none}
html body dialog.edx-dialog .form-card{max-width:none;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;text-align:left}
html body dialog.edx-dialog .form-card .check{display:grid;place-items:center;width:2.5rem;height:2.5rem;margin:0 0 1.5rem;border-radius:0;background:var(--accent);color:#0b0c0b;font-size:1.125rem;line-height:1}
html body dialog.edx-dialog .form-card h2{margin:0 0 .625rem;font-family:var(--dlg-display);font-size:clamp(1.625rem,1.3rem + 1vw,2.125rem);font-weight:var(--display-weight,500);line-height:1.1;letter-spacing:var(--display-tracking,-.02em);text-transform:none;color:var(--ink)}
html body dialog.edx-dialog .form-card p{margin:0;font-family:var(--dlg-text);font-size:1.0625rem;line-height:1.6;color:var(--ink-soft)}
html body dialog.edx-dialog .form-card p.form-dry,.form-card .form-dry{margin-top:.75rem;font-family:var(--font-mono,"EDX Display",ui-monospace,monospace);font-size:.75rem;line-height:1.4;letter-spacing:.04em;color:var(--ink-faint)}
html body dialog.edx-dialog .edx-btn{display:inline-flex;align-items:center;justify-content:center;width:auto;min-width:7rem;min-height:2.75rem;margin:1.75rem 0 0;padding:0 1.25rem;border:1px solid var(--ink);border-radius:0;background:transparent;box-shadow:none;font-family:var(--dlg-text);font-size:.9375rem;font-weight:500;line-height:1;letter-spacing:-.005em;text-transform:none;color:var(--ink);cursor:pointer;transition:background-color .15s ease,color .15s ease}
html body dialog.edx-dialog .edx-btn:hover{background:var(--ink);color:var(--bg)}
html body dialog.edx-dialog .edx-btn:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

/* Phones: a full-height sheet, one field per row. */
@media (max-width:40rem){
 html body dialog.edx-dialog,html body dialog.edx-dialog.is-success{width:100%;max-width:100%;height:100%;max-height:100%;margin:0;border:0}
 @supports (height:100dvh){html body dialog.edx-dialog,html body dialog.edx-dialog.is-success{height:100dvh;max-height:100dvh}}
 html body dialog.edx-dialog .edx-fields{grid-template-columns:minmax(0,1fr)}
 html body dialog.edx-dialog .edx-field.edx-half{grid-column:1/-1}
 html body dialog.edx-dialog .edx-kicker{padding-inline:1.25rem}
 html body dialog.edx-dialog .edx-foot:not(:has(.edx-note)){padding-block:.625rem}
}

/* Short laptop screens (up to 800px tall): tighter spacing and shorter text boxes, so the send button fits on screen
   without scrolling the dialog. Text boxes can still be dragged taller. */
@media (min-width:40.0625rem) and (max-height:50rem){
 html body dialog.edx-dialog{--dlg-pad:1.25rem;max-height:calc(100% - 1.5rem)}
 html body dialog.edx-dialog .edx-title{margin-bottom:.5rem;font-size:1.75rem}
 html body dialog.edx-dialog .edx-intro{font-size:1rem;line-height:1.5}
 html body dialog.edx-dialog form{margin-top:1.25rem}
 html body dialog.edx-dialog .edx-field{gap:.25rem;padding:.625rem 1rem .75rem}
 html body dialog.edx-dialog .edx-send{padding:0}
 html body dialog.edx-dialog .edx-submit{min-height:3.25rem}
 html body dialog.edx-dialog textarea.edx-control{min-height:3rem;height:3.75rem}
 html body dialog.edx-dialog textarea.edx-control[rows="5"]{height:5.25rem}
}

@media (prefers-reduced-motion:no-preference){
 html body dialog.edx-dialog[open]{animation:edx-dialog-in .22s cubic-bezier(.2,.7,.2,1)}
 html body dialog.edx-dialog[open]::backdrop{animation:edx-backdrop-in .22s ease-out}
}
@media (prefers-reduced-motion:no-preference) and (max-width:40rem){
 html body dialog.edx-dialog[open]{animation:edx-sheet-in .28s cubic-bezier(.2,.7,.2,1)}
}
@keyframes edx-dialog-in{from{opacity:0;transform:translateY(.5rem)}}
@keyframes edx-sheet-in{from{opacity:0;transform:translateY(1.5rem)}}
@keyframes edx-backdrop-in{from{opacity:0}}

@media (forced-colors:active){
 html body dialog.edx-dialog .edx-field:focus-within{outline-color:Highlight}
 html body dialog.edx-dialog .edx-submit{border:1px solid ButtonText}
}
