/*
 * Creator operation form manner.
 *
 * Shared presentation for Creator create/edit flows. Domain validation,
 * persistence and capability checks stay in each feature implementation.
 */

body.fanika-creator-operation-form {
  background: var(--fanika-creator-operation-canvas, #eef6fc) !important;
  background-image: none !important;
}

/* Only Organizer plan editing opts into the Foundation canvas.
 * Other accepted Creator create/edit screens retain their existing background. */
body.fanika-organizer-plan-edit {
  --fanika-creator-operation-canvas: var(--fanika-ui-page-background, #edf7fe);
}

/* Organizer plan editor only: use the management content width rather than
 * the Creator operation form's 860px layout. Preserve all field behavior. */
body.fanika-creator-operation-form.fanika-organizer-plan-edit .creator-operation-form-page.pm-form-page {
  width: min(calc(100% - 32px), var(--fanika-ui-content-max, 1080px));
  max-width: var(--fanika-ui-content-max, 1080px) !important;
}
body.fanika-organizer-plan-edit .fanika-shared-back-navigation {
  margin: 12px auto 96px;
}
/* Remove the Creator form's 96px bottom clearance only on Organizer edit.
 * Back then follows immediately after the last form box. */
body.fanika-creator-operation-form.fanika-organizer-plan-edit .creator-operation-form-page.pm-form-page {
  padding-bottom: 0;
}
@media (max-width: 767px) {
  body.fanika-creator-operation-form.fanika-organizer-plan-edit .creator-operation-form-page.pm-form-page {
    width: min(calc(100% - 16px), var(--fanika-ui-content-max, 1080px));
  }
}

body.fanika-creator-operation-form::before {
  display: none !important;
}

body.fanika-creator-operation-form .site-content,
body.fanika-creator-operation-form .entry-content {
  background: transparent;
}

body.fanika-creator-operation-form .creator-operation-form-page.pm-form-page {
  width: min(calc(100% - 32px), 860px);
  max-width: 860px !important;
  margin-inline: auto;
  padding: 16px 0 96px;
  background: transparent !important;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none !important;
}

.creator-operation-form-page .pm-form-title {
  margin: 0;
  color: var(--fanika-ui-text, #1f2937);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.3;
}

.creator-operation-form-page .pm-form-section {
  padding: 4px 20px;
  border: 1px solid #e5ebf2;
  border-radius: var(--fanika-ui-card-radius, 16px);
  background: #fff;
  box-shadow: 0 7px 22px rgba(50, 78, 108, 0.045);
}

.creator-operation-form-page .pm-form-section .pm-form-field {
  padding-block: 18px;
  border-bottom-color: #edf0f4;
}

.creator-operation-form-page .pm-form-field > label:first-child,
.creator-operation-form-page .pm-form-field > .checkbox-label {
  color: #263449;
  font-size: 0.9rem;
  font-weight: 800;
}

.creator-operation-form-page .pm-form-field input[type="text"],
.creator-operation-form-page .pm-form-field input[type="url"],
.creator-operation-form-page .pm-form-field input[type="number"],
.creator-operation-form-page .pm-form-field input[type="email"],
.creator-operation-form-page .pm-form-field input[type="date"],
.creator-operation-form-page .pm-form-field input[type="datetime-local"],
.creator-operation-form-page .pm-form-field textarea,
.creator-operation-form-page .pm-form-field select {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid #d8e1ea;
  border-radius: 10px;
  background: #fff;
  color: var(--fanika-ui-text, #1f2937);
  font: inherit;
}

.creator-operation-form-page .pm-form-field input[type="text"],
.creator-operation-form-page .pm-form-field input[type="url"],
.creator-operation-form-page .pm-form-field input[type="number"],
.creator-operation-form-page .pm-form-field input[type="email"],
.creator-operation-form-page .pm-form-field input[type="date"],
.creator-operation-form-page .pm-form-field input[type="datetime-local"],
.creator-operation-form-page .pm-form-field select {
  padding: 9px 11px;
}

.creator-operation-form-page .pm-form-field textarea {
  padding: 11px;
  resize: vertical;
}

.creator-operation-form-page .pm-form-field input:focus,
.creator-operation-form-page .pm-form-field textarea:focus,
.creator-operation-form-page .pm-form-field select:focus {
  border-color: var(--fanika-ui-accent, #ec4899);
  outline: 3px solid rgba(236, 72, 153, 0.12);
  outline-offset: 1px;
}

.creator-operation-form-page .pm-form-note,
.creator-operation-form-page .pm-form-field small {
  color: var(--fanika-ui-text-muted, #667085);
  line-height: 1.55;
}

.creator-operation-form-page .checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  margin-block: 8px !important;
  padding: 10px 12px;
  border: 1px solid #e1e8ef;
  border-radius: 10px;
  background: #f8fbff;
  font-weight: 600 !important;
}

.creator-operation-form-page .checkbox-label input[type="checkbox"] {
  margin-top: 3px;
}

.creator-operation-form-page .pm-upload-zone {
  padding: 28px 18px;
  border-color: #cddbea;
  border-radius: 12px;
  background: #f8fbff;
}

.creator-operation-form-page .pm-upload-zone:hover,
.creator-operation-form-page .pm-upload-zone:focus-within {
  border-color: var(--fanika-ui-accent, #ec4899);
  background: #fff8fb;
}

.creator-operation-form-page .pm-upload-zone i {
  color: var(--fanika-ui-accent, #ec4899);
}

.creator-operation-form-page .pm-form-actions {
  justify-content: flex-end;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #e5ebf2;
  border-radius: var(--fanika-ui-card-radius, 16px);
  background: #fff;
  box-shadow: 0 7px 22px rgba(50, 78, 108, 0.04);
}

.creator-operation-form-page .pm-form-submit-btn,
.creator-operation-form-page .pm-form-secondary-btn,
.creator-operation-form-page .pm-form-preview-btn {
  min-height: 42px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.creator-operation-form-page .pm-form-submit-btn {
  border: 1px solid var(--fanika-ui-accent, #ec4899);
  background: var(--fanika-ui-accent, #ec4899);
  color: #fff;
}

.creator-operation-form-page .pm-form-submit-btn:hover,
.creator-operation-form-page .pm-form-submit-btn:focus-visible {
  border-color: #db2777;
  background: #db2777;
}

.creator-operation-form-page .pm-form-secondary-btn,
.creator-operation-form-page .pm-form-preview-btn {
  border: 1px solid #d8e1ea;
  background: #fff;
  color: #344054;
}

.creator-operation-form-page .pm-form-secondary-btn:hover,
.creator-operation-form-page .pm-form-secondary-btn:focus-visible,
.creator-operation-form-page .pm-form-preview-btn:hover,
.creator-operation-form-page .pm-form-preview-btn:focus-visible {
  border-color: #b8c5d3;
  background: #f8fbff;
  color: #263449;
}

.creator-operation-form-page .purimall-edit-message,
.creator-operation-form-page .purimall-edit-error {
  margin-bottom: 12px;
  border-radius: 12px;
}

.creator-operation-form-page .purimall-edit-message {
  border-color: #b7e3ca;
  background: #f0fbf5;
}

.creator-operation-form-page .purimall-edit-error {
  border-color: #f2b8bd;
  background: #fff4f5;
}

.creator-operation-form-page .pm-form-back-button {
  border: 1px solid #d8e1ea;
  border-radius: 999px;
  background: #fff;
  color: #344054;
}

.creator-operation-form-page .pm-form-back-button i {
  color: var(--fanika-ui-accent, #ec4899);
}

.creator-operation-form-page .pm-form-back-button:hover,
.creator-operation-form-page .pm-form-back-button:focus-visible {
  background: #fff8fb;
  color: var(--fanika-ui-accent, #ec4899);
}

@media (max-width: 767px) {
  body.fanika-creator-operation-form .creator-operation-form-page.pm-form-page {
    width: min(calc(100% - 16px), 860px);
    max-width: none !important;
    padding-block: 10px 80px;
  }

  .creator-operation-form-page .pm-form-section {
    padding: 2px 12px;
    border-radius: 14px;
  }

  .creator-operation-form-page .pm-form-section .pm-form-field {
    padding-block: 14px;
  }

  .creator-operation-form-page .pm-upload-zone {
    padding: 22px 12px;
  }

  .creator-operation-form-page .pm-upload-zone p {
    font-size: 0.88rem;
  }

  .creator-operation-form-page .pm-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 14px;
  }

  .creator-operation-form-page .pm-form-submit-btn,
  .creator-operation-form-page .pm-form-secondary-btn,
  .creator-operation-form-page .pm-form-preview-btn {
    width: 100%;
    min-width: 0;
    padding-inline: 12px;
  }
}

@media (max-width: 359px) {
  .creator-operation-form-page .pm-form-actions {
    grid-template-columns: 1fr;
  }
}


/* Organizer proxy-create context: keep the canonical form runtime, but present it as an Organizer child surface. */
.fanika-organizer-operation-page{
  width:min(calc(100% - 32px),1080px)!important;
  max-width:1080px!important;
  margin-inline:auto!important;
}
.fanika-organizer-operation-page .fanika-creator-child-breadcrumb{
  margin-bottom:10px;
}
.fanika-organizer-operation-page .fanika-creator-child-breadcrumb a{
  color:#b52c70;
  font-weight:800;
}
.fanika-organizer-operation-page .fanika-creator-child-heading{
  margin-bottom:12px;
  padding:14px 16px;
  border:1px solid #e5ebf2;
  border-radius:15px;
  background:#fff;
  box-shadow:0 5px 16px rgba(50,78,108,.035);
}
.fanika-organizer-operation-page .fanika-creator-child-heading__eyebrow{
  color:#db2777;
}
.fanika-organizer-operation-page .agent-author-select-section{
  border-color:#f0d6e2!important;
  background:#fff8fb!important;
}
.fanika-organizer-operation-page #product_author_select{
  border-color:#e8bfd2!important;
  background:#fff8fb!important;
}
@media(max-width:767px){
  .fanika-organizer-operation-page{
    width:min(calc(100% - 16px),1080px)!important;
  }
  .fanika-organizer-operation-page .fanika-creator-child-heading{
    padding:12px;
    border-radius:14px;
  }
}

/* QA-083: coupon audience preview, visually interactive but not persisted. */
.fanika-plan-coupon-preview__plans {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid #e5ebf2;
  border-radius: 10px;
  background: #fff;
}
.fanika-plan-coupon-preview__plans[hidden] { display: none !important; }
.fanika-plan-coupon-preview__plans-title {
  display: block;
  margin-bottom: 9px;
  font-weight: 700;
}
.fanika-plan-coupon-preview__plan-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.fanika-plan-coupon-preview__plan-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.fanika-plan-coupon-preview__plan-option input[type="checkbox"] { width: auto; }
@media (max-width: 767px) {
  .fanika-plan-coupon-preview__plan-options { grid-template-columns: 1fr; }
}

/* QA-083 coupon preview base layout on standalone add/edit routes. */
.fanika-plan-coupon-preview {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #e5ebf2;
  border-radius: 12px;
  background: #f8fbff;
}
.fanika-plan-coupon-preview legend { padding: 0 8px; font-weight: 700; }
.fanika-plan-coupon-preview__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.fanika-plan-coupon-preview__fields > label { display: grid; gap: 6px; }
.fanika-plan-coupon-preview__fields input:not([type="checkbox"]),
.fanika-plan-coupon-preview__fields select { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 767px) {
  .fanika-plan-coupon-preview__fields { grid-template-columns: 1fr; }
}

/* QA-083 coupon schedule: start/end controls each take half the available row. */
.fanika-plan-coupon-preview__period {
  min-width: 0;
}
.fanika-plan-coupon-preview__period-title {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}
.fanika-plan-coupon-preview__period-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 8px;
}
.fanika-plan-coupon-preview__period-dates > label {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.fanika-plan-coupon-preview__period-dates input[type="date"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

/* Organizer plan creation only: management-width canvas, canonical pale-pink
 * header, and shared Back directly beneath the action box. */
body.fanika-creator-operation-form.fanika-organizer-plan-create {
  --fanika-creator-operation-canvas: var(--fanika-ui-page-background, #edf7fe);
}
body.fanika-creator-operation-form.fanika-organizer-plan-create .creator-plan-create-page.pm-form-page {
  width: min(calc(100% - 32px), var(--fanika-ui-content-max, 1080px));
  max-width: var(--fanika-ui-content-max, 1080px) !important;
  padding-bottom: 0;
}
body.fanika-organizer-plan-create .fanika-organizer-plan-create-header {
  background: linear-gradient(90deg, #fff5f9 0%, #fff 100%);
}
body.fanika-organizer-plan-create .fanika-shared-back-navigation {
  margin: 12px auto 96px;
}
@media(max-width:767px) {
  body.fanika-creator-operation-form.fanika-organizer-plan-create .creator-plan-create-page.pm-form-page {
    width: min(calc(100% - 16px), var(--fanika-ui-content-max, 1080px));
    padding-bottom: 0;
  }
}
