/**
 * QIM Dynamic Theme – Form CSS
 * Copyright by Sơn Phạm · 0916262170
 * Designed to blend into any uploaded HTML template.
 */

/* ── Container ── */
.qim-form-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Title ── */
.qim-form-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.3;
}

.qim-form-desc {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ── Fields ── */
.qim-field {
  margin-bottom: 16px;
}

.qim-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.8;
}

.qim-req {
  color: #e87070;
  margin-left: 2px;
}

.qim-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: inherit;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
  font-family: inherit;
  -webkit-appearance: none;
}

.qim-input:focus {
  border-color: currentColor;
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
}

.qim-input::placeholder {
  opacity: 0.4;
  font-size: 13px;
}

/* ── Error messages ── */
.qim-error {
  display: none;
  font-size: 12px;
  color: #e87070;
  margin-top: 5px;
  font-weight: 500;
}

/* ── Submit button ── */
.qim-submit-wrap {
  margin-top: 8px;
}

.qim-submit-btn {
  width: 100%;
  padding: 15px 32px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.25s, transform 0.2s;
  background: currentColor;
}

.qim-submit-btn:hover:not(:disabled) {
  opacity: 0.88;
  transform: translateY(-1px);
}

.qim-submit-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ── Response message ── */
.qim-response {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  display: none;
}

.qim-response--success {
  background: rgba(70, 180, 80, 0.12);
  border: 1px solid rgba(70, 180, 80, 0.4);
  color: #6fcf77;
}

.qim-response--error {
  background: rgba(220, 50, 50, 0.10);
  border: 1px solid rgba(220, 50, 50, 0.35);
  color: #e87070;
}

/* ─────────────────────────────────────────
   THEME-AWARE OVERRIDES
   When the uploaded template has specific color schemes,
   the form adapts automatically.
   ───────────────────────────────────────── */

/* Dark backgrounds (default) */
.qim-body .qim-submit-btn {
  background: #C9A96E;
  color: #0a0a0a;
}
.qim-body .qim-submit-btn:hover:not(:disabled) {
  background: #E8D5B0;
  color: #0a0a0a;
}

/* Light backgrounds — auto-detect via .light-theme on body */
.light-theme .qim-input {
  border-color: rgba(0,0,0,0.2);
  background: rgba(0,0,0,0.04);
  color: #222;
}
.light-theme .qim-input:focus {
  border-color: #555;
  background: rgba(0,0,0,0.07);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .qim-input { padding: 12px 14px; font-size: 16px; /* prevent iOS zoom */ }
  .qim-submit-btn { padding: 14px 24px; }
}
