:root {
  --bg-top: #f5eee1;
  --bg-bottom: #efe0c6;
  --surface: rgba(255, 252, 246, 0.88);
  --surface-strong: #fffdf8;
  --ink: #172329;
  --muted: #5e6763;
  --line: rgba(23, 35, 41, 0.12);
  --accent: #0f8f85;
  --accent-strong: #0b5f67;
  --accent-soft: rgba(15, 143, 133, 0.14);
  --warm: #ef8f3a;
  --danger: #b44137;
  --shadow: 0 24px 70px rgba(23, 35, 41, 0.16);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --font-display: "Aptos Display", "Bahnschrift", "Trebuchet MS", sans-serif;
  --font-body: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(15, 143, 133, 0.2), transparent 30%),
    radial-gradient(circle at 82% 16%, rgba(239, 143, 58, 0.22), transparent 24%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--ink);
  font-family: var(--font-body);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(23, 35, 41, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 35, 41, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 84%);
}

.app-shell {
  min-height: 100vh;
  width: min(100%, 100vw);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-stage {
  width: min(100%, 460px);
  margin-inline: auto;
  justify-self: center;
}

.login-card {
  position: relative;
  display: grid;
  gap: 22px;
  padding: 34px 30px 30px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 242, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(15, 143, 133, 0.16));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.login-header {
  display: grid;
  text-align: center;
}

.login-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.85rem);
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.login-form {
  display: grid;
  gap: 16px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  font-size: 0.94rem;
  font-weight: 700;
}

.field-group input {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.field-group input:focus {
  outline: none;
  border-color: rgba(15, 143, 133, 0.58);
  box-shadow: 0 0 0 4px rgba(15, 143, 133, 0.12);
  transform: translateY(-1px);
}

.text-link {
  justify-self: start;
  border: none;
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(11, 95, 103, 0.32);
  text-underline-offset: 4px;
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(23, 35, 41, 0.14);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  box-shadow: none;
}

.btn-login {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.btn-create-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.btn-create-secondary {
  background: rgba(23, 35, 41, 0.08);
  color: var(--ink);
}

.btn-back {
  background: rgba(23, 35, 41, 0.08);
  color: var(--ink);
}

.btn-link {
  text-decoration: none;
}

.activation-card {
  min-height: 220px;
  place-content: center;
}

.single-action {
  display: grid;
  justify-items: center;
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  justify-items: end;
  pointer-events: none;
}

.toast {
  width: fit-content;
  min-width: min(420px, calc(100vw - 32px));
  max-width: min(900px, calc(100vw - 32px));
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(180, 65, 55, 0.18);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 22px 50px rgba(23, 35, 41, 0.2);
  backdrop-filter: blur(18px);
}

.toast.is-warning {
  border-color: rgba(180, 65, 55, 0.22);
}

.toast.is-success {
  border-color: rgba(15, 143, 133, 0.28);
}

.toast-progress {
  height: 5px;
  background: linear-gradient(135deg, var(--warm), var(--danger));
  transform-origin: left center;
  animation: toast-progress var(--toast-duration, 1500ms) linear forwards;
}

.toast.is-success .toast-progress {
  background: linear-gradient(135deg, #3cb682, var(--accent));
}

.toast-message {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: nowrap;
}

.toast-messages {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}

.toast-messages:empty {
  margin: 0;
  padding: 0;
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 16px;
  }

  .login-card {
    padding: 28px 20px 22px;
  }

  .toast-stack {
    right: 16px;
    bottom: 16px;
  }

  .toast {
    min-width: 0;
    width: min(100%, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
  }

  .toast-message {
    white-space: normal;
    overflow-wrap: anywhere;
  }

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