.page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  background: var(--background);
  padding: 2rem;
  padding-top: 20vh;
}

.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
  width: 100%;
}

.header {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
}

.duck-icon {
  color: var(--orange-500);
}

.header .title {
  font-size: 3rem;
  font-weight: 400;
  color: var(--gray-800);
  margin: 0;
  line-height: 0.9;
}

@media (prefers-color-scheme: dark) {
  .header .title {
    color: #e5e7eb;
  }
}

.auth-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: white;
  padding: 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-form .title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--gray-900);
  text-align: center;
  margin: 0;
}

.error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  text-align: center;
}

.error-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.input-group {
  position: relative;
}

.input {
  width: 100%;
  padding: 1rem 1rem 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.75rem;
  font-size: 1rem;
  background: white;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--gray-500);
  font-weight: 400;
  pointer-events: none;
  transition: all 0.2s ease;
  background: white;
  padding: 0 0.25rem;
}

/* When input has focus or has content */
.input:focus~.label,
.input:not(:placeholder-shown)~.label,
.has-value .label {
  top: 0;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--gray-600);
  font-weight: 500;
}

.input:focus~.label {
  color: var(--orange-500);
}

.input:focus {
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.input:disabled {
  background-color: var(--gray-200);
  cursor: not-allowed;
  opacity: 0.6;
}

.input:disabled~.label {
  background-color: var(--background);
  opacity: 0.6;
}

.submit-button {
  width: 100%;
  padding: 0.875rem 2rem;
  background-color: var(--orange-500);
  color: white;
  border-radius: 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
  cursor: pointer;
  border: none;
  font-family: inherit;
  margin-top: 0.5rem;
}

.submit-button:hover:not(:disabled) {
  background-color: var(--orange-600);
  transform: translateY(-1px);
}

.submit-button:active:not(:disabled) {
  transform: translateY(0);
}

.submit-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.3);
}

.submit-button:disabled {
  background-color: var(--gray-300);
  cursor: not-allowed;
  transform: none;
}

.switch-mode {
  text-align: center;
  color: var(--gray-700);
  font-size: 0.875rem;
}

.link {
  color: var(--orange-500);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.link:hover {
  color: var(--orange-600);
  text-decoration: underline;
}

.loading {
  color: var(--gray-500);
  font-size: 1rem;
}

@media (max-width: 640px) {
  .page {
    padding: 1rem;
    padding-top: 15vh;
  }

  .main {
    gap: 1.5rem;
  }

  .auth-container {
    padding: 1rem;
  }

  .auth-form {
    padding: 1.5rem;
  }

  .title {
    font-size: 1.5rem;
  }
}

@media (prefers-color-scheme: dark) {
  .auth-form {
    background: #1f2937;
  }

  .auth-form .title {
    color: #e5e7eb;
  }

  .label {
    background: #1f2937;
    color: #9ca3af;
  }

  .input:focus~.label,
  .input:not(:placeholder-shown)~.label,
  .has-value .label {
    background: #1f2937;
    color: #d1d5db;
  }

  .input:focus~.label {
    color: var(--orange-500);
  }

  .input {
    background: #111827;
    border-color: #374151;
    color: #e5e7eb;
  }

  .input:disabled {
    background-color: #1f2937;
  }

  .input:disabled~.label {
    background-color: #111827;
    opacity: 0.6;
  }

  .switch-mode {
    color: #d1d5db;
  }
}