/* Drop Hint — embeddable editor (iframe) */
:root {
  --bg-page: #eef1fb;
  --navy: #0504aa;
  --navy-hover: #04038a;
  --pink-accent: #ff61d0;
  --pink-soft: #fdecec;
  --white: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b6b80;
  --border: #e2e6f0;
  --shadow-card: 0 18px 50px rgba(5, 4, 90, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --font-ui: "Poppins", system-ui, sans-serif;
  --editor-width: 320px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body.embed {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-page);
}

.embed__workspace {
  --hint-card-height: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 1.25rem;
  padding: 1rem;
  max-width: 1120px;
  margin: 0 auto;
}

/* Main hint card */
.hint-card {
  flex: 1 1 560px;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-height: 480px;
}

.hint-card__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
}

@media (max-width: 820px) {
  .hint-card__inner {
    grid-template-columns: 1fr;
  }
}

.hint-preview {
  --preview-font: "Poppins", sans-serif;
  --preview-size: 14px;
  --preview-weight: 400;
  --preview-color: #1a1a2e;
  --preview-align: center;
  display: flex;
  flex-direction: column;
  padding: 0 1.25rem 1.5rem;
  background: var(--preview-column-bg, var(--pink-soft));
  border-right: 1px solid var(--border);
  font-family: var(--preview-font);
  font-size: var(--preview-size);
  font-weight: var(--preview-weight);
  color: var(--preview-color);
  text-align: var(--preview-align);
  transition: background 0.2s, color 0.2s;
}

@media (max-width: 820px) {
  .hint-preview {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

.hint-preview__brand {
  margin: 0 -1.25rem 0.75rem;
  padding: 1rem 1.25rem;
  background: color-mix(in srgb, var(--preview-column-bg, var(--pink-soft)) 70%, white);
  text-align: center;
}

.hint-preview__logo-wrap {
  margin: 0 auto;
  width: var(--logo-scale, 100%);
  max-width: 100%;
}

.logo-image-trigger {
  display: block;
  width: 100%;
  padding: 0.25rem;
  margin: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  box-shadow: 0 0 0 2px transparent;
  transition: box-shadow 0.2s, transform 0.15s;
}

.logo-image-trigger:hover {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--navy) 25%, transparent);
}

.logo-image-trigger:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.hint-preview__logo-img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.logo-reset-btn {
  display: block;
  width: 100%;
  margin: -0.35rem 0 1rem;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.logo-reset-btn:hover {
  color: var(--navy);
  background: color-mix(in srgb, var(--pink-soft) 50%, transparent);
}

.hint-preview__copy {
  text-align: inherit;
}

.hint-preview__line {
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.hint-preview__message {
  min-height: 3rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  line-height: 1.5;
  outline: none;
  text-align: inherit;
}

.hint-preview__message:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  opacity: 0.65;
  pointer-events: none;
}

.hint-preview__figure {
  margin: 0 auto 0.75rem;
  width: var(--img-scale, 72%);
  max-width: 100%;
}

.product-image-trigger {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  box-shadow: 0 0 0 2px transparent;
  transition: box-shadow 0.2s, transform 0.15s;
}

.product-image-trigger:hover {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--navy) 25%, transparent);
}

.product-image-trigger:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.hint-preview__figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  object-fit: cover;
  aspect-ratio: 1;
}

.hint-preview__meta {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hint-preview__psst {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

/* Form column */
.hint-form-wrap {
  position: relative;
  padding: 1.5rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  background: var(--white);
}

.hint-form__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.hint-form__close:hover {
  background: var(--pink-soft);
  color: var(--navy);
}

.hint-form__title {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  color: var(--navy);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.hint-form {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.field {
  position: relative;
  display: block;
  margin-bottom: 0.5rem;
}

.field__label {
  position: absolute;
  left: 0;
  top: 1.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: transform 0.2s, font-size 0.2s, color 0.2s;
  transform-origin: left top;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 1.35rem 0 0.5rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--navy);
}

.field input:focus + .field__label,
.field input:not(:placeholder-shown) + .field__label,
.field textarea:focus + .field__label,
.field textarea:not(:placeholder-shown) + .field__label {
  transform: translateY(-0.55rem) scale(0.78);
  color: var(--navy);
}

.field--textarea textarea {
  min-height: 4.5rem;
}

.hint-form__submit {
  margin-top: 1rem;
  width: 100%;
  padding: 0.9rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cta-color, #c45c6a);
  background: var(--cta-bg, var(--pink-soft));
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.hint-form__submit #sendBtnReceiver {
  font-weight: 700;
}

.hint-form__submit:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.hint-form__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 97, 208, 0.2);
}

.hint-form__legal {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.7rem;
}

.hint-form__legal a {
  color: var(--text-muted);
}

.hint-form__legal a:hover {
  color: var(--navy);
}

/* Content editor sidebar — height locked to hint card (modal) */
.content-editor {
  flex: 0 0 var(--editor-width);
  width: var(--editor-width);
  max-width: var(--editor-width);
  height: var(--hint-card-height);
  max-height: var(--hint-card-height);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.content-editor__title {
  flex-shrink: 0;
  margin: 0;
  padding: 1rem 1.15rem 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
}

.content-editor__body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem 1.15rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.content-editor__body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.content-editor__disclaimer {
  flex-shrink: 0;
  margin: 0;
  padding: 0.75rem 1.15rem 1rem;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--pink-soft) 55%, white);
  border-top: 1px solid var(--border);
}

