/* CLIFF EVENT — unified form controls */

/* ---------- fields ---------- */

.form-grid {
  gap: 22px 24px;
}

.form-field,
.form-field-group,
.rm-field,
.tasting-input-group {
  gap: 8px;
}

.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select,
.form-field textarea,
.rm-field input:not([type="checkbox"]):not([type="radio"]),
.rm-field select,
.rm-field textarea,
.form-input-line,
.form-textarea-line {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: 0;
  background-color: var(--surface);
  color: var(--text-main);
  font-family: var(--font--sans);
  font-size: 16px;
  line-height: 1.45;
  box-shadow: none;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.form-field textarea,
.rm-field textarea,
.form-textarea-line {
  min-height: 132px;
  padding: 14px 16px;
  resize: vertical;
}

.form-field input:not([type="checkbox"]):not([type="radio"]):hover,
.form-field select:hover,
.form-field textarea:hover,
.rm-field input:not([type="checkbox"]):not([type="radio"]):hover,
.rm-field select:hover,
.rm-field textarea:hover,
.form-input-line:hover,
.form-textarea-line:hover {
  border-color: var(--text-light);
}

.form-field input::placeholder,
.form-field textarea::placeholder,
.rm-field input::placeholder,
.rm-field textarea::placeholder,
.form-input-line::placeholder,
.form-textarea-line::placeholder {
  color: var(--text-light);
  opacity: 1;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.rm-field input:not([type="checkbox"]):not([type="radio"]):focus,
.rm-field select:focus,
.rm-field textarea:focus,
.form-input-line:focus,
.form-textarea-line:focus {
  outline: none;
  border-color: var(--swatch--brand);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px var(--swatch--brand-subtle);
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible,
.rm-field input:not([type="checkbox"]):not([type="radio"]):focus-visible,
.rm-field select:focus-visible,
.rm-field textarea:focus-visible,
.form-input-line:focus-visible,
.form-textarea-line:focus-visible {
  outline: 2px solid var(--swatch--brand);
  outline-offset: 2px;
}

.form-field input:disabled,
.form-field select:disabled,
.form-field textarea:disabled,
.rm-field input:disabled,
.rm-field select:disabled,
.rm-field textarea:disabled {
  color: var(--text-light);
  background-color: var(--surface-warm);
  cursor: not-allowed;
}

.form-field input[type="number"] {
  -moz-appearance: textfield;
}

.form-field input[type="number"]::-webkit-outer-spin-button,
.form-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-field input[type="date"],
.rm-field input[type="date"] {
  color-scheme: light;
}

.form-field input:-webkit-autofill,
.form-field input:-webkit-autofill:hover,
.form-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-main);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--text-main);
}

/* ---------- labels ---------- */

.form-field > label,
.form-field legend,
.rm-field > label,
.form-label,
.tasting-input-group label {
  font-family: var(--font--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-field .optional,
.rm-field .optional {
  font-family: var(--font--sans);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-light);
}

.form-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

/* ---------- select ---------- */

.form-field select,
.rm-field select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 48px 0 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23181716' stroke-width='1.5' stroke-linecap='square' fill='none'/%3E%3C/svg%3E");
  background-position: right 17px center;
  background-size: 12px 8px;
  background-repeat: no-repeat;
  background-color: var(--surface);
  cursor: pointer;
}

.form-field select:hover,
.rm-field select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23c02d2d' stroke-width='1.5' stroke-linecap='square' fill='none'/%3E%3C/svg%3E");
  border-color: var(--swatch--brand);
}

.form-field select:focus,
.rm-field select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23c02d2d' stroke-width='1.5' stroke-linecap='square' fill='none'/%3E%3C/svg%3E");
}

/* ---------- checkbox ---------- */

.form-field input[type="checkbox"],
.form-field-group input[type="checkbox"],
.form-consent input[type="checkbox"],
.form-consent-row input[type="checkbox"],
.rm-field input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin: 1px 0 0;
  padding: 0;
  border: 1px solid var(--text-light);
  border-radius: 2px;
  background-color: var(--surface);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 12px 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input[type="checkbox"]:hover,
.form-consent input[type="checkbox"]:hover,
.form-consent-row input[type="checkbox"]:hover,
.rm-field input[type="checkbox"]:hover {
  border-color: var(--swatch--brand);
}

