﻿/* Recipe UI ownership: Controls. Responsive rules stay with this owner. */

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="url"],
input[type="search"],
select,
textarea {
  font-family: var(--font-sans);
  font-size: var(--recipe-font-working);
  padding: 0.5rem 0.65rem;
  border: 1.5px solid var(--line);
  border-radius: var(--recipe-radius-medium);
  background: var(--recipe-surface);
  color: var(--ink);
  transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: var(--recipe-shadow-focus);
  background: var(--paper);
}

input[type="text"]:hover:not(:focus),
input[type="number"]:hover:not(:focus),
input[type="date"]:hover:not(:focus),
input[type="email"]:hover:not(:focus),
input[type="url"]:hover:not(:focus),
input[type="search"]:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
  border-color: var(--line-strong);
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

select {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
  appearance: none;
}

.form-grid { display: grid; gap: 0.75rem; }

.form-grid .field { display: flex; flex-direction: column; gap: 0.2rem; }

.form-grid label,
.form-grid .field-label {
  font-weight: 600;
  font-size: var(--recipe-font-working);
  font-family: var(--font-serif);
}

.inline-pair { display: flex; gap: 0.75rem; flex-wrap: nowrap; align-items: flex-start; }

.inline-pair .field { flex: 0 0 5rem; max-width: 5rem; }

.inline-pair .field label { white-space: normal; font-size: var(--recipe-font-control); line-height: 1.1; }

.inline-pair input[name$="-prep_time_mins"], .inline-pair input[name$="-cook_time_mins"], .inline-pair input[name$="-total_time_mins"], .inline-pair input[name$="-recipe_yield_display"] { width: 4rem; }

.inline-pair.wide-fields { flex-wrap: wrap; }

.inline-pair.wide-fields .field { flex: 1 1 180px; max-width: none; }

.inline-pair.date-row { align-items: flex-start; gap: 0.85rem; }

.inline-pair.date-row .field { min-width: 0; }

.inline-pair.date-row input[type="date"] {
  min-height: 42px;
  padding: 0.5rem 0.65rem;
  border: 1.5px solid var(--line);
  border-radius: var(--recipe-radius-large);
  font-size: var(--recipe-font-working);
  background: var(--recipe-surface);
  color: var(--ink);
  width: 100%;
}

.inline-pair.date-row input[type="date"]:focus {
  border-color: var(--ink);
  box-shadow: var(--recipe-shadow-focus);
}

.inline-pair.date-row input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.85;
  filter: sepia(14%) saturate(140%);
}

.field-with-help .label-row { display:flex; align-items:center; gap:0.35rem; }

.field-with-help .help-icon { margin-left:auto; }

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: var(--recipe-radius-status);
  background: var(--gray-2);
  color: var(--ink);
  font-size: var(--recipe-font-metadata);
  font-weight: 700;
  cursor: help;
  position: relative;
}

.help-icon::before { content: "i"; }

.help-icon::after { content: attr(data-help); position: absolute; top: 50%; left: calc(100% + 8px); transform: translateY(-50%); background: var(--ink); color: var(--paper); padding: 0.35rem 0.5rem; border-radius: var(--recipe-radius-medium); border: 1px solid var(--ink-2); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 120ms ease; z-index: 20; box-shadow: var(--recipe-shadow-overlay); }

.help-icon:hover::after { opacity: 1; }

.btn-reset,
.btn-create {
  display: inline-block;
  background: var(--ink);
  color: var(--recipe-surface);
  border: 1px solid var(--ink);
  border-radius: var(--recipe-radius-large);
  padding: 0.65rem 1.25rem;
  font-weight: 700;
  font-family: var(--font-serif);
  font-size: var(--recipe-font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all 200ms ease;
  box-shadow: var(--recipe-shadow-overlay);
}

.btn-reset:hover,
.btn-create:hover {
  background: var(--ink-2);
  transform: translateY(-2px);
  box-shadow: var(--recipe-shadow-overlay);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: var(--recipe-control-default);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--recipe-line-strong);
  border-radius: var(--recipe-radius-small);
  background: transparent;
  color: var(--recipe-ink);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--recipe-font-control);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background-color var(--recipe-motion-fast) var(--ease), border-color var(--recipe-motion-fast) var(--ease), box-shadow var(--recipe-motion-fast) var(--ease);
}

