.complaint-page {
  min-height: calc(100vh - 72px);
  padding: 3rem 1.25rem 5rem;
  background: #f8fafc;
  color: #0f172a;
}

.complaint-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.complaint-header {
  max-width: 760px;
  margin-bottom: 2rem;
}

.complaint-header-with-action {
  display: flex;
  max-width: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.complaint-header-with-action > div {
  max-width: 760px;
}

.complaint-track-link {
  flex: 0 0 auto;
}

.complaint-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: #818cf8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.complaint-header h1,
.complaint-success h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(2rem, 5vw, 3.35rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.complaint-header > p,
.complaint-success > p {
  margin: 1rem 0 0;
  color: #64748b;
  font-size: 1.02rem;
  line-height: 1.75;
}

.complaint-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 2fr);
  gap: 1.5rem;
  align-items: start;
}

.complaint-guide,
.complaint-form,
.complaint-success {
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.complaint-guide {
  position: sticky;
  top: 6rem;
  padding: 1.65rem;
}

.complaint-guide-icon,
.complaint-success-icon {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border-radius: 1rem;
  background: #818cf8;
  box-shadow: none;
  color: #fff;
  font-size: 1.35rem;
}

.complaint-guide h2 {
  margin: 1.2rem 0 1rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.complaint-guide ul {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.complaint-guide li {
  display: flex;
  gap: 0.7rem;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.55;
}

.complaint-guide li i {
  display: grid;
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
  place-items: center;
  border-radius: 50%;
  background: #dcfce7;
  color: #047857;
  font-size: 0.65rem;
}

.complaint-privacy-note {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.4rem;
  padding: 0.9rem;
  border-radius: 0.9rem;
  background: #eef2ff;
  color: #6366f1;
}

.complaint-privacy-note i {
  margin-top: 0.15rem;
}

.complaint-privacy-note p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
}

.complaint-form {
  padding: clamp(1.2rem, 4vw, 2.3rem);
}

.complaint-section {
  display: grid;
  gap: 1.15rem;
  margin: 0;
  padding: 0 0 1.75rem;
  border: 0;
}

.complaint-section + .complaint-section {
  padding-top: 1.75rem;
  border-top: 1px solid #e2e8f0;
}

.complaint-section legend {
  width: 100%;
  margin-bottom: 1.1rem;
  color: #1e293b;
  font-size: 1rem;
  font-weight: 800;
}

.complaint-grid,
.complaint-attachments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.complaint-control {
  display: grid;
  gap: 0.45rem;
}

.complaint-control label {
  color: #334155;
  font-size: 0.86rem;
  font-weight: 700;
}

.complaint-control label span {
  color: #dc2626;
}

.complaint-control small,
.complaint-upload-heading small {
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.45;
}

.complaint-field {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.8rem;
  outline: 0;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.complaint-field:hover {
  border-color: #94a3b8;
}

.complaint-field:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.13);
}

.complaint-field[aria-invalid="true"] {
  border-color: #ef4444;
  background: #fffafa;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
}

textarea.complaint-field {
  min-height: 9rem;
  resize: vertical;
}

input[type="file"].complaint-field {
  min-height: auto;
  padding: 0.55rem;
  border-style: dashed;
  background: #f8fafc;
}

input[type="file"].complaint-field::file-selector-button {
  margin-inline-end: 0.8rem;
  padding: 0.6rem 0.8rem;
  border: 0;
  border-radius: 0.55rem;
  background: #e0e7ff;
  color: #4338ca;
  font-weight: 700;
  cursor: pointer;
}

.complaint-character-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.complaint-character-row output {
  color: #94a3b8;
  font-size: 0.72rem;
  white-space: nowrap;
}

.complaint-account-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
  padding: 1rem;
  border: 1px solid #e0e7ff;
  border-radius: 1rem;
  background: #eef2ff;
}

.complaint-account-icon,
.complaint-upload-heading > span {
  display: grid;
  flex: 0 0 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 0.75rem;
  background: #e0e7ff;
  color: #818cf8;
}

.complaint-account-card strong,
.complaint-upload-heading strong {
  display: block;
  color: #6366f1;
  font-size: 0.88rem;
}

.complaint-account-card p {
  margin: 0.2rem 0 0;
  color: #475569;
  font-size: 0.82rem;
}

