/* Blur and fade the form card and auth details when user is signed out */
body.signed-out #formCard,
body.signed-out .auth-details {
  filter: blur(1.2px);
  opacity: 0.78;
  pointer-events: none;
  user-select: none;
}

/* Prevent scroll behind the confirmation dialog while it's open */
body:has(.submit-confirm-dialog[open]) {
  overflow: hidden;
}

.auth-details[hidden],
.identity[hidden],
.login-btn[hidden],
.burn-transactions[hidden],
.submitted-ghsas-card[hidden] {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 3px;
  font: inherit;
  font-weight: 510;
  text-decoration: none;
  cursor: pointer;
  flex: 1 0 0;
}

.login-btn {
  background: rgba(28, 231, 194, 0.15);
  color: #fff;
  padding: 0 16px;
  margin-bottom: 10px;
  border: 1px solid transparent;
  font-size: 14px;
}

.login-btn:hover {
  background: rgba(28, 231, 194, 0.25);
  color: #fff;
}

.login-btn img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.auth-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 12px;
}

.auth-details {
  margin-top: 0;
}

.field {
  margin-bottom: 10px;
}

fieldset.field {
  border: 0;
  padding: 0;
  min-width: 0;
}

label,
legend {
  display: block;
  color: #c9d1d9;
  font-weight: 550;
  margin-bottom: 4px;
}

.required {
  color: #f85149;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 4px;
  border: 1px solid rgba(217, 237, 254, 0.15);
  background: rgba(0, 0, 0, 0.25);
  box-shadow:
    0 1.5px 2px 0 rgba(0, 0, 0, 0.1) inset,
    0 1.5px 2px 0 rgba(216, 244, 246, 0.04) inset;
  color: #e6edf3;
  padding: 8px 10px;
  font: inherit;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  height: 24px;
  padding: 0 10px;
}

input:disabled,
textarea:disabled,
select:disabled {
  background: #21262d;
  border-color: #30363d;
  color: #6e7681;
  cursor: not-allowed;
  opacity: 1;
}

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

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #3e63dd;
  box-shadow: 0 0 0 3px rgba(62, 99, 221, 0.15);
}

button:focus-visible {
  outline: 2px solid #3e63dd;
  outline-offset: 2px;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.25) inset;
  -webkit-text-fill-color: #e6edf3;
  caret-color: #e6edf3;
}

.counter,
.field-status {
  color: #8b949e;
  font-size: 10px;
  text-align: right;
  margin-top: 3px;
}

.field-status.valid {
  color: #09bfc9;
}

.field-status.invalid {
  color: #f85149;
}

.severity {
  display: flex;
  width: 100%;
  height: 24px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

/* Hide the actual radio inputs and use labels as the clickable segments */
.severity input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.severity label {
  display: flex;
  padding: 0 12px;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex: 1 0 0;
  height: 100%;
  border: none;
  background: rgba(255, 255, 255, 0);
  cursor: pointer;
  font-size: 14px;
  transition: background 120ms ease;
}

/* Selected segment has a darker background */
.severity input:checked + label {
  background: rgba(0, 0, 0, 0.35);
  border: none;
  box-shadow: inset 0 0 0 1px rgba(211, 237, 248, 0.11);
}

.severity span:first-child label {
  border-radius: 4px 0 0 4px;
  border-left: none;
}

.severity span:last-child label {
  border-radius: 0 4px 4px 0;
}

/* Vertical divider line between severity segments (none on last segment) */
.sev-low::after,
.sev-medium::after,
.sev-high::after {
  transition: opacity 120ms ease;
  content: "";
  display: block;
  width: 1px;
  height: 20px;
  background: rgba(211, 237, 248, 0.11);
  align-self: center;
  flex-shrink: 0;
}

.severity label:hover {
  background: rgba(255, 255, 255, 0.04);
}

.severity input:focus-visible + label {
  outline: 2px solid #3e63dd;
  outline-offset: -2px;
}

.severity input:checked + label:hover {
  background: rgba(0, 0, 0, 0.45);
}

.sev-low:has(input:checked)::after,
.sev-medium:has(input:checked)::after,
.sev-high:has(input:checked)::after {
  opacity: 0;
}

/* Hide the divider on the segment immediately before the selected one */
.sev-medium:has(+ .sev-high input:checked)::after,
.sev-low:has(+ .sev-medium input:checked)::after,
.sev-high:has(+ .sev-critical input:checked)::after {
  opacity: 0;
}

.sev-low,
.sev-medium,
.sev-high,
.sev-critical {
  display: flex;
  flex: 1 0 0;
  align-items: stretch;
}

.sev-low label {
  color: #53b365;
}

.sev-medium label {
  color: #ffd60a;
}

.sev-high label {
  color: #ff801f;
}

.sev-critical label {
  color: #ec5d5e;
}

.sev-hint {
  display: none;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid currentColor;
  font-size: 12px;
  color: #c9d1d9;
  background: rgba(255, 255, 255, 0.06);
  line-height: 1.5;
}

.sev-hint.visible {
  display: block;
}

.sev-hint strong {
  font-weight: 700;
}

.sev-hint span {
  color: #8b949e;
  font-size: 11px;
}

.radio-options {
  display: grid;
  gap: 8px;
}

.radio-option {
  align-items: center;
  border: 1px solid #30363d;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr;
  margin: 0;
  padding: 4px;
}

.radio-option input {
  width: auto;
}

.radio-option span {
  min-width: 0;
}

.radio-option:has(input:checked) {
  background: #388bfd18;
  border-color: #388bfd;
}

.radio-option:has(input:disabled) {
  background: #21262d;
  color: #6e7681;
  cursor: not-allowed;
}

.identity {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  height: 24px;
  padding: 0 10px;
  margin-bottom: 10px;
  min-width: 0;
}

.identity-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  direction: rtl;
  text-align: left;
}

