/* =========================
   FORMS / CONTACT PAGE
========================= */

.contact-page-shell {
  max-width: 760px;
}

.contact-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.contact-card h1 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #fff;
  font-size: 2rem;
}

.contact-intro {
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.65;
}

.privacy-note {
  background: rgba(255, 255, 255, 0.04);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 22px;
  color: #ddd6cd;
  line-height: 1.55;
}

.success-message,
.error-message {
  display: none;
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  line-height: 1.5;
}

.success-message {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.error-message {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}

.error-message a {
  color: #fff;
}

form {
  max-width: 900px;
}

.contact-form .form-group,
.edit-recipe-form .form-group {
  margin-bottom: 18px;
}

.contact-form label,
label {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-light);
  font-weight: 600;
}

.optional {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 400;
}

.required {
  color: #d87474;
}

input[type='text'],
input[type='password'],
input[type='number'],
input[type='url'],
input[type='email'],
textarea,
select {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

textarea {
  min-height: 170px;
  resize: vertical;
}

input[type='text']:focus,
input[type='password']:focus,
input[type='number']:focus,
input[type='url']:focus,
input[type='email']:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px rgba(215, 166, 106, 0.15);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-form button[type='submit'] {
  align-self: flex-start;
  margin-top: 0.25rem;
}

.edit-recipe-form textarea {
  min-height: 140px;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

#instructions_text,
#extra_sections_text {
  min-height: 260px;
}

#ingredients_text,
#notes_text {
  min-height: 180px;
}

.edit-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.image-upload-box,
.instruction-image-dropzone {
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.image-upload-box {
  margin-top: 8px;
  padding: 14px;
}

.edit-image-preview {
  margin-top: 12px;
}

.edit-image-preview img {
  display: block;
  max-width: 240px;
  max-height: 240px;
  border-radius: 8px;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px 18px;
}

button.button-link[disabled],
button.button-link:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Extra sections editor */
.extra-sections-editor .hidden {
  display: none;
}

.extra-sections-list {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.extra-sections-empty {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

.extra-section-editor-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(220px, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.extra-section-body-wrap,
.extra-section-actions {
  grid-column: 1 / -1;
}

.extra-section-editor-row label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.extra-section-body {
  min-height: 120px;
}

.extra-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 720px) {
  .extra-section-editor-row {
    grid-template-columns: 1fr;
  }
}

/* Import type selector on Add Recipe */
.import-type-selector {
  margin: 1rem 0 0;
  max-width: 760px;
}

.import-type-selector label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.import-type-row {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  max-width: 760px;
}

.import-type-row select {
  flex: 1 1 auto;
  min-width: 220px;
}

.import-type-row button {
  flex: 0 0 auto;
}

.import-type-selector .field-instruction {
  display: block;
  margin-top: 0.6rem;
}

@media (max-width: 640px) {
  .import-type-row {
    flex-direction: column;
    align-items: stretch;
  }

  .import-type-row button {
    width: 100%;
  }
}

/* Add Recipe import panel */
.import-recipe-action {
  text-align: center;
}

.add-recipe-import-panel-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem;
}

.add-recipe-import-panel {
  margin: 1rem auto 1.25rem;
  border-left: 4px solid var(--accent, #a66a32);
}

.import-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.import-panel-header h2 {
  margin: 0;
}

.import-panel-header p {
  margin: 0.35rem 0 0;
}

.import-panel-form {
  display: grid;
  gap: 1rem;
}

.import-panel-form textarea {
  min-height: 8rem;
}

.import-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 720px) {
  .import-panel-header {
    flex-direction: column;
  }

  .import-panel-header button,
  .import-panel-actions button,
  .import-panel-actions .button-link {
    width: 100%;
  }
}

/* Import duplicate handling */
.import-duplicate-choice {
  margin: 0.25rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(166, 106, 50, 0.38);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.025);
}

.import-duplicate-choice legend {
  color: var(--accent-light, #e1aa68);
  font-weight: 700;
  padding: 0 0.35rem;
}

.import-duplicate-choice .radio-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0.65rem 0;
  cursor: pointer;
}

.import-duplicate-choice .radio-row input {
  margin-top: 0.25rem;
}

.import-duplicate-choice .radio-row strong {
  display: block;
}

.import-duplicate-choice .radio-row small {
  display: block;
  margin-top: 0.15rem;
  opacity: 0.85;
  line-height: 1.35;
}

/* Native dropdown option menus often render on a light OS/browser popup
   even when the closed select control is dark. Force readable option text. */
select option {
  background: #ffffff;
  color: #1f1f1f;
}

select option:disabled {
  color: #777777;
}

/*
 * Forced account action warning
 *
 * Used when a user is logged in with a temporary password. This needs to be
 * much more visible than normal helper text because the user is intentionally
 * blocked from browsing until the password is changed.
 */
.forced-action-warning {
  background: #8a1f1f;
  border: 2px solid #ffb3b3;
  border-radius: 12px;
  color: #ffffff;
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 0 0 3px rgba(138, 31, 31, 0.2);
}

.forced-action-warning strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.forced-action-warning p {
  margin: 0.25rem 0 0;
}

.forced-action-warning a {
  color: #ffffff;
  font-weight: 700;
  text-decoration: underline;
}

/*
 * Site settings field layout
 *
 * Help text sits between the label and input so the explanation visually belongs
 * to the field it describes instead of drifting toward the next setting.
 */
.site-setting-field .edit-help {
  display: block;
  margin: 0.2rem 0 0.45rem;
  line-height: 1.35;
}

/*
 * Site settings uploads
 *
 * Upload controls live inside the path setting they update, so the owner can
 * either type a public path manually or upload a replacement file in the same
 * place.
 */
.site-setting-field .edit-help {
  display: block;
  margin: 0.2rem 0 0.45rem;
  line-height: 1.35;
}

.site-setting-upload-control {
  margin-top: 0.55rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border, #3a4248);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.site-setting-upload-control input[type='file'] {
  margin-top: 0.25rem;
}

/*
 * Inline branding image upload controls
 *
 * The path field remains editable, while Browse + Upload sit beside it because
 * the uploaded file fills that exact path setting.
 */
.site-setting-field .edit-help {
  display: block;
  margin: 0.2rem 0 0.45rem;
  line-height: 1.35;
}

.site-setting-path-upload-row {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
}

.site-setting-path-upload-row input[type='text'],
.site-setting-path-upload-row input[type='email'] {
  flex: 1 1 auto;
  min-width: 0;
}

.site-setting-file-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.site-setting-file-button,
.site-setting-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}

