/* TIXQUESTS public frees form. Same look as the app: dark, calm, indigo for
   tappable things, orange only for the close date. */
:root {
  --bg: #121218;
  --surface: #1a1a22;
  --raised: #23232d;
  --text: #e9e9ef;
  --muted: #a3a3b3;
  --faint: #6e6e80;
  --accent: #6366f1;
  --accent-text: #a5a8ff;
  --warning: #f5a524;
  --danger: #f87171;
  --success: #4ade80;
  --divider: #1f1f27;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    'Geist',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 16px;
  padding-top: max(24px, env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.org {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.closes {
  font-size: 13px;
  font-weight: 500;
  color: var(--warning);
}

.muted {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.field label .opt {
  color: var(--faint);
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--raised);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16+ stops iOS zooming in on focus */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

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

select {
  padding-right: 40px;
  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='%23A3A3B3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

select:invalid {
  color: var(--faint);
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

.field.bad input,
.field.bad select,
.field.bad textarea {
  border-color: var(--danger);
}

.error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

.btn {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  opacity: 0.8;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}

.btn.secondary {
  background: var(--raised);
  color: var(--text);
}

.row {
  display: flex;
  gap: 8px;
}

.row > * {
  flex: 1;
}

/* After submitting */
.done {
  align-items: center;
  text-align: center;
  gap: 10px;
}

.tick {
  width: 52px;
  height: 52px;
  border-radius: 26px;
  background: rgba(74, 222, 128, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.done p {
  margin: 0;
  color: var(--muted);
}

/* "You've added (2)" on this phone */
.mine {
  display: flex;
  flex-direction: column;
}

.mine .label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 0 4px 8px;
}

.mine ul {
  list-style: none;
  margin: 0;
  padding: 0 16px;
  background: var(--surface);
  border-radius: 20px;
}

.mine li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
  border-top: 1px solid var(--divider);
}

.mine li:first-child {
  border-top: 0;
}

.mine .who {
  flex: 1;
  min-width: 0;
}

.mine .name {
  font-weight: 600;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.link {
  border: 0;
  background: none;
  padding: 8px 4px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-text);
  cursor: pointer;
}

.link.danger {
  color: var(--danger);
}

.link.center {
  align-self: center;
}

.hint {
  color: var(--faint);
  font-size: 13px;
  padding: 8px 4px 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(28, 28, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.empty {
  text-align: center;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
}

.empty p {
  margin: 0;
  color: var(--muted);
}

.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 max(24px, env(safe-area-inset-bottom));
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.foot img {
  opacity: 0.7;
}

.skeleton {
  height: 14px;
  border-radius: 8px;
  background: var(--raised);
  animation: pulse 1.2s ease-in-out infinite;
}

.skeleton.tall {
  height: 24px;
}

.skeleton.field {
  height: 48px;
}

.w30 {
  width: 30%;
}

.w40 {
  width: 40%;
}

.w70 {
  width: 70%;
}

.hidden {
  display: none !important;
}

@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}
