:root {
  /* Bảng màu thương hiệu SOJA (đồng bộ theme_soja/_variables.scss) */
  --purple: #7a72a1;
  --purple-dark: #635c85;
  --purple-darker: #4b4566;
  --purple-light: #9b95b8;
  --purple-soft: #f2f1f7;
  --purple-footer: #eae8f2;

  --ink: #2d2d2d;
  --muted: #6b6b6b;
  --border: #d1cde0;
  --success: #72a178;
  --danger: #a17272;

  --bg: #f7f6fb;
  --card: #ffffff;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(75, 69, 102, 0.1);
  --shadow-sm: 0 2px 10px rgba(75, 69, 102, 0.06);
  --ring: 0 0 0 3px rgba(122, 114, 161, 0.22);

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  line-height: 1.55;
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(122, 114, 161, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(155, 149, 184, 0.16), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 660px;
  margin: 0 auto;
  padding: 40px 18px 72px;
}

/* ---------- Header / brand ---------- */
.head {
  text-align: center;
  margin-bottom: 24px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}

.brand-badge .logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  display: grid;
  place-items: center;
  letter-spacing: 0.5px;
}

.brand-badge .brand-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--purple-dark);
  letter-spacing: 0.3px;
}

.head h1 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.head .sub {
  margin: 0 auto;
  max-width: 460px;
  color: var(--muted);
  font-size: 0.97rem;
}

/* ---------- Card / form ---------- */
form {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px;
  overflow: hidden;
}

/* dải gradient tím trên đỉnh thẻ */
form::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--purple-light), var(--purple), var(--purple-dark));
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 22px;
}

legend {
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--purple-dark);
  margin-bottom: 10px;
  padding: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chip {
  position: relative;
  display: inline-flex;
}

.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.chip span {
  display: inline-block;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  background: #fff;
  color: var(--ink);
  transition: all 0.18s ease;
  user-select: none;
}

.chip:hover span {
  border-color: var(--purple-light);
}

.chip input:checked + span {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  border-color: var(--purple-dark);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(122, 114, 161, 0.32);
}

.chip input:focus-visible + span {
  outline: none;
  box-shadow: var(--ring);
}

/* ---------- Fields ---------- */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--purple-dark);
  margin-bottom: 8px;
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23635c85' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: var(--ring);
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: #a8a4ba;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: var(--ring);
}

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

/* ---------- File upload (dropzone) ---------- */
.dropzone {
  border: 1.5px dashed var(--purple-light);
  border-radius: var(--radius-sm);
  background: var(--purple-soft);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--purple);
  background: #ece9f5;
}

.dropzone input[type="file"] {
  display: none;
}

.dropzone .dz-icon {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 4px;
}

.dropzone .dz-text {
  font-weight: 600;
  color: var(--purple-dark);
  font-size: 0.92rem;
}

.dropzone .dz-text u {
  text-decoration: underline;
}

.hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.previews {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.thumb {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

.thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(45, 45, 45, 0.7);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.thumb button:hover {
  background: var(--danger);
}

/* ---------- Submit ---------- */
.btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(122, 114, 161, 0.35);
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(122, 114, 161, 0.42);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.progress {
  margin: 14px 0 0;
  height: 8px;
  border-radius: 999px;
  background: var(--purple-soft);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple-light), var(--purple), var(--purple-dark));
  transition: width 0.2s ease;
}

.progress-bar.indeterminate {
  width: 40% !important;
  animation: slide 1.1s ease-in-out infinite;
}

@keyframes slide {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

.status {
  margin: 14px 0 0;
  font-size: 0.92rem;
  text-align: center;
  min-height: 1.2em;
}

.status.err {
  background: #faf0f0;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-weight: 500;
}

.status.ok {
  color: var(--success);
}

.status.err {
  color: var(--danger);
}

.privacy {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Honeypot ẩn hoàn toàn */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Success ---------- */
.success-card {
  text-align: center;
  padding: 18px 0;
}

.success-card .emoji {
  font-size: 3rem;
  animation: pop 0.4s ease;
}

.success-card h2 {
  color: var(--purple-dark);
  margin: 10px 0 6px;
  font-size: 1.4rem;
}

.success-card p {
  color: var(--muted);
  margin: 0 auto 20px;
  max-width: 360px;
}

@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.footnote {
  text-align: center;
  margin-top: 22px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  .wrap {
    padding: 26px 14px 56px;
  }
  .head h1 {
    font-size: 1.42rem;
  }
  form {
    padding: 20px 16px;
  }
  .chip span {
    padding: 9px 13px;
    font-size: 0.86rem;
  }
  .btn {
    padding: 14px;
  }
}