.site-setting-file-button {
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  background: var(--color-button-bg, #9b6633);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.site-setting-file-button:hover,
.site-setting-file-button:focus {
  filter: brightness(1.08);
}

.site-setting-file-name,
.site-setting-upload-status {
  display: block;
  margin-top: 0.25rem;
  color: var(--color-muted-text, #b8c0c7);
  font-size: 0.92rem;
}

.site-setting-upload-status.is-success {
  color: #9be29b;
}

.site-setting-upload-status.is-error {
  color: #ffb3b3;
}

@media (max-width: 800px) {
  .site-setting-path-upload-row {
    flex-direction: column;
    align-items: stretch;
  }

  .site-setting-file-button,
  .site-setting-upload-button {
    width: fit-content;
  }
}

/*
 * Site settings branding upload spacing
 *
 * Inline Browse/Upload belongs with the path field, but the helper/status text
 * needs breathing room so each setting reads as one complete group instead of
 * running into the next label.
 */
.site-settings-form .site-setting-field {
  margin-bottom: 1.35rem;
}

.site-settings-form .site-setting-field > label,
.site-settings-form .site-setting-checkbox-label {
  margin-bottom: 0.25rem;
}

.site-settings-form .site-setting-field > .edit-help {
  margin: 0.15rem 0 0.55rem;
}

.site-setting-path-upload-row {
  margin-top: 0.15rem;
}

.site-setting-upload-help {
  margin-top: 0.5rem;
  max-width: 720px;
}

.site-setting-file-name {
  margin-top: 0.3rem;
}

.site-setting-upload-status {
  margin-top: 0.2rem;
  font-weight: 700;
}

.site-setting-file-name + .site-setting-upload-status {
  margin-bottom: 0.15rem;
}

/* Give image/path settings a little extra separation because they have
   an input row, upload controls, selected filename, and upload status. */
.site-setting-app_logo_path,
.site-setting-app_favicon_path,
.site-setting-default_recipe_image {
  margin-bottom: 1.65rem;
}

/*
 * Inline branding upload button sizing/alignment.
 *
 * The row is center-aligned and the buttons are given the same visual height as
 * the path field. The -5px nudge is optical: native input border/text metrics
 * otherwise make the buttons look slightly low even when technically centered.
 */
.site-setting-path-upload-row {
  align-items: center;
}

.site-setting-path-upload-row .site-setting-file-button,
.site-setting-path-upload-row .site-setting-upload-button {
  height: 2.25rem;
  min-height: 0;
  padding: 0 0.75rem;
  line-height: 1;
  transform: translateY(-5px);
}

.site-setting-path-upload-row .site-setting-upload-button {
  align-self: center;
}