.content-editor__subtitle {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
}

.content-editor__hint {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.content-editor__hint--toolbar {
  margin-top: -0.35rem;
}

.text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  padding: 0.45rem 0.55rem;
  background: var(--white);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(5, 4, 90, 0.06);
}

.text-toolbar.is-disabled {
  opacity: 0.55;
}

.toolbar-btn--icon,
.align-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn--icon svg,
.align-btn--icon svg {
  display: block;
}

.toolbar-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  font-family: inherit;
  font-size: 0.8rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
}

.toolbar-btn:hover:not(:disabled) {
  background: var(--pink-soft);
}

.toolbar-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.toolbar-divider {
  width: 1px;
  height: 1.25rem;
  background: var(--border);
  margin: 0 0.15rem;
}

.editor-panel {
  display: block;
}

.editor-panel[hidden] {
  display: none !important;
}

.editor-panel__back {
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.45rem 0.5rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--navy);
  text-align: left;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fafbff;
  cursor: pointer;
}

.editor-panel__back:hover {
  background: var(--pink-soft);
  border-style: solid;
}

.control--upload {
  margin-bottom: 1rem;
}

.btn-upload {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  background: var(--navy);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.btn-upload:hover {
  background: var(--navy-hover);
}

.btn-upload__icon {
  font-size: 1.1rem;
  line-height: 1;
}

.thumb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.thumb-grid__btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #f0f0f5;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.thumb-grid__btn:hover {
  border-color: color-mix(in srgb, var(--navy) 35%, var(--border));
}

.thumb-grid__btn.is-selected {
  border-color: var(--navy);
  box-shadow: 0 4px 14px rgba(5, 4, 170, 0.2);
}

.thumb-grid__btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-editor__sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.control {
  margin-bottom: 1rem;
}

.control__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.control__hint {
  font-weight: 600;
  color: var(--navy);
}

.control__select,
.control__text {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbff;
}

.control__text:focus,
.control__select:focus {
  outline: 2px solid color-mix(in srgb, var(--navy) 25%, transparent);
  border-color: var(--navy);
}

.control--stepper .stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stepper__btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--navy);
}

.stepper__btn:hover {
  background: var(--pink-soft);
}

.stepper__input {
  width: 3.5rem;
  padding: 0.35rem;
  text-align: center;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.stepper__suffix {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.control--color {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.control--color .control__label {
  margin: 0;
  flex: 1;
}

.control--color input[type="color"] {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}

.control--color input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.control--color input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.control--color input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

.control input[type="range"] {
  width: 100%;
  accent-color: var(--navy);
}

.control--align .align-group {
  display: flex;
  gap: 0.35rem;
}

.align-btn {
  flex: 1;
  min-height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}

.align-btn:hover {
  background: var(--pink-soft);
}

.align-btn.is-active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

@media (max-width: 900px) {
  .content-editor {
    flex: 1 1 100%;
    width: 100%;
    max-width: 720px;
    /* height still follows --hint-card-height from JS */
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  padding: 0.75rem 1.25rem;
  background: var(--navy);
  color: var(--white);
  font-size: 0.875rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  transition: transform 0.35s ease;
  z-index: 50;
  max-width: min(90vw, 360px);
  text-align: center;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.35);
  backdrop-filter: blur(4px);
}

.modal__panel {
  position: relative;
  width: min(100%, 400px);
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.modal__title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--navy);
}

.modal__text {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

.modal__btn {
  width: 100%;
  padding: 0.65rem;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  background: var(--navy);
  color: var(--white);
  cursor: pointer;
}

.modal__btn:hover {
  background: var(--navy-hover);
}