.complaint-upload-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fbfdff;
}

.complaint-upload-heading {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.complaint-upload-heading div {
  min-width: 0;
}

.complaint-upload-heading strong {
  color: #334155;
}

.complaint-upload-heading small {
  display: block;
  margin-top: 0.15rem;
}

.complaint-recorder {
  display: grid;
  gap: 0.75rem;
  padding: 0.8rem;
  border-radius: 0.8rem;
  background: #f1f5f9;
}

.complaint-recorder-status,
.complaint-recorder-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.complaint-recorder-status {
  color: #64748b;
  font-size: 0.76rem;
}

.complaint-recorder-status time {
  margin-inline-start: auto;
  color: #334155;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.complaint-record-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #94a3b8;
}

.complaint-recorder.is-recording .complaint-record-dot {
  background: #ef4444;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.12);
  animation: complaint-record-pulse 1.2s ease-in-out infinite;
}

@keyframes complaint-record-pulse {
  50% { opacity: 0.45; }
}

.complaint-button,
.complaint-submit {
  display: inline-flex;
  min-height: 2.6rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.7rem;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.complaint-button:hover,
.complaint-submit:hover {
  transform: translateY(-1px);
}

.complaint-button-record {
  border-color: #fecaca;
  color: #b91c1c;
}

.complaint-button-stop {
  border-color: #fecaca;
  background: #ef4444;
  color: #fff;
}

.complaint-button-remove {
  color: #64748b;
}

.complaint-audio-preview {
  width: 100%;
  height: 2.6rem;
}

.complaint-error,
.complaint-recorder-error,
.complaint-feedback-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.76rem;
  line-height: 1.45;
}

.complaint-feedback-success {
  color: #047857;
  font-size: 0.76rem;
}

.complaint-alert {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid #fecaca;
  border-radius: 0.8rem;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.85rem;
}

.complaint-alert p {
  margin: 0;
}

.complaint-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.complaint-submit-row p {
  max-width: 30rem;
  margin: 0;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.5;
}

.complaint-submit {
  min-width: 9.5rem;
  border-color: transparent;
  background: #818cf8;
  box-shadow: none;
  color: #fff;
}

.complaint-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.complaint-success-page {
  display: grid;
  place-items: center;
}

.complaint-success {
  width: min(620px, 100%);
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
}

.complaint-success-icon {
  margin: 0 auto 1.5rem;
  background: #059669;
  box-shadow: none;
}

.complaint-success .complaint-kicker {
  margin-bottom: 0.65rem;
  color: #047857;
}

.complaint-success h1 {
  font-size: clamp(1.75rem, 5vw, 2.6rem);
}

.complaint-reference {
  display: inline-grid;
  gap: 0.25rem;
  margin: 1.75rem auto;
  padding: 0.9rem 1.5rem;
  border: 1px dashed #c7d2fe;
  border-radius: 0.9rem;
  background: #eef2ff;
}

.complaint-reference span {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.complaint-reference strong {
  color: #6366f1;
  font-size: 1.4rem;
  letter-spacing: 0.14em;
}

.complaint-success-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.complaint-ticket-list {
  display: grid;
  gap: 1rem;
}

.complaint-ticket {
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
}

.complaint-ticket-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.complaint-ticket-topline > div {
  display: grid;
  gap: 0.15rem;
}

.complaint-ticket-reference,
.complaint-ticket-heading small,
.complaint-ticket-meta dt {
  color: #64748b;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.complaint-ticket-topline strong {
  color: #1e293b;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
}

.complaint-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.complaint-status-new {
  background: #fef3c7;
  color: #92400e;
}

.complaint-status-in_progress {
  background: #e0e7ff;
  color: #6366f1;
}

.complaint-status-handled {
  background: #dcfce7;
  color: #047857;
}

.complaint-ticket-body {
  padding: 1.25rem;
}

.complaint-ticket-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.complaint-ticket-heading > span {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 2.5rem;
  place-items: center;
  border-radius: 0.75rem;
  background: #eef2ff;
  color: #6366f1;
}

.complaint-ticket-heading h2 {
  margin: 0.15rem 0 0;
  color: #1e293b;
  font-size: 1rem;
  font-weight: 800;
}

.complaint-ticket-description {
  margin: 1rem 0 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.7;
}

.complaint-ticket-meta {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  background: #fbfdff;
}

.complaint-ticket-meta div {
  display: grid;
  gap: 0.2rem;
}

.complaint-ticket-meta dd {
  margin: 0;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
}

.complaint-ticket-note {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.8rem;
}

.complaint-support-reply {
  display: grid;
  gap: 1rem;
  margin: 1rem;
  padding: 1.15rem;
  border: 1px solid #a7f3d0;
  border-radius: 1rem;
  background: #f0fdf4;
}

.complaint-support-reply-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.complaint-support-reply-header > span {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 2.5rem;
  place-items: center;
  border-radius: 0.75rem;
  background: #d1fae5;
  color: #047857;
}

.complaint-support-reply-header h3 {
  margin: 0;
  color: #065f46;
  font-size: 0.95rem;
  font-weight: 800;
}

.complaint-support-reply-header time {
  display: block;
  margin-top: 0.15rem;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
}

.complaint-support-reply-text {
  padding: 0.9rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.78);
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.7;
}

.complaint-support-reply-audio {
  display: grid;
  gap: 0.5rem;
}

.complaint-support-reply-audio span {
  color: #047857;
  font-size: 0.75rem;
  font-weight: 800;
}

.complaint-support-reply-audio audio {
  width: min(100%, 34rem);
  height: 2.7rem;
}

.complaint-support-reply-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #99f6e4;
  border-radius: 0.65rem;
  background: #fff;
  color: #0f766e;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}

.complaint-support-reply-link:hover {
  border-color: #2dd4bf;
  color: #0f766e;
}

.complaint-tracking-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.5fr);
  gap: 1.5rem;
  align-items: start;
}

