:root {
  --brand-purple: #9B4CFF;
  --brand-purple-hover: #7c3ce6;
  --brand-cyan: #00E5FF;
  --brand-dark: #121212;
  --brand-dark-deep: #130d26;
  --brand-grey-50: #f7f7fa;
  --brand-grey-100: #ececf3;
  --brand-grey-300: #c7c7d1;
  --brand-grey-500: #6c6c7a;
  --brand-danger: #dc3545;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 10px 30px -8px rgba(19, 13, 38, 0.18), 0 2px 6px -2px rgba(19, 13, 38, 0.08);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--brand-dark);
  background:
    radial-gradient(ellipse at 20% -10%, rgba(155, 76, 255, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 95% 110%, rgba(0, 229, 255, 0.08) 0%, transparent 55%),
    var(--brand-grey-50);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--brand-dark-deep);
}

.brand-mark {
  width: 28px;
  height: 28px;
  background-color: var(--brand-purple);
  -webkit-mask: url("satalia-mark.svg") center / contain no-repeat;
  mask: url("satalia-mark.svg") center / contain no-repeat;
}

.brand-wordmark {
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--brand-dark-deep);
}

.brand-divider {
  color: var(--brand-grey-300);
  font-weight: 300;
}

.brand-product {
  font-weight: 500;
  font-size: 15px;
  color: var(--brand-grey-500);
}

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 56px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid var(--brand-grey-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 36px 32px 32px;
}

.auth-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--brand-dark-deep);
}

.auth-subtitle {
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--brand-grey-500);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-dark-deep);
}

.field input {
  appearance: none;
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--brand-grey-100);
  border-radius: var(--radius-sm);
  color: var(--brand-dark);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input:focus {
  outline: none;
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(155, 76, 255, 0.18);
}

.btn {
  appearance: none;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 80ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand-purple);
  color: #fff;
  width: 100%;
  margin-top: 4px;
}

.btn-primary:hover {
  background: var(--brand-purple-hover);
}

.btn-google {
  background: #fff;
  color: var(--brand-dark);
  border-color: var(--brand-grey-100);
  width: 100%;
}

.btn-google:hover {
  border-color: var(--brand-grey-300);
  background: var(--brand-grey-50);
}

.btn-google svg {
  width: 18px;
  height: 18px;
}

.btn-ghost {
  background: transparent;
  color: var(--brand-grey-500);
  font-size: 13px;
  padding: 6px 10px;
}

.btn-ghost:hover {
  color: var(--brand-dark-deep);
}

.btn-copy {
  background: var(--brand-purple);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
}

.btn-copy:hover {
  background: var(--brand-purple-hover);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--brand-grey-500);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.error {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(220, 53, 69, 0.06);
  border: 1px solid rgba(220, 53, 69, 0.2);
  color: var(--brand-danger);
  font-size: 13px;
}

.error.is-visible {
  display: block;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn[aria-busy="true"] .spinner {
  display: inline-block;
}

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

.token-panel {
  display: none;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--brand-grey-100);
  border-radius: var(--radius-sm);
  background: var(--brand-grey-50);
}

.token-panel.is-visible {
  display: block;
}

.token-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.token-panel-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-grey-500);
  font-weight: 500;
}

.token-display {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--brand-dark-deep);
  word-break: break-all;
  max-height: 130px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--brand-grey-100);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.toast {
  font-size: 12px;
  color: var(--brand-grey-500);
  margin-left: 10px;
  opacity: 0;
  transition: opacity 200ms ease;
}

.toast.is-visible {
  opacity: 1;
}

.site-footer {
  padding: 20px 32px 28px;
  font-size: 12px;
  color: var(--brand-grey-500);
  text-align: center;
}

.site-footer a {
  color: var(--brand-grey-500);
  text-decoration: none;
  border-bottom: 1px dotted var(--brand-grey-300);
}

.site-footer a:hover {
  color: var(--brand-dark-deep);
}

@media (max-width: 480px) {
  .site-header {
    padding: 20px 20px;
  }
  .auth-card {
    padding: 28px 22px;
  }
  .auth-title {
    font-size: 22px;
  }
}
