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

:root {
  --background: #ffffff;
  --foreground: #09090b;
  --muted: #71717a;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --ring: #18181b;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --radius: 0.375rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Layout - Centered and Scroll-Free */
body.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--background);
  color: var(--foreground);
  font-family: "Inter", system-ui, sans-serif;
  padding: 1.5rem;
  padding-top: 4px;
  overflow-x: hidden;
}

.auth-shell {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
}

/* Branding & Logo */
.brand {
  text-align: center;
  margin-bottom: 2rem;
  width: 100%;
}

.brand-logo {
  display: block;
  margin: 0 0 1.5rem 0;
  width: 100%; /* Forces the logo to stretch exactly to the panel width */
  height: auto;
  object-fit: contain;
}

.brand h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 0.375rem;
}

.brand p {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Panels */
.panel {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.panel-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Alerts */
.auth-error,
.auth-message {
  display: none;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
}

.auth-error {
  background: #fef2f2;
  color: #7f1d1d;
  border: 1px solid #fecaca;
}

.auth-message {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Forms & Inputs */
.auth-form {
  display: grid;
  gap: 1rem;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  display: grid;
  gap: 0.375rem;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--input);
  font-size: 0.875rem;
  background: transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}

/* Password Toggle */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper input {
  padding-right: 2.5rem;
}

.toggle-password {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  padding: 0 0.75rem;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

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

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background-color: #27272a;
}

.btn-secondary {
  background-color: var(--background);
  color: var(--foreground);
  border-color: var(--border);
}

.btn-secondary:hover {
  background-color: #f4f4f5;
}

/* Visual Divider (Or) */
.section {
  padding: 0;
}
.section:last-child {
  position: relative;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.section:last-child::before {
  content: "Or";
  position: absolute;
  top: -0.6rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--background);
  padding: 0 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

/* Passkey List Additions */
.divider {
  display: flex;
  align-items: center;
  margin: 2rem 0 1.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border);
  margin-left: 1rem;
}
.passkey-list {
  display: grid;
  gap: 0.75rem;
}
.passkey-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: #fafafa;
}
.passkey-item h4 {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.passkey-item p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}