@font-face {
  font-family: "Onest";
  src: url("../fonts/Onest-VariableFont_wght.ttf") format("truetype-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f0f0f2;
  --line: #d2d2d7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-soft: #e8f2ff;
  --ok: #067d51;
  --warn: #9a6700;
  --danger: #a62020;
  --radius-lg: 30px;
  --radius-md: 18px;
  --shadow: 0 22px 65px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Geist", "Avenir Next", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

body.auth-page {
  height: 100dvh;
  overflow-y: hidden;
}

a {
  color: inherit;
}

.container {
  width: min(1160px, 94%);
  margin: 0 auto;
  padding-bottom: 28px;
}

body.auth-page .container {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  padding-bottom: 0;
}

.topbar {
  margin-top: 14px;
  padding: 11px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 14px;
  z-index: 30;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: auto;
  display: block;
}

.brand-word {
  color: var(--text);
  font-family: "Onest", "Geist", "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 1.02rem;
  font-weight: 640;
  letter-spacing: 0.01em;
  text-transform: none;
}

.brand-help {
  color: #8d8d92;
  font-family: "Geist Mono", monospace;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-btn {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
}

.chip i,
.topbar-btn i,
.btn i {
  line-height: 1;
  font-size: 1rem;
}

.hero {
  position: relative;
  text-align: center;
  padding: 72px 0 56px;
}

body.auth-page .hero {
  padding: 44px 0 24px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -22% -12% auto;
  height: 460px;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(185, 185, 195, 0.34) 0%,
    rgba(213, 213, 220, 0.2) 34%,
    rgba(245, 245, 247, 0) 72%
  );
  filter: blur(20px);
  z-index: -1;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  font-weight: 600;
}

h1 {
  margin-top: 12px;
  font-family: "Geist Mono", monospace;
  font-size: clamp(2.1rem, 8vw, 5rem);
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

h1 span {
  color: var(--accent);
}

.lead {
  margin: 20px auto 0;
  max-width: 64ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 28px));
  display: grid;
  gap: 9px;
  z-index: 80;
  pointer-events: none;
}

.toast {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  animation: toast-in 180ms ease-out;
  pointer-events: auto;
}

.toast.success {
  border-color: rgba(6, 125, 81, 0.35);
}

.toast.error {
  border-color: rgba(166, 32, 32, 0.35);
}

.toast i {
  margin-top: 1px;
  font-size: 1rem;
  line-height: 1;
}

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

.toast.error i {
  color: var(--danger);
}

.toast-text {
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.35;
  color: #2b2b2f;
}

.toast-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 1rem;
}

.toast-hide {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.card {
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.08);
  padding: clamp(14px, 2vw, 22px);
}

.card h2 {
  font-family: "Geist Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
}

.card-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.form-stack {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.grid-2 {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.field {
  display: grid;
  gap: 6px;
}

.label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

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

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(0, 113, 227, 0.66);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  padding: 0 22px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
}

.btn:hover {
  background: #005ec2;
}

.btn-ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover {
  background: #ebebef;
  color: var(--text);
}

.btn-small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.82rem;
}

.faq-list {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.faq-item {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: clip;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 12px;
  font-size: 0.92rem;
  font-weight: 600;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin: 0;
  padding: 0 12px 12px;
  color: #404045;
  font-size: 0.9rem;
  line-height: 1.5;
}

.section-title {
  margin-top: 16px;
}

.ticket-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.ticket {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 12px;
}

.ticket-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ticket-subject {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.ticket-date {
  color: var(--muted);
  font-size: 0.8rem;
}

.ticket-text {
  margin: 10px 0 0;
  color: #3a3a3d;
  font-size: 0.9rem;
  line-height: 1.48;
  white-space: pre-wrap;
}

.ticket-inline-actions {
  margin-top: 10px;
}

.ticket-meta {
  margin-top: 4px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: #333336;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 9px;
}

.priority-high {
  border-color: rgba(166, 32, 32, 0.28);
  background: rgba(166, 32, 32, 0.1);
  color: var(--danger);
}

.priority-normal {
  border-color: rgba(154, 103, 0, 0.28);
  background: rgba(154, 103, 0, 0.1);
  color: var(--warn);
}

.priority-low {
  border-color: rgba(6, 125, 81, 0.28);
  background: rgba(6, 125, 81, 0.1);
  color: var(--ok);
}

.empty {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 14px;
}

.detail-hero {
  padding-bottom: 30px;
}

.detail-card h2 {
  margin-top: 4px;
}

.detail-actions {
  margin-bottom: 10px;
}

.ticket-id-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 0.85rem;
}

.detail-kv-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-kv-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 11px 12px;
}

.detail-kv-value {
  margin: 0;
  font-size: 0.9rem;
  color: #303035;
}

.message-block {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

.message-block h3 {
  font-size: 0.94rem;
  font-family: "Geist Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reply-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.reply-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 10px 11px;
}

.reply-head {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #2f2f34;
  font-size: 0.8rem;
}

.reply-head span {
  color: var(--muted);
  font-size: 0.76rem;
}

.reply-body {
  margin: 8px 0 0;
  color: #303035;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.login-shell {
  min-height: auto;
  display: grid;
  place-items: center;
  margin-top: -24px;
  padding-bottom: 40px;
}

body.auth-page .login-shell {
  margin-top: 0;
  padding-bottom: 12px;
}

.login-card {
  width: min(520px, 100%);
}

.hero-badge {
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  background: #fff;
  color: #2e2e32;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.82rem;
}

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

@media (max-width: 700px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .topbar {
    border-radius: 20px;
  }

  .toast-stack {
    width: calc(100vw - 18px);
    bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .detail-kv-grid {
    grid-template-columns: 1fr;
  }

  .login-shell {
    margin-top: -12px;
  }

  body.auth-page {
    overflow-y: auto;
  }

  body.auth-page .hero {
    padding: 28px 0 16px;
  }

  body.auth-page .login-shell {
    padding-bottom: 20px;
  }
}
