/* ============================================================
   Fear Protection — публичное обжалование наказания
   ============================================================ */

.appeal-page {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.appeal-card {
  position: relative;
  padding: 42px 40px 40px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  background:
    radial-gradient(520px 280px at 8% -20%, rgba(var(--accent-rgb), 0.28), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 55%),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 40px 90px -60px rgba(0, 0, 0, 0.95);
  overflow: hidden;
}

.appeal-card::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -140px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.2), transparent 68%);
  pointer-events: none;
}

.appeal-card h1 {
  position: relative;
  margin: 18px 0 0;
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.16;
  letter-spacing: -0.5px;
  background: linear-gradient(180deg, #ffffff, #aab4ca);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.appeal-lead {
  position: relative;
  max-width: 600px;
  margin: 14px 0 0;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.7;
}

/* ---------- Форма ---------- */
.appeal-form {
  position: relative;
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.appeal-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.appeal-field > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.appeal-field input,
.appeal-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.appeal-field textarea {
  min-height: 150px;
  resize: vertical;
}

.appeal-field input::placeholder,
.appeal-field textarea::placeholder {
  color: var(--text-faint);
}

.appeal-field input:hover,
.appeal-field textarea:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.appeal-field input:focus,
.appeal-field textarea:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.7);
  background: var(--panel-3);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.appeal-field small {
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.45;
}

.appeal-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.appeal-alert {
  display: block;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid rgba(237, 66, 69, 0.45);
  border-radius: 11px;
  background: rgba(237, 66, 69, 0.12);
  color: #ffb3b5;
  font-size: 13px;
  line-height: 1.5;
}

.appeal-alert.is-success {
  border-color: rgba(61, 220, 132, 0.45);
  background: rgba(61, 220, 132, 0.12);
  color: #9df0bf;
}

.appeal-submit {
  justify-self: start;
  min-height: 46px;
  padding: 0 26px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}

.appeal-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.appeal-note {
  margin: 0;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.55;
}

/* ---------- Успех ---------- */
.appeal-success {
  position: relative;
  margin-top: 28px;
  padding: 26px 24px;
  border: 1px solid rgba(61, 220, 132, 0.32);
  border-radius: 18px;
  background: rgba(61, 220, 132, 0.07);
  text-align: center;
}

.appeal-success-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border: 1px solid rgba(61, 220, 132, 0.45);
  border-radius: 50%;
  background: rgba(61, 220, 132, 0.14);
  color: var(--green);
}

.appeal-success-ico svg {
  width: 26px;
  height: 26px;
}

.appeal-success h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.appeal-success p {
  margin: 6px 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

.appeal-success b {
  color: var(--text);
}

.appeal-success-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.appeal-success-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
}

/* ---------- Чат обращения ---------- */
.appeal-chat-card {
  margin-top: 24px;
  padding: 32px 32px 28px;
}

.appeal-chat-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.appeal-chat-title h2 {
  margin: 12px 0 0;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.appeal-chat-sub {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.5;
}

.appeal-chat-sub b {
  color: var(--text);
}

.appeal-chat-dot {
  margin: 0 6px;
  color: var(--text-faint);
}

.appeal-chat-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}

.appeal-chat-status.is-open {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
}

.appeal-chat-status.is-accepted {
  border-color: rgba(61, 220, 132, 0.45);
  background: rgba(61, 220, 132, 0.12);
  color: #9df0bf;
}

.appeal-chat-status.is-closed {
  border-color: rgba(237, 66, 69, 0.4);
  background: rgba(237, 66, 69, 0.1);
  color: #ffb3b5;
}

.appeal-chat-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
  text-decoration: none;
}

.appeal-chat-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 460px;
  margin-top: 22px;
  padding: 18px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.appeal-chat-body::-webkit-scrollbar {
  width: 8px;
}

.appeal-chat-body::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

.appeal-chat-loading,
.appeal-chat-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 90px;
  color: var(--text-faint);
  font-size: 13px;
}

.appeal-msg {
  max-width: 84%;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px 14px 14px 4px;
  background: var(--panel-2);
  align-self: flex-start;
}

.appeal-msg.is-user {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.16);
}

.appeal-msg.is-bot {
  align-self: center;
  max-width: 100%;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.appeal-msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.appeal-msg-author {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.appeal-msg.is-user .appeal-msg-author {
  color: #cfe0ff;
}

.appeal-msg-time {
  color: var(--text-faint);
  font-size: 11px;
}

.appeal-msg-text {
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.appeal-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.appeal-chat-form textarea {
  flex: 1 1 auto;
  min-height: 54px;
  max-height: 180px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

.appeal-chat-form textarea:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.7);
  background: var(--panel-3);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.appeal-chat-form textarea::placeholder {
  color: var(--text-faint);
}

.appeal-chat-send {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}

.appeal-chat-send:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ---------- Адаптив ---------- */
@media (max-width: 720px) {
  .appeal-page {
    width: calc(100% - 28px);
    padding: 30px 0 48px;
  }

  .appeal-card {
    padding: 28px 20px 26px;
    border-radius: 20px;
  }

  .appeal-submit {
    justify-self: stretch;
  }

  .appeal-chat-card {
    padding: 24px 18px 22px;
  }

  .appeal-chat-body {
    max-height: 60vh;
    padding: 14px;
  }

  .appeal-msg {
    max-width: 92%;
  }

  .appeal-chat-form {
    flex-direction: column;
    align-items: stretch;
  }

  .appeal-chat-send {
    justify-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .appeal-field input,
  .appeal-field textarea {
    transition: none;
  }
}
