/* EDES components. Requires tokens.css.
   Button (ref: baseline.agency): square block, small up-right arrow, and an
   inverted layer that opens from the centre line on hover/focus. */

.btn {
  --btn-bg: var(--ink);    --btn-fg: var(--paper);
  --btn-bg2: var(--paper); --btn-fg2: var(--ink);
  position: relative;
  display: inline-grid;
  grid-template-areas: "stack";
  font: inherit;
  font-size: var(--fs-body);
  font-weight: var(--fw-text);
  letter-spacing: var(--tr-ui);
  line-height: 1.375rem;
  text-decoration: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}
.btn > span {
  grid-area: stack;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.125rem;
  white-space: nowrap;
}
.btn .base   { background: var(--btn-bg);  color: var(--btn-fg); }
.btn .reveal {
  background: var(--btn-bg2); color: var(--btn-fg2);
  clip-path: polygon(-1px 50%, calc(100% + 1px) 50%, calc(100% + 1px) 50%, -1px 50%);
  transition: clip-path .45s cubic-bezier(.19, 1, .22, 1);
}
.btn .t, .btn .icon { display: inline-block; transition: transform .45s cubic-bezier(.19, 1, .22, 1); }
.btn .reveal .t, .btn .reveal .icon { transform: scale(1.06); }


@media (hover: hover) and (pointer: fine) {
  .btn:hover .reveal { clip-path: polygon(-1px -1px, calc(100% + 1px) -1px, calc(100% + 1px) calc(100% + 1px), -1px calc(100% + 1px)); }
  .btn:hover .reveal .t, .btn:hover .reveal .icon { transform: none; }
}
.btn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.btn:focus-visible .reveal { clip-path: polygon(-1px -1px, calc(100% + 1px) -1px, calc(100% + 1px) calc(100% + 1px), -1px calc(100% + 1px)); }
.btn:active .reveal { clip-path: polygon(-1px -1px, calc(100% + 1px) -1px, calc(100% + 1px) calc(100% + 1px), -1px calc(100% + 1px)); }

/* Variants */
.btn-secondary { --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-bg2: var(--ink); --btn-fg2: var(--paper); }
.btn-on-dark   { --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-bg2: var(--grey); --btn-fg2: var(--ink); }

/* Sizes */
.btn-sm { font-size: var(--fs-small); }
.btn-sm > span { padding: 0.375rem 0.75rem; gap: 0.4rem; }

.btn-xl { font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem); font-family: var(--font-display); font-weight: var(--fw-heading); letter-spacing: var(--tr-heading); }
.btn-xl > span { padding: 0.45em 0.8em; gap: 0.55em; }


@media (prefers-reduced-motion: reduce) {
  .btn .reveal, .btn .t, .btn .icon { transition: none; }
  .btn .reveal .t, .btn .reveal .icon { transform: none; }
}

/* Icon (Lucide sprite): <svg class="icon"><use href="icons/sprite.svg#i-NAME"/></svg> */
.icon {
  width: var(--icon-md); height: var(--icon-md); flex: none;
  fill: none; stroke: currentColor; stroke-width: var(--icon-stroke);
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.2em;
}
.icon-sm { width: var(--icon-sm); height: var(--icon-sm); }
.icon-lg { width: var(--icon-lg); height: var(--icon-lg); }
.btn .icon { width: 1em; height: 1em; stroke-width: 1.75; }

/* ---------- Form ---------- */
.form { display: grid; gap: var(--s-6); }
.form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: var(--s-5); }
.form fieldset[hidden] { display: none; }
.form legend { padding: 0; margin-bottom: var(--s-4); font-family: var(--font-display); font-weight: var(--fw-heading); font-size: var(--fs-h4); letter-spacing: var(--tr-heading); }
.form .row { display: grid; gap: var(--s-5); }
@media (min-width: 720px) { .form .row { grid-template-columns: 1fr 1fr; } }
.field-group { display: grid; gap: var(--s-2); }
.field-group label, .field-group .lbl { font-size: var(--fs-detail); line-height: var(--lh-detail); color: var(--ink); }
.field-group .opt { color: var(--muted); }
.field-group .hint { font-size: var(--fs-micro); line-height: 1.4; color: var(--muted); }
.input, .select, .textarea {
  font: inherit; font-size: var(--fs-body); color: var(--ink); width: 100%;
  padding: 12px 14px; border: 0; border-radius: var(--radius-inner);
  background: var(--paper); box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow .15s ease;
}
.textarea { min-height: 148px; resize: vertical; line-height: 1.5; }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.input::placeholder, .textarea::placeholder { color: #8A8A8A; }
.input:hover, .select:hover, .textarea:hover { box-shadow: 0 0 0 1px var(--silver); }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: 0 0 0 2px var(--ink); }
.field-group.invalid .input, .field-group.invalid .select, .field-group.invalid .textarea { box-shadow: 0 0 0 2px #B42318; }
.field-group .error { display: none; font-size: var(--fs-micro); color: #B42318; }
.field-group.invalid .error { display: block; }
.input[type="file"] { padding: 10px 12px; font-size: var(--fs-detail); }
.input[type="file"]::file-selector-button { font: inherit; margin-right: var(--s-3); padding: 6px 10px; border: 0; border-radius: var(--radius-chip); background: var(--raised-solid); box-shadow: var(--shadow-chip); cursor: pointer; }

/* Segmented choice (enquiry type) */
.choice { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  padding: 10px 14px; font-size: var(--fs-detail); line-height: 1.2; cursor: pointer;
  border-radius: var(--radius-chip); background: var(--paper); box-shadow: 0 0 0 1px var(--line);
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.choice label:hover { box-shadow: 0 0 0 1px var(--silver); }
.choice input:checked + label { background: var(--ink); color: var(--paper); box-shadow: 0 0 0 1px var(--ink); }
.choice input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }

.form-status { font-size: var(--fs-detail); line-height: 1.5; padding: var(--s-4); border-radius: var(--radius-inner); background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.form-status[hidden] { display: none; }
.form-status.ok { box-shadow: 0 0 0 1px var(--ink); }
.form-status.err { box-shadow: 0 0 0 1px #B42318; color: #B42318; }
.form .submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
.form .submit-row p { font-size: var(--fs-micro); color: var(--muted); max-width: 40ch; }
button.btn { font: inherit; }
.captcha-group { min-height: 78px; }
