@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap");

:root {
  --background: #ffffff;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --primary: #171717;
  --primary-foreground: #fafafa;
  --muted: #f5f5f5;
  --muted-foreground: #737373;
  --accent: #e9e9e9;
  --border: #d6d6d6;
  --input: #bdbdbd;
  --ring: #0a0a0a;
  --warning-muted: #fff7ed;
  --warning-border: #fed7aa;
  --warning-foreground: #7c2d12;
  --destructive: #dc2626;
  --radius: 0.5rem;
  --font-display: "Inter", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--foreground);
  background: var(--background);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--foreground);
  font-weight: 500;
  text-underline-offset: 3px;
}

.shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.card {
  width: min(100%, 28rem);
  padding: 2rem;
  border: 0.5px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 0.75rem;
  background: var(--card);
  box-shadow: none;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.brand-word {
  color: var(--foreground);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 1;
}

.eyebrow {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.form {
  display: grid;
  gap: 1rem;
}

.compact-form {
  margin-bottom: 1rem;
}

.auth-tabs > input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.tab-panel {
  display: none;
}

#login-tab-sms:checked ~ .tab-panel-sms,
#login-tab-password:checked ~ .tab-panel-password {
  display: block;
}

.auth-switch {
  margin: 0.875rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  text-align: center;
}

.auth-switch label {
  color: var(--foreground);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.inline-field {
  display: grid;
  gap: 0.35rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

label {
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
}

input {
  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 0.5px solid var(--input);
  border-radius: var(--radius);
  color: var(--foreground);
  background: var(--background);
  font: inherit;
  font-size: 0.875rem;
  outline: none;
}

input::placeholder {
  color: var(--muted-foreground);
}

input:focus {
  border-color: var(--ring);
}

button {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 0.5px solid var(--primary);
  border-radius: var(--radius);
  color: var(--primary-foreground);
  background: var(--primary);
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

button:hover {
  background: color-mix(in srgb, var(--primary) 90%, var(--background));
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.field-status {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.field-status:empty {
  display: none;
}

.field-status.error {
  color: var(--destructive);
}

.field-status.success {
  color: #047857;
}

.phone-input-shell,
.code-input-shell {
  display: grid;
  min-height: 3rem;
  align-items: center;
  border: 0.5px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
  transition: border-color 160ms ease;
}

.phone-input-shell:focus-within,
.code-input-shell:focus-within {
  border-color: var(--ring);
}

.phone-input-shell.is-invalid,
.code-input-shell.is-invalid {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 12%, transparent);
}

.field.is-invalid input {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 12%, transparent);
}

.phone-input-shell {
  grid-template-columns: auto minmax(0, 1fr);
}

.code-input-shell {
  grid-template-columns: minmax(0, 1fr) auto;
}

.phone-prefix {
  padding-left: 0.75rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.phone-input-shell input,
.code-input-shell input {
  height: 100%;
  border: 0;
  background: transparent;
}

.phone-input-shell input:focus,
.code-input-shell input:focus {
  border-color: transparent;
}

.code-input-shell button {
  min-height: 2.25rem;
  margin-right: 0.25rem;
  padding: 0.375rem 0.75rem;
  border-color: transparent;
  color: var(--muted-foreground);
  background: transparent;
  white-space: nowrap;
}

.code-input-shell button:hover {
  color: var(--foreground);
  background: var(--muted);
}

.social-form {
  margin: 0;
}

.social-logins,
.social-compact {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.social-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--accent);
}

.social-login {
  display: block;
  width: 100%;
  border-color: var(--input);
  color: var(--foreground);
  background: var(--background);
  text-align: center;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.social-login:hover {
  color: var(--foreground);
  background: var(--accent);
}

.social-login-openid_connect {
  color: #fff;
  background: #151b2d;
}

.social-login-openid_connect:hover {
  color: #fff;
  background: #242b45;
}

.divider {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 1rem 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.account-footer {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.account-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  font-size: 0.875rem;
}

.social-account-links {
  gap: 0.75rem 1.5rem;
}

.account-action-links {
  gap: 0.75rem;
}

.account-action-links a + a::before {
  display: inline-block;
  margin-right: 0.75rem;
  color: var(--border);
  content: "|";
  text-decoration: none;
}

.account-links a,
.inline-social-login {
  color: var(--muted-foreground);
}

.inline-social-form {
  margin: 0;
}

.inline-social-login {
  display: inline-flex;
  min-height: auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: inherit;
  font-weight: 500;
  line-height: inherit;
  text-decoration: none;
}

.inline-social-login:hover {
  color: var(--foreground);
  background: transparent;
}

.social-icon {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.social-icon-image {
  border-radius: 3px;
  object-fit: contain;
}

.divider::before,
.divider::after {
  height: 1px;
  flex: 1;
  background: var(--border);
  content: "";
}

.muted,
.help,
.lede {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.lede {
  margin-top: 0;
  line-height: 1.6;
}

.error,
.message-error {
  margin: 0;
  color: var(--destructive);
  font-size: 0.875rem;
}

.errorlist {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--destructive);
  font-size: 0.875rem;
}

.user-profile {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.user-profile > div {
  display: grid;
  gap: 0.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--accent);
}

.user-profile dt {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
}

.user-profile dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
}

.auth-account {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--muted);
}

.auth-account p {
  margin: 0;
}

.auth-account-id {
  overflow-wrap: anywhere;
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
}

.switch-account-form {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  color: var(--muted-foreground);
  background: transparent;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover {
  color: var(--foreground);
  background: transparent;
}

.messages {
  margin-bottom: 1rem;
}

.message {
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  color: var(--warning-foreground);
  background: var(--warning-muted);
  font-size: 0.875rem;
}

@media (max-width: 520px) {
  .shell {
    place-items: start center;
    padding-top: 2.5rem;
  }

  .card {
    padding: 1.5rem;
    border: 0;
  }

  .code-input-shell button {
    padding-inline: 0.5rem;
  }

  .social-compact {
    grid-template-columns: 1fr;
  }
}
