:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171717;
  background: #f4f4f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.portal-shell {
  min-height: 100vh;
  padding: 48px 20px;
}

.portal-home {
  display: block;
  width: fit-content;
  margin: 0 auto 24px;
  color: #171717;
  font-weight: 700;
  text-decoration: none;
}

.portal-card {
  position: relative;
  width: min(100%, 500px);
  margin: 0 auto;
  padding: 36px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .12);
}

.portal-card h1 {
  margin: 0 0 28px;
  padding-right: 24px;
  font-size: 32px;
  line-height: 1.2;
}

.portal-card p {
  line-height: 1.5;
}

.portal-card .portal-card-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #777d88;
  background: #f1f1f2;
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
}

.portal-delete-account {
  margin-top: 28px;
  font-size: 14px;
}

.portal-form {
  display: grid;
  gap: 12px;
}

.portal-form label {
  font-weight: 600;
}

.portal-form input[type="email"],
.portal-form input[type="text"],
.portal-form input[type="number"],
.portal-form input[type="password"],
.portal-form input[type="url"],
.portal-form select,
.portal-form input:not([type]) {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #ccc;
  border-radius: 7px;
  font: inherit;
}

.portal-form button,
.portal-logout button {
  padding: 13px 18px;
  border: 0;
  border-radius: 7px;
  background: #171717;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.portal-form fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 8px 0;
  padding: 18px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.portal-form legend {
  padding: 0 6px;
  font-size: 20px;
  font-weight: 700;
}

.portal-form small {
  color: #555;
  line-height: 1.5;
}

.portal-error, .portal-success {
  padding: 12px;
  border-radius: 7px;
}

.portal-error {
  background: #ffe9e9;
  color: #8a1515;
}

.portal-success {
  background: #e6f5e9;
  color: #155d29;
}

.portal-webhook {
  overflow-wrap: anywhere;
}

.portal-switch {
  margin: 22px 0 0;
  text-align: center;
}

.portal-switch a,
.portal-card a {
  color: #b00057;
}

.portal-dev-code {
  margin-top: 24px;
  padding: 12px;
  border-radius: 7px;
  background: #fff5bf;
}

.portal-account-row {
  margin-bottom: 28px;
  padding: 16px;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
}

.portal-account-row span {
  color: #777;
}

.portal-checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0;
}

.portal-payment-consents {
  display: grid;
  gap: 12px;
  color: #777;
  font-size: 14px;
  line-height: 1.5;
}

.portal-payment-consents .portal-checkbox {
  margin: 0;
  font-weight: 400;
}

.portal-payment-consents input {
  flex-shrink: 0;
}

.portal-logout {
  margin-top: 28px;
}

.portal-logout button {
  background: #eee;
  color: #171717;
}

.portal-primary-button,
.portal-back-button {
  display: block;
  padding: 13px 18px;
  border: 1px solid #d7d7dc;
  border-radius: 9px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.portal-card .portal-primary-button {
  background: #171717;
  color: #fff;
}

.portal-payment-method {
  display: grid;
  gap: 5px;
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid #e4e4e8;
  border-radius: 14px;
  background: #f8f8fa;
}

.portal-payment-method span {
  color: #717580;
  font-size: 14px;
}

.portal-payment-method a {
  margin-top: 6px;
  font-size: 14px;
}

.portal-cancel-dialog {
  position: fixed;
  width: min(576px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 38px;
  overflow-y: auto;
  border: 0;
  border-radius: 24px;
  color: #171b27;
  background: #fff;
  box-shadow: 0 24px 80px #0005;
}

.portal-cancel-dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(5px);
}

.portal-dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f1f1f2;
  color: #777d88;
  font-size: 28px;
  cursor: pointer;
}

.portal-cancel-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 24px;
  border-radius: 50%;
  color: #ed4549;
  background: #fff0f1;
  font-size: 36px;
}

.portal-cancel-dialog h2 {
  margin: 0 0 12px;
  font-size: 28px;
  text-align: center;
}

.portal-cancel-question {
  color: #737783;
  text-align: center;
}

.portal-cancel-warning {
  padding: 16px 18px;
  border: 1px solid #f3dfe1;
  border-radius: 14px;
  background: #fff7f7;
  color: #737783;
  font-size: 14px;
}

.portal-cancel-warning strong {
  color: #373c48;
  white-space: nowrap;
}

.portal-cancel-actions {
  grid-template-columns: 1fr 1fr;
  margin-top: 26px;
}

.portal-cancel-actions .portal-danger-button {
  background: #ef4145;
  color: #fff;
}

.portal-card .portal-back-button {
  color: #454b57;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #b00057;
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .portal-shell {
    padding: 24px 12px;
  }

  .portal-card {
    padding: 24px 20px;
  }

  .portal-cancel-dialog {
    padding: 28px 20px;
  }

  .portal-cancel-actions {
    grid-template-columns: 1fr;
  }
}
