/*
 * ideaForm — Frontend Styles
 * Black & White with Red (#DC2626) accents
 * Clean, tight, modern form aesthetic.
 */

/* ── Custom properties ──────────────────────────────────────────────────────── */
.ideaform-wrap {
  --idf-black:       #111111;
  --idf-white:       #FFFFFF;
  --idf-red:         #DC2626;
  --idf-red-dark:    #B91C1C;
  --idf-border:      #E2E2E2;
  --idf-bg-input:    #FFFFFF;
  --idf-label:       #111111;
  --idf-hint:        #888888;
  --idf-placeholder: #BBBBBB;
  --idf-radius:      3px;
  --idf-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --idf-transition:  0.16s ease;

  font-family: var(--idf-font);
  box-sizing: border-box;
  color: var(--idf-black);
}

.ideaform-wrap *,
.ideaform-wrap *::before,
.ideaform-wrap *::after {
  box-sizing: inherit;
}

/* ── Card ────────────────────────────────────────────────────────────────────── */
.ideaform-inner {
  background: var(--idf-white);
  border: 1px solid var(--idf-border);
  border-radius: var(--idf-radius);
  padding: 36px 40px 32px;
}

/* ── Two-column row ──────────────────────────────────────────────────────────── */
.idf-row {
  display: flex;
  gap: 16px;
}

.idf-row .idf-field.idf-half {
  flex: 1;
  min-width: 0;
}

/* ── Field container ─────────────────────────────────────────────────────────── */
.idf-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

/* ── Label ───────────────────────────────────────────────────────────────────── */
.idf-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--idf-black);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.idf-req {
  color: var(--idf-red);
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}

/* ── Input / Textarea / Select ───────────────────────────────────────────────── */
.ideaform input[type="text"],
.ideaform input[type="email"],
.ideaform input[type="tel"],
.ideaform input[type="url"],
.ideaform textarea,
.ideaform select {
  width: 100%;
  background: var(--idf-bg-input);
  border: 1px solid var(--idf-border);
  border-radius: var(--idf-radius);
  padding: 10px 13px;
  font-family: var(--idf-font);
  font-size: 14px;
  color: var(--idf-black);
  line-height: 1.4;
  outline: none;
  transition: border-color var(--idf-transition), box-shadow var(--idf-transition);
  appearance: none;
  -webkit-appearance: none;
}

.ideaform input::placeholder,
.ideaform textarea::placeholder {
  color: var(--idf-placeholder);
}

.ideaform input:focus,
.ideaform textarea:focus,
.ideaform select:focus {
  border-color: var(--idf-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.09);
}

/* Custom select arrow */
.ideaform select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.ideaform select option[value=""] {
  color: var(--idf-placeholder);
}

/* Textarea */
.ideaform textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* Validation error */
.ideaform input.idf-field-error,
.ideaform textarea.idf-field-error,
.ideaform select.idf-field-error {
  border-color: var(--idf-red);
  background-color: #FFF8F8;
}

/* ── Submit row ─────────────────────────────────────────────────────────────── */
.idf-submit-row {
  display: flex;
  margin-bottom: 0;
  margin-top: 8px;
}

/* ── Button ─────────────────────────────────────────────────────────────────── */
.idf-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--idf-red);
  color: var(--idf-white);
  border: none;
  border-radius: var(--idf-radius);
  padding: 12px 26px;
  font-family: var(--idf-font);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: background var(--idf-transition), transform var(--idf-transition);
  white-space: nowrap;
}

.idf-btn:hover:not(:disabled) {
  background: var(--idf-red-dark);
}

.idf-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.idf-btn:disabled,
.idf-btn.is-loading {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

/* Spinner */
.idf-btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: idf-spin 0.65s linear infinite;
  flex-shrink: 0;
}

.idf-btn.is-loading .idf-btn-spinner {
  display: block;
}

@keyframes idf-spin {
  to { transform: rotate(360deg); }
}

/* ── Helper text beneath the button ─────────────────────────────────────────── */
.idf-helper-text {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--idf-hint);
  line-height: 1.55;
}

/* ── Status message ─────────────────────────────────────────────────────────── */
.ideaform-message {
  margin-top: 16px;
  border-radius: var(--idf-radius);
  font-size: 14px;
  line-height: 1.55;
  display: none;
  padding: 14px 18px;
}

.ideaform-message.is-success {
  display: block;
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  color: #166534;
}

.ideaform-message.is-error {
  display: block;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
}

/* ── Compact variant (Newsletter + Resources) ────────────────────────────────── */
.ideaform--compact .ideaform-inner {
  padding: 28px 32px 24px;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media ( max-width: 640px ) {
  .ideaform-inner {
    padding: 24px 20px 20px;
  }

  .idf-row {
    flex-direction: column;
    gap: 0;
  }

  .idf-btn {
    width: 100%;
    justify-content: center;
  }
}