.form-field input[type="checkbox"]:checked,
.form-consent input[type="checkbox"]:checked,
.form-consent-row input[type="checkbox"]:checked,
.rm-field input[type="checkbox"]:checked {
  border-color: var(--swatch--brand);
  background-color: var(--swatch--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1 5L4.5 8.5L11 1.5' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
}

.rm-field input[type="checkbox"].is-invalid,
.form-field.has-error input[type="checkbox"] {
  border-color: var(--swatch--brand);
  box-shadow: 0 0 0 3px var(--swatch--brand-subtle);
}

.form-field input[type="checkbox"]:checked:hover,
.form-consent input[type="checkbox"]:checked:hover,
.form-consent-row input[type="checkbox"]:checked:hover,
.rm-field input[type="checkbox"]:checked:hover {
  background-color: var(--swatch--brand-hover);
  border-color: var(--swatch--brand-hover);
}

.form-field input[type="checkbox"]:focus-visible,
.form-consent input[type="checkbox"]:focus-visible,
.form-consent-row input[type="checkbox"]:focus-visible,
.rm-field input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--swatch--brand);
  outline-offset: 2px;
}

.form-consent {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  cursor: pointer;
}

.form-consent.has-error input[type="checkbox"] {
  border-color: var(--swatch--brand);
  outline: 2px solid var(--swatch--brand-subtle);
  outline-offset: 2px;
}

.form-consent-row {
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.form-consent label {
  font-family: var(--font--sans);
  font-size: inherit;
  font-weight: 400;
  letter-spacing: 0;
  line-height: inherit;
  text-transform: none;
  color: inherit;
  cursor: pointer;
}

.form-consent a,
.form-consent-row a {
  color: var(--text-main);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.form-consent a:hover,
.form-consent-row a:hover {
  color: var(--swatch--brand);
}

.form-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-light);
}

.form-error {
  font-size: 12px;
  line-height: 1.45;
  color: var(--swatch--brand-hover);
}

/* ---------- chips ---------- */

.cliff-choice-group,
.form-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.form-fieldset .cliff-choice-group {
  margin-top: 0;
}

.cliff-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--text-main);
  font-family: var(--font--sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.cliff-choice::before {
  content: "";
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--text-light);
  border-radius: 2px;
  background-color: var(--surface);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 11px 9px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cliff-choice input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.cliff-choice:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

.cliff-choice:hover::before {
  border-color: var(--text-main);
}

.cliff-choice:has(input:checked) {
  border-color: var(--swatch--brand);
  background-color: var(--swatch--brand-subtle);
  color: var(--swatch--brand-hover);
}

.cliff-choice:has(input:checked)::before {
  border-color: var(--swatch--brand);
  background-color: var(--swatch--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='9' viewBox='0 0 11 9'%3E%3Cpath d='M1 4.5L4 7.5L10 1' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
}

.cliff-choice:has(input:focus-visible) {
  outline: 2px solid var(--swatch--brand);
  outline-offset: 2px;
}

/* ---------- dark tasting form ---------- */

.tasting-form .tasting-input-group {
  gap: 6px;
}

.tasting-input-group label {
  color: var(--text-dark-faint);
}

.tasting-input,
.tasting-select {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border: 1px solid var(--hairline-dark-strong);
  border-radius: 0;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-dark-theme);
  font-family: var(--font--sans);
  font-size: 15px;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.tasting-input:hover,
.tasting-select:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background-color: rgba(255, 255, 255, 0.08);
}

.tasting-input::placeholder {
  color: var(--text-dark-faint);
  opacity: 1;
}

.tasting-input:focus,
.tasting-select:focus {
  border-color: var(--swatch--brand-bright);
  background-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px var(--swatch--brand-glow);
}

.tasting-input:focus-visible,
.tasting-select:focus-visible {
  outline: 2px solid var(--swatch--brand-bright);
  outline-offset: 2px;
}

.tasting-input[type="date"] {
  color-scheme: dark;
}

.tasting-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 44px 0 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23f7f6f2' stroke-width='1.5' stroke-linecap='square' fill='none'/%3E%3C/svg%3E");
  background-position: right 16px center;
  background-size: 12px 8px;
  background-repeat: no-repeat;
  background-color: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.tasting-select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23d93838' stroke-width='1.5' stroke-linecap='square' fill='none'/%3E%3C/svg%3E");
}

.tasting-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23d93838' stroke-width='1.5' stroke-linecap='square' fill='none'/%3E%3C/svg%3E");
}

.tasting-select option {
  background: var(--charcoal-900);
  color: var(--text-dark-theme);
}

/* ---------- responsive ---------- */

@media (max-width: 620px) {
  .form-field input:not([type="checkbox"]):not([type="radio"]),
  .form-field select,
  .form-field textarea,
  .rm-field input:not([type="checkbox"]):not([type="radio"]),
  .rm-field select,
  .rm-field textarea,
  .form-input-line,
  .form-textarea-line {
    font-size: 16px;
  }

  .cliff-choice {
    width: 100%;
    justify-content: flex-start;
  }
}