.complaint-tracking-form {
  display: grid;
  gap: 1rem;
}

.complaint-tracking-form .complaint-submit {
  width: 100%;
}

.complaint-tracking-help {
  margin: 0;
  color: #64748b;
  font-size: 0.74rem;
  line-height: 1.5;
  text-align: center;
}

.complaint-tracking-result {
  min-width: 0;
}

.complaint-track-placeholder,
.complaint-not-found,
.complaint-empty-state {
  display: grid;
  min-height: 22rem;
  padding: 2rem;
  place-items: center;
  align-content: center;
  border: 1px dashed #cbd5e1;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.complaint-track-placeholder > span,
.complaint-not-found > span,
.complaint-empty-state > span {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 1rem;
  background: #e0e7ff;
  color: #6366f1;
  font-size: 1.25rem;
}

.complaint-not-found > span {
  background: #fee2e2;
  color: #b91c1c;
}

.complaint-track-placeholder h2,
.complaint-not-found h2,
.complaint-empty-state h2 {
  margin: 0;
  color: #1e293b;
  font-size: 1.1rem;
  font-weight: 800;
}

.complaint-track-placeholder p,
.complaint-not-found p,
.complaint-empty-state p {
  max-width: 28rem;
  margin: 0.55rem 0 0;
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.6;
}

.complaint-empty-state .complaint-submit {
  margin-top: 1.25rem;
}

.hidden {
  display: none !important;
}

html[dir="rtl"] .complaint-page {
  direction: rtl;
}

@media (max-width: 850px) {
  .complaint-layout {
    grid-template-columns: 1fr;
  }

  .complaint-guide {
    position: static;
  }

  .complaint-tracking-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .complaint-page {
    padding: 1.75rem 0.75rem 3rem;
  }

  .complaint-grid,
  .complaint-attachments {
    grid-template-columns: 1fr;
  }

  .complaint-header-with-action {
    align-items: stretch;
    flex-direction: column;
  }

  .complaint-header-with-action .complaint-button,
  .complaint-header-with-action .complaint-submit {
    width: 100%;
  }

  .complaint-ticket-meta {
    flex-direction: column;
    gap: 0.8rem;
  }

  .complaint-form,
  .complaint-guide,
  .complaint-success {
    border-radius: 1.15rem;
  }

  .complaint-submit-row {
    align-items: stretch;
    flex-direction: column;
  }

  .complaint-submit-row .complaint-submit {
    width: 100%;
  }

  .complaint-recorder-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .complaint-record-dot,
  .complaint-button,
  .complaint-submit,
  .complaint-field {
    animation: none;
    transition: none;
  }
}
