:root {
  --brand: #4bb490;
  --brand-dark: #3a9b7a;
  --brand-soft: #e8f6f0;
  --text: #1f2933;
  --muted: #6b7785;
  --border: #e3e8ee;
  --bg: #f4f7f6;
  --card: #ffffff;
  --danger: #c0392b;
  --danger-soft: #fdecea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 440px;
  margin: 0 auto;
  padding: 48px 16px 32px;
}

/* Main card */
.card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  padding: 32px 28px;
}

.card-header {
  text-align: center;
  margin-bottom: 20px;
}

.main-logo {
  width: 72px;
  height: auto;
  margin-bottom: 16px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.lead-text {
  color: var(--muted);
  font-size: 15px;
  text-align: center;
  margin: 0 0 24px;
}

/* Form */
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 6px;
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

input,
textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

input::placeholder,
textarea::placeholder {
  color: #9aa5b1;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

button {
  width: 100%;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

button:hover {
  background: var(--brand-dark);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--brand-soft);
}

/* Opened from the app: shows whose account is being deleted */
.app-account {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--brand-soft);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 15px;
  word-break: break-all;
}

/* Shown when the page is opened without a valid link from the app */
.notice {
  background: var(--bg);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  font-size: 15px;
}

.notice p {
  margin: 0;
}

.app-account-label {
  color: var(--muted);
  font-size: 13px;
}

/* App choice (radio cards) */
.app-options {
  border: none;
  margin: 0 0 18px;
  padding: 0;
}

.app-options legend {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  padding: 0;
}

.app-option {
  position: relative;
  display: block;
  margin: 0 0 10px;
  font-weight: 400;
  cursor: pointer;
}

.app-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.app-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.app-option:hover .app-card {
  border-color: #c9d3dc;
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}

.app-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.app-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.app-meta {
  font-size: 13px;
  color: var(--muted);
}

.app-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #c9d3dc;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.app-option input:checked + .app-card {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.app-option input:checked + .app-card .app-check {
  border-color: var(--brand);
  background: var(--brand);
}

.app-option input:checked + .app-card .app-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.app-option input:focus-visible + .app-card {
  box-shadow: 0 0 0 4px var(--brand-soft);
  border-color: var(--brand);
}

/* Error message */
#message:not(:empty) {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 18px;
}

/* Success view */
.success {
  text-align: center;
  padding: 8px 0 4px;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px;
}

.summary {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
  background: var(--bg);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.summary-email {
  color: var(--muted);
  font-size: 14px;
  word-break: break-all;
}

.success h3 {
  text-align: start;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
}

.next-steps {
  text-align: start;
  color: var(--muted);
  font-size: 14px;
  padding-left: 20px;
  margin: 0 0 16px;
}

.next-steps li {
  margin-bottom: 8px;
}

.next-steps strong {
  color: var(--text);
}

.success-note {
  text-align: start;
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Collapsible info */
.details {
  margin-top: 16px;
}

details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 18px;
  margin-bottom: 10px;
  font-size: 14px;
}

summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  color: var(--brand);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

details[open] summary::after {
  content: "−";
}

details p,
details ul {
  margin: 0 0 14px;
  color: var(--muted);
}

details ul {
  padding-left: 18px;
}

details li {
  margin-bottom: 6px;
}

details strong {
  color: var(--text);
}

a {
  color: var(--brand-dark);
  font-weight: 500;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 20px;
}

@media (max-width: 400px) {
  .page {
    padding-top: 24px;
  }
  .card {
    padding: 24px 20px;
  }
}
