/*
  Release Tracker — Contact / Support modal stylesheet
  Independent from css/style.css and css/privacy.css. Reuses the same
  design tokens (colors, fonts, radii, shadows) defined in style.css's
  :root, so it must always load after style.css.
*/

/* ---------- Footer trigger ---------- */

.rt-footer-link-btn {
  cursor: pointer;
}

/* ---------- Overlay ---------- */

.rt-contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 5vw, 40px);
  background: rgba(17, 18, 22, 0.6);
  backdrop-filter: blur(6px) saturate(1.05);
  -webkit-backdrop-filter: blur(6px) saturate(1.05);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.rt-contact-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ---------- Modal card ---------- */

.rt-contact-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 820px);
  overflow-y: auto;
  padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 40px) clamp(30px, 4vw, 40px);
  border-radius: clamp(18px, 2vw, 26px);
  border: 1px solid var(--rt-line);
  background: var(--rt-card);
  box-shadow: 0 30px 80px rgba(17, 18, 22, 0.32);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.19, 1, 0.22, 1);
}

.rt-contact-overlay.is-open .rt-contact-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .rt-contact-overlay,
  .rt-contact-modal {
    transition: none;
  }
}

.rt-contact-close {
  position: absolute;
  top: clamp(14px, 2.4vw, 20px);
  right: clamp(14px, 2.4vw, 20px);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--rt-line);
  background: var(--rt-paper);
  color: var(--rt-ink-soft);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.rt-contact-close:hover,
.rt-contact-close:focus-visible {
  background: var(--rt-ink);
  color: var(--rt-paper);
  transform: scale(1.06);
  outline: 0;
}

/* ---------- Header ---------- */

.rt-contact-title {
  margin: 0 0 8px;
  padding-right: 36px;
  color: var(--rt-ink);
  font-family: var(--rt-font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.rt-contact-subtitle {
  margin: 0 0 clamp(22px, 3vw, 30px);
  max-width: 48ch;
  color: var(--rt-ink-soft);
  font-family: var(--rt-font-text);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.6;
}

/* ---------- Form ---------- */

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

.rt-contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.rt-contact-label {
  color: var(--rt-ink);
  font-family: var(--rt-font-text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.rt-contact-optional {
  color: var(--rt-ink-faint);
  font-weight: 500;
}

.rt-contact-input,
.rt-contact-select,
.rt-contact-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--rt-line);
  background: var(--rt-paper);
  color: var(--rt-ink);
  font-family: var(--rt-font-text);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rt-contact-textarea {
  resize: vertical;
  min-height: 108px;
}

.rt-contact-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'><path d='M5.5 8L10 12.2L14.5 8' stroke='%23111216' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 38px;
}

.rt-contact-input::placeholder,
.rt-contact-textarea::placeholder {
  color: var(--rt-ink-faint);
}

.rt-contact-input:focus-visible,
.rt-contact-select:focus-visible,
.rt-contact-textarea:focus-visible {
  outline: none;
  border-color: var(--rt-ink);
  box-shadow: 0 0 0 3px rgba(17, 18, 22, 0.1);
}

.rt-contact-input:user-invalid,
.rt-contact-textarea:user-invalid {
  border-color: var(--rt-danger);
}

.rt-contact-field-error {
  display: none;
  color: var(--rt-danger);
  font-family: var(--rt-font-text);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
}

.rt-contact-field.has-error .rt-contact-input,
.rt-contact-field.has-error .rt-contact-textarea {
  border-color: var(--rt-danger);
}

.rt-contact-field.has-error .rt-contact-field-error {
  display: block;
}

/* Honeypot — hidden from sighted users and keyboard tab order, but
   still present in the DOM/markup for simple bots that auto-fill every
   field. Not display:none, since some spam scripts skip those. */
.rt-contact-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.rt-contact-submit {
  width: 100%;
  margin-top: 4px;
}

.rt-contact-submit[disabled] {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none !important;
}

.rt-contact-footnote {
  margin: 12px 0 0;
  color: var(--rt-ink-faint);
  font-family: var(--rt-font-text);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.rt-contact-footnote-email {
  margin: 4px 0 0;
}

.rt-contact-footnote a {
  color: var(--rt-ink-soft);
  font-weight: 600;
  border-bottom: 1px solid var(--rt-ink-faint);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.rt-contact-footnote a:hover,
.rt-contact-footnote a:focus-visible {
  color: var(--rt-ink);
  border-color: var(--rt-ink);
}

.rt-contact-form-error {
  display: none;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(196, 92, 73, 0.35);
  background: rgba(196, 92, 73, 0.08);
  color: var(--rt-danger);
  font-family: var(--rt-font-text);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.5;
}

.rt-contact-form-error.is-visible {
  display: block;
}

.rt-contact-form-error a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

/* ---------- Success state ---------- */

.rt-contact-success {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0 4px;
}

.rt-contact-success.is-visible {
  display: flex;
}

.rt-contact-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(94, 196, 150, 0.16);
  color: var(--rt-green-deep);
}

.rt-contact-success-title {
  margin: 4px 0 0;
  color: var(--rt-ink);
  font-family: var(--rt-font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.005em;
}

.rt-contact-success-text {
  margin: 0;
  color: var(--rt-ink-soft);
  font-family: var(--rt-font-text);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.6;
}

.rt-contact-success-close {
  margin-top: 8px;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .rt-contact-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .rt-contact-modal {
    padding: 24px 18px 28px;
    border-radius: 18px;
  }
}