.link-btn {
  background: none;
  border: 0;
  text-decoration: none;
  font-size: 12px;
  color: #c9d1d9;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.link-btn:hover {
  color: #fff;
}

.burn {
  background: rgba(250, 130, 0, 0.13);
  border: 1px solid #525252;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 10px 10px 20px 10px;
  flex: 1 0 0;
  align-self: stretch;
}

.burn p {
  margin: 0;
}

.burn-fee-notice {
  color: #ffca16;
  font-size: 14px;
  font-weight: 510;
}

.burn > p:first-child {
  margin-bottom: 2px;
}

.burn-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  align-self: stretch;
  width: 100%;
}

.burn-field label {
  margin: 0;
}

.value-row {
  margin: 0;
}

.copy-box {
  position: relative;
  display: flex;
  height: 24px;
  padding: 0 4px;
  align-items: center;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(217, 237, 254, 0.15);
  border-radius: 5px;
  color: #e6edf3;
  cursor: pointer;
  text-align: left;
}

.copy-box:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(217, 237, 254, 0.25);
}

.copy-box:hover .copy-icon {
  opacity: 1;
}

.copy-icon {
  position: absolute;
  top: 50%;
  right: 8px;
  pointer-events: none;
  transform: translateY(-50%);
  opacity: 0.5;
  transition: opacity 120ms ease;
}

.copy-box:disabled {
  background: #21262d;
  color: #6e7681;
  cursor: not-allowed;
  opacity: 1;
}

.copy-box:focus-visible {
  outline: 2px solid #3e63dd;
  outline-offset: 2px;
}

.copy-box code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  font:
    12px ui-monospace,
    monospace;
}

.copy-box code:empty::before {
  content: "\00a0";
}

.copy-box.command {
  height: 54px;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
}

.copy-box.command code {
  overflow: auto;
  word-break: normal;
  white-space: pre;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.burn-state {
  color: #8b949e;
  margin: 12px 0 10px;
}

.burn-state.paid {
  color: #09bfc9;
}

.burn-transactions {
  margin-top: 16px;
  margin-bottom: 4px;
}

.burn-transaction-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.burn-transaction-table th {
  text-align: left;
  color: #c9d1d9;
  font-weight: 550;
  padding: 0 8px 6px;
  border-bottom: 1px solid #30363d;
  word-break: break-word;
}

.burn-transaction-table th:last-child {
  text-align: right;
  word-break: break-word;
}

.burn-transaction-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #21262d;
  vertical-align: top;
}

.burn-transaction-table td:last-child {
  text-align: right;
  color: #c9d1d9;
  font:
    12px ui-monospace,
    monospace;
}

.burn-memo-row td,
.burn-memo-row td:last-child {
  padding: 8px 8px 4px;
  text-align: left;
  color: #c9d1d9;
  font:
    12px ui-monospace,
    monospace;
  word-break: break-all;
}

.burn-transaction-table td:first-child code {
  display: block;
  word-break: break-all;
  font:
    12px ui-monospace,
    monospace;
}

.submitted-ghsas-heading {
  font-size: 21px;
}

.submitted-ghsas {
  color: #c9d1d9;
  font-size: 12px;
  list-style: disc;
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.submitted-ghsas li {
  overflow-wrap: anywhere;
}

.terms {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 16px 0;
}

.terms input {
  width: auto;
}

.checkbox-label {
  font-size: 14px;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: #3e63dd;
  width: 14px;
  height: 16px;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.submit-btn,
.confirm-btn {
  background: rgba(28, 231, 194, 0.3);
  color: white;
}

.submit-btn:hover:not(:disabled),
.confirm-btn:hover {
  background: rgba(28, 231, 194, 0.45);
}

.submit-btn:disabled {
  background: rgba(28, 231, 194, 0.3);
  color: #8b949e;
  cursor: not-allowed;
  opacity: 0.5;
}

.reset-btn,
.cancel-btn {
  opacity: 0.92;
  background: rgba(217, 237, 254, 0.15);
  color: #c9d1d9;
}

.reset-btn:hover,
.cancel-btn:hover {
  background: rgba(217, 237, 254, 0.25);
  color: #e6edf3;
}

.alert {
  display: none;
  border-radius: 6px;
  padding: 12px;
  margin-top: 12px;
}

.alert.error {
  display: block;
  color: #f85149;
  border: 1px solid #f85149;
  background: #f8514912;
}

.alert.success {
  display: block;
  color: #09bfc9;
  border: 1px solid #09bfc9;
  background: #09bfc912;
}

.alert a {
  color: inherit;
}

.submit-confirm-dialog {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  background: #0d1117f2;
  border: 0;
  color: #e6edf3;
}

.submit-confirm-dialog::backdrop {
  background: #010409cc;
}

.submit-confirm-content {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.submit-confirm-panel {
  width: min(100%, 520px);
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  box-shadow: 0 24px 80px #01040999;
  padding: 24px;
  text-align: center;
}

.submit-confirm-panel h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
}

.submit-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 10;
  min-width: 120px;
  max-width: calc(100vw - 32px);
  background: #f0f6fc;
  border: 1px solid #8b949e;
  border-radius: 6px;
  box-shadow: 0 8px 24px #01040966;
  color: #0d1117;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  padding: 6px 10px;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
