*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --text: #111;
  --muted: #8a8a8a;
  --border: #dcdcdc;
  --tile: #f4f4f4;
  --error: #c0392b;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 28px 16px;
  text-align: center;
}

.wordmark {
  margin: 0;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

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

.label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.uploads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.upload-card,
.result-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 5;
  background: var(--tile);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.upload-card {
  cursor: pointer;
  transition: border-color 0.15s;
}

.upload-card:hover,
.upload-card.dragover {
  border-color: var(--text);
}

.upload-card:focus-within {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--text);
  border-radius: 50%;
  font-size: 24px;
  font-weight: 400;
}

.empty-title {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.empty-hint {
  font-size: 13px;
  color: var(--muted);
}

.preview,
.result-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pill {
  display: inline-block;
  padding: 7px 18px;
  background: #fff;
  border: 1px solid var(--text);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}

.replace {
  position: absolute;
  top: 16px;
  right: 16px;
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin: 36px 0 48px;
}

.primary {
  min-width: 240px;
  padding: 20px 28px;
  background: var(--text);
  border: 0;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.primary:hover:not(:disabled) {
  background: #333;
}

.primary:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}

.error {
  min-height: 1.4em;
  margin: 0;
  font-size: 14px;
  color: var(--error);
}

.result-card {
  max-width: 560px;
}

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

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.download {
  margin-top: 16px;
}

@media (max-width: 720px) {
  .container {
    padding: 28px 16px 60px;
  }

  .uploads {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .primary {
    width: 100%;
  }
}

/* Auth */

.site-header {
  position: relative;
}

.account {
  position: absolute;
  top: 50%;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transform: translateY(-50%);
}

.account-name {
  font-size: 14px;
  color: var(--muted);
}

button.pill {
  font-family: inherit;
  cursor: pointer;
}

.auth-card {
  max-width: 420px;
  margin: 24px auto 0;
}

.tabs {
  display: flex;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  margin-bottom: -1px;
  padding: 14px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.tab.active {
  border-bottom-color: var(--text);
  color: var(--text);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-field {
  display: flex;
  flex-direction: column;
}

.input-field input {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}

.input-field input:focus {
  border-color: var(--text);
  outline: none;
}

.password-wrap {
  position: relative;
  display: flex;
}

.password-wrap input {
  width: 100%;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--text);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

.auth-form .primary {
  width: 100%;
  margin-top: 8px;
}

.auth-form .error:empty,
.notice:empty {
  display: none;
}

.notice {
  margin: 0;
  font-size: 14px;
}

@media (max-width: 720px) {
  .account {
    position: static;
    justify-content: center;
    margin-top: 16px;
    transform: none;
  }
}

.paywall {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  text-align: center;
}

.paywall-offer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.paywall .label,
.paywall .subtitle {
  margin: 0;
}

.price {
  margin: 0;
  font-size: 48px;
  font-weight: 500;
}

.paywall .primary {
  display: block;
  margin-top: 8px;
  text-decoration: none;
}

.paywall .pill {
  align-self: center;
}

.paywall .loading {
  justify-content: center;
  margin: 0;
}

.paywall .error:empty {
  display: none;
}

.paywall-account {
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* The upload area sits directly under the paywall for unpaid users. */
#paywall {
  padding-bottom: 0;
}

.upload-locked {
  margin: -20px 0 28px;
}

.upload-locked a {
  margin-left: 6px;
  color: var(--text);
  font-weight: 500;
}

.price-period {
  font-size: 18px;
  color: var(--muted);
}