.btn-sm {
  min-height: var(--recipe-control-compact);
  padding: var(--s-1) var(--s-3);
  font-size: var(--recipe-font-compact);
}

.btn-primary {
  border-color: var(--recipe-ink);
  background: var(--recipe-ink);
  color: var(--recipe-surface);
  font-weight: 700;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--paint-1);
  opacity: 0.15;
  border-radius: var(--recipe-radius-status);
  pointer-events: none;
}

.btn-dashed {
  width: 100%;
  border-style: dashed;
}

.btn-dashed::before {
  display: none;
}

.btn-toolbar {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-toolbar.text-sm { font-size: var(--recipe-font-control); }

.btn-toolbar.text-xs { font-size: var(--recipe-font-metadata); }

.btn-add-text {
  margin-left: 0.5rem;
  font-weight: normal;
}

.btn-primary:hover {
  border-color: var(--ink-2);
  background: var(--ink-2);
  color: var(--recipe-surface);
  box-shadow: var(--recipe-shadow-surface);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--recipe-line-strong);
  background: var(--recipe-surface-muted);
  box-shadow: var(--recipe-shadow-surface);
}

.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-accent, .btn-buy, .btn-print {
  border-color: var(--ink);
}

.btn-accent:hover, .btn-buy:hover, .btn-print:hover {
  background: color-mix(in srgb, var(--recipe-ink) 3%, transparent);
  border-color: color-mix(in srgb, var(--recipe-ink) 28%, transparent);
  transform: translateY(-1px);
  box-shadow: var(--recipe-shadow-overlay);
}

.btn:active {
  transform: translateY(1px);
  background: color-mix(in srgb, var(--recipe-ink) 5%, transparent);
}

.btn:focus-visible {
  outline: var(--recipe-focus-ring);
  outline-offset: var(--recipe-focus-offset);
}

.summary-quick-actions .btn-sm {
  padding: 0.3rem 0.55rem;
  font-size: var(--recipe-font-compact);
}

.action-buttons { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.tab-button {
  border: 1.5px solid var(--line);
  border-radius: var(--recipe-radius-large);
  background: var(--paper);
  box-shadow: var(--recipe-shadow-surface);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--recipe-font-subheading);
  color: var(--charcoal);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 140ms ease;
  text-align: left;
  min-width: 0;
}

.tab-button:hover {
  border-color: var(--line-strong);
  box-shadow: var(--recipe-shadow-overlay);
  transform: translateY(-1px);
}

.tab-button.active {
  border-color: var(--ink);
  box-shadow: var(--recipe-shadow-overlay);
  background: var(--gray-1);
}

.tab-button.active .tab-chevron {
  transform: rotate(180deg);
}

input.server-error,
select.server-error,
textarea.server-error {
  border-color: var(--recipe-danger);
  box-shadow: var(--recipe-shadow-focus);
}

.btn.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: var(--recipe-radius-status);
  border: 2px solid color-mix(in srgb, var(--recipe-ink) 20%, transparent);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.btn-grid-compact { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }

.btn-xs { padding: 0.3rem 0.4rem; font-size: var(--recipe-font-compact); justify-content: center; }

#menu-recipe-search-form .menu-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#menu-load-menu-form .menu-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

textarea.auto-resize {
  overflow: hidden;
}

@media (min-width: 769px) and (max-width: 1100px) {
.btn-dashed {
    min-height: 44px;
    font-size: var(--recipe-font-working);
  }

.inline-pair.wide-fields .field {
    flex: 1 1 45%;
  }

.inline-pair.date-row {
    flex-wrap: wrap;
  }

.inline-pair.date-row .field {
    flex: 1 1 45%;
  }
}

@media (max-width: 768px) {
.btn-dashed {
    min-height: 48px;
    font-size: var(--recipe-font-body);
    width: 100%;
  }

.inline-pair.wide-fields .field {
    flex: 1 1 100%;
  }

.inline-pair.date-row {
    flex-wrap: wrap;
  }

.inline-pair.date-row .field {
    flex: 1 1 100%;
  }

.page-builder .btn-dashed {
    min-height: 40px;
    padding-block: 0.35rem;
  }
}
@media (max-width: 768px) {
  .recipe-app a.btn {
    min-height: var(--recipe-control-touch);
  }
}
